HST Tutorial
This tutorial demonstrates how to use PandExo to predict:
The transmission or emission spectrum signal-to-noise ratio.
The observation start window for a system observed with WFC3/IR.
from importlib.resources import files
import pandexo.engine.justdoit as jdi
Editing Input Dictionaries
Step 1) Load in a blank exoplanet dictionary
exo_dict = jdi.load_exo_dict()
Edit stellar and planet inputs
# WASP-43
exo_dict['star']['jmag'] = 9.995 # J magnitude of the system
exo_dict['star']['hmag'] = 9.397 # H magnitude of the system
# WASP-43b
exo_dict['planet']['type'] = 'user' # user specified inputs
exo_dict['planet']['exopath'] = str(
files('pandexo.engine.reference').joinpath('WASP43b-Eclipse_Spectrum.txt')
) # Packaged model spectrum.
exo_dict['planet']['w_unit'] = 'um' # wavelength unit
exo_dict['planet']['f_unit'] = 'fp/f*' # flux ratio unit (can also put "rp^2/r*^2")
exo_dict['planet']['depth'] = 4.0e-3 # flux ratio
exo_dict['planet']['i'] = 82.6 # Orbital inclination in degrees
exo_dict['planet']['ars'] = 5.13 # Semi-major axis / stellar radius
exo_dict['planet']['period'] = 0.8135 # Orbital period in days
exo_dict['planet']['transit_duration'] = 4170.0/60/60/24 # Optional if given above information.
exo_dict['planet']['w'] = 90 #(optional) longitude of periastron. Default is 90
exo_dict['planet']['ecc'] = 0 #(optional) eccentricity. Default is 0
Step 2) Load in instrument dictionary
WFC3 G141
WFC3 G102
inst_dict = jdi.load_mode_dict('WFC3 G141')
Edit HST/WFC3 detector and observation inputs
exo_dict['observation']['noccultations'] = 5 # Number of transits/eclipses
inst_dict['configuration']['detector']['subarray'] = 'GRISM256' # GRISM256 or GRISM512
inst_dict['configuration']['detector']['nsamp'] = 10 # WFC3 N_SAMP, 1..15
inst_dict['configuration']['detector']['samp_seq'] = 'SPARS5' # WFC3 SAMP_SEQ, SPARS5 or SPARS10
inst_dict['strategy']['norbits'] = 4 # Number of HST orbits
inst_dict['strategy']['nchan'] = 15 # Number of spectrophotometric channels
inst_dict['strategy']['scanDirection'] = 'Forward' # Spatial scan direction, Forward or Round Trip
inst_dict['strategy']['schedulability'] = 30 # 30 for small/medium program, 100 for large program
inst_dict['strategy']['windowSize'] = 20 # (optional) Observation start window size in minutes. Default is 20 minutes.
Run PandExo Command Line
jdi.run_pandexo(exo, inst, param_space=0, param_range=0, save_file=True,
output_path=None, output_file='', num_cores=None, verbose=True)
output_path=None resolves to the working directory when the calculation is
run. Set save_file=False while exploring examples to avoid overwriting a
pickle file; use an explicit output_path and output_file when you want
to retain a result.
foo = jdi.run_pandexo(exo_dict, inst_dict, save_file=False)
Running Single Case w/ User Instrument Dict
****WARNING: Observing plan may incur mid-orbit buffer dumps. Check with APT.
inst_dict['configuration']['detector']['nsamp'] = None
inst_dict['configuration']['detector']['samp_seq'] = None
bar = jdi.run_pandexo(exo_dict, inst_dict, save_file=False)
Running Single Case w/ User Instrument Dict
inst_dict['strategy']['scanDirection'] = 'Round Trip'
hst = jdi.run_pandexo(exo_dict, inst_dict, save_file=False)
Running Single Case w/ User Instrument Dict
Plot Results
Plot Simulated Spectrum
import pandexo.engine.justplotit as jpi
# Use foo from above. Other keys include model=True/False.
datawave, dataspec, dataerror, modelwave, modelspec = jpi.hst_spec(foo)
Simulated WFC3 spectrum for the configured WASP-43b observation.
Compute the Earliest and Latest Start Times
The errors in the time series are the error per wavelength channel. Values are illustrative and can vary with the PandExo, Pandeia, and reference-data versions used for a calculation.
# Use foo from above.
obsphase1, obstr1, obsphase2, obstr2,rms = jpi.hst_time(foo)
First start-window diagnostic.
Second start-window diagnostic.
Print important info for observation
foo['wfc3_TExoNS']['info']
{'Estimated duty cycle (outside of Earth occultation)': 24.991166666666668,
'Maximum pixel fluence (electrons)': 30266.370139081948,
'Number of HST orbits': 4,
'Number of Transits': 5,
'Number of channels': 15,
'Recommended scan rate (arcsec/s)': 0.075999999999999998,
'Scan height (pixels)': 13.454512396694216,
'Start observations between orbital phases': '0.307075052926-0.324148057092',
'Transit depth uncertainty(ppm)': 62.433045276228441,
'WFC3 parameters: NSAMP': 10,
'WFC3 parameters: SAMP_SEQ': 'SPARS5'}