Skip to content

Commit

Permalink
Added tutorials_jwst_miri_programs.qmd file showing how
Browse files Browse the repository at this point in the history
to extract all programs for a given observing mode
  • Loading branch information
pcubillos committed Oct 24, 2024
1 parent 8a893b7 commit 59184d7
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 4 deletions.
3 changes: 2 additions & 1 deletion docs/tutorials.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ A collection of scripts to run `Gen TSO` from a jupyter notebook or a python int

**Databases:**

- [Display and parse existing JWST programs](tutorials_jwst_programs.qmd)
- [Display all successful JWST transit programs](tutorials_jwst_successful_programs.qmd)
- [Display all existing JWST MIRI/LRS programs](tutorials_jwst_miri_programs.qmd)

<br>
---
Expand Down
54 changes: 54 additions & 0 deletions docs/tutorials_jwst_miri_programs.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
title: Display JWST programs
page-navigation: true
format:
html:
code-fold: false
jupyter: python3
---

Lets use `Gen TSO` to show all JWST MIRI LRS programs:

1. parsed by host
2. highlight unsuccessful programs

```{python}
import gen_tso.catalogs as cat
import numpy as np
# Get all hosts. Remember trexolists only knows hosts, not planets
catalog = cat.Catalog()
hosts = [target.host for target in catalog.targets]
unique_hosts, u_indices = np.unique(hosts, return_index=True)
mode = 'MIRI LRS'
for j in u_indices:
target = catalog.targets[j]
has_jwst_data = (
target.is_jwst and
target.is_transiting and
mode in target.trexo_data['mode']
)
if has_jwst_data:
obs = target.trexo_data
programs = obs['program']
events = obs['event']
status = obs['status']
nobs = len(events)
# Loop over programs, highlight the unsuccessful ones
for i in range(nobs):
state = status[i]
name = f'{repr(target.host)}'
if state in ['Skipped', 'Failed', 'Withdrawn']:
state = f'*** {status[i]} ***'
name = f'{name} *** '
if obs['mode'][i] == mode:
print(f"{name:18s} {programs[i]:24} {events[i]:10s} {state}")
print('')
```


Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ format:
jupyter: python3
---

Lets use `Gen TSO` to show the list existing JWST programs:
Lets use `Gen TSO` to show all successful existing JWST transit programs:

1. parsed by target
2. excluding failed runs
1. parsed by host
2. filter by transit event
3. excluding failed runs

```{python}
Expand Down

0 comments on commit 59184d7

Please sign in to comment.