Skip to content

Code which enables users to apply a trained XGBoost model to IRAC exoplanet or brown dwarf staring mode data

License

Notifications You must be signed in to change notification settings

jkrick/XGBoost_IRAC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XGBoost_IRAC

Code which enables users to apply a trained XGBoost model to IRAC exoplanet or brown dwarf staring mode data

Summary

The main systematic in high precision photometry with Spitzer IRAC is the intrapixel response function. We see variations in the fluxes in light curves due to the combination of under-sampling with small motions of the telescope which move the light around within a single pixel, and since such a large fraction of the light in the PSF falls in that single pixel, the total light curve varies by up to 8% and 5% in ch1 and ch2 respectively (for a description of instrument details see https://irsa.ipac.caltech.edu/data/SPITZER/docs/irac/iracinstrumenthandbook/).

In Krick et al 2020 we describe a boosted random forest model which can remove this systematic from exoplanet and brown dearf staring mode datasets. Please see that paper for details of how the model was made and testing how well this model works on science data. Critically, in order to use the model, the photometry and other features of the data must be measured in the same way on your science data as was done in generating the model. Codes to achieve that have been included.

This code only works on ch2 IRAC data (4.5microns) where the data is observed on the sweet spot pixel (pixel 15, 15 of the subarray or same pixel observed in full array)

Requirements

This code requires IDL, python, and jupyter notebooks

IDL

Python

  • batman
  • exoparams
  • sklearn
  • astropy
  • scipy
  • pylab
  • lmfit
  • functools

What is Included (and what does it do)

  • apply_ML_IRAC.ipynb is the main python code to apply model to science data
  • phot_exoplanet_csv.pro is the main IDL code to do photometry
  • all other .pro files are supporting functions for IDL code
  • *.pkl files are the 2 models themselves
  • XO3*.csv files are the photometry files for the 10 XO3 observations

How to use this code

  1. Download the pmap_correct.pro code and associated pmap files from the SSC website (they are too large to include with this github repository) https://irachpp.spitzer.caltech.edu/page/contrib

  2. Download your own data from the Spitzer archive. If you want to use the same data and recreate the plot in Krick et al. 2020, the download the 10 XO3 eclipse observations.https://sha.ipac.caltech.edu/applications/Spitzer/SHA/

  3. Do photometry on the data. To do this, we highly suggest you run phot_exoplanet_csv.pro included here. If you choose to do the photometry yourself, please make sure that you follow the same prescriptions herein (or in Krick et al. 2020). Final output should be in a csv file (like the 10 XO3 csv files included in this repository). Set directory locations and names of observation directories in the top of the phot_exoplanet_csv code.

  4. Apply the systematics correction to the photometry files and plot the output. Run apply_ML_IRAC.ipynb in a jupyter notebook. Change directory location, observation name, and planet name of the dataset in the top cell of the notebook.

  5. Further refinements:

    • Included here are two models which both are able to remove systematics (two .pkl files). They are different and require different feature sets, but both can be accomodated with the csv files included or generated by step 2 above. The code is currently setup to run the 9 feature model - if you want to run the 16 feature model you will need to manually uncomment that line of code and comment out the 9 feature line in the fifth code cell where is says #choose feature set.

    • To tweak the fitting, look in the fourth code cell. Currently the code only allows fitting of the eclipse depth and the out of transit linear baselines. However, you can change that to fit any other parameter you think is warranted. Also hard coded in are ranges of the parameters allowed, and initial guesses at the eclipse depth and argument of periastron which are specific to XO3-b.

    • Plotting is really set up for 10 observations. If you have more/less you will need to adjust those parameters.

    • Running the python code should take maybe a minute for all 10 observations and plotting. Running the idl photometry code takes longer - and will depend on how much data there is to be processed.

About

Code which enables users to apply a trained XGBoost model to IRAC exoplanet or brown dwarf staring mode data

Resources

License

Stars

Watchers

Forks

Packages

No packages published