1.	What is Pandexo ?

Noise simulator designed to simulate transit spectra for JWST => gives you a spectrum and an error bar. 

Technical description : Batalha et al 2017 https://arxiv.org/pdf/1702.01820.pdf  

does not include any photometry modes.
PandExo does not create full light curve models with an ingress and egress. Likewise, it does not include the effects of time-varying stellar noise. Doing so would require frame-by-frame simulations and would be too computationally demanding for a community tool.

	2.	Objectives of the session

-> introduction to Pandexo : 
	•	How to access Pandexo
	•	How to use the GUI
	•	How to get a simulated JWST spectrum
	•	Basic troubleshooting

-> what will not be covered in this hands on session : 
	•	Technical presentation of Pandexo
	•	Technical presentation of the instruments (its more about creating a link between people that know the instruments and the people that know the targets)
	•	Installation of Pandexo
	•	Advanced troubleshooting 
	•	Meaningful simulations / Science

	3.	Accessing Pandexo

The one address to note down : http://pandexo.science.psu.edu:1111/ 

Two ways of accessing Pandexo : 
	•	Installing it locally on your computer : https://natashabatalha.github.io/PandExo/installation.html
	•	Using directly the web version : http://pandexo.science.psu.edu:1111/calculation/new

What’s the difference ?  
Why should I bother to install it on my computer when I can use the online version ? 

Two ways of using Pandexo : 
	•	Command line in python (local version only)
	•	GUI (local + web version)

What do I need to install Pandexo on my computer ?
	•	Python (preferably with a conda distribution)
	•	gcc (included in Xcode on macOS)
	•	Eventually Astroconda
	•	Some luck and/or perseverance

Starting the GUI on your local Pandexo :

In your IPython/IDE/etc : 

import pandexo.engine.run_online as ro 
ro.main() 

Then open your browser and go to : localhost:1111/ 
It should work exactly like http://pandexo.science.psu.edu:1111/ 

Beware of your browser ! 

	4.	Using the GUI

New calculation / Dashboard 

Exemple with WASP-12 
     
Most common mistakes : 
	•	Incomplete form output
	•	File contained header or not in a two column format
	•	Hard saturation
	•	Incorrect units

Frame : unit of data that results from sequentially clocking and digi-tizing all pixels in the rectangular area of the detector 
Group :  number (n) of consecutively read frames with no intervening resets. For all exoplanet time series modes, there is one frame per group 
Integration : composed of a reset of the detector followed by a series of non-destructively sampled groups 

	5.	Visualising and downloading the results

The plots 

Downloading the .p result file 

Accessing the arrays in IPython

import pickle 
result = pickle.load(open(RESULTFILE,'r')) 

Keyword hierarchy :

FinalSpectrum 
    error_w_floor 
    spectrum 
    spectrum_w_rand 
    wave 
OriginalInput 
    model_spec 
    model_wave 
PandeiaOutTrans 
    1d 
        bg 
        bg_rate 
        sn 
        […] 
    2d 
        detector 
        saturation 
        snr 
    information 
        […] 
    input 
        […] 
    [...] 
RawData 

Example : 
result['PandeiaOutTrans']['1d'][‘sn'] => out of transit (?) SNR