Skip to content

Commit

Permalink
Merge pull request #1213 from rzellem/develop
Browse files Browse the repository at this point in the history
Release Tess Enhancements and Filter Detection Improvements
  • Loading branch information
rzellem authored Aug 7, 2023
2 parents 2194dbe + df4da6b commit 5894b8f
Show file tree
Hide file tree
Showing 7 changed files with 275 additions and 93 deletions.
15 changes: 9 additions & 6 deletions examples/tess.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
# git clone https://github.com/rzellem/EXOTIC.git
# cd EXOTIC
# git checkout tess
# conda create -n tess python=3.9
# conda activate tess
# pip install pandas scipy matplotlib astropy statsmodels cython numpy==1.21.6
# pip install wotan transitleastsquares pylightcurve lightkurve==2.0.6 ultranest==3.5.6
# conda create -n tess_exotic python=3.9
# conda activate tess_exotic
# pip install .
# cd examples
# pip install lightkurve==2.0.6 statsmodels wotan transitleastsquares
# pip install numpy==1.21.6
# cd examples/
# python tess.py -t "HAT-P-18 b"

import os
import copy
import json
Expand Down Expand Up @@ -544,7 +545,9 @@ def check_std(time, flux, dt=0.5): # dt = [hr]
myfit = lc_fitter(time[tmask]+2457000.0, flux[tmask], phot_std/flux[tmask], airmass, tpars, mybounds, verbose=True)

# create plots
myfit.plot_bestfit(title=f"{args.target} Global Fit")
fig,ax = myfit.plot_bestfit(title=f"{args.target} Global Fit")
# set y_limit between 1 and 99 percentile
ax[0].set_ylim([np.percentile(flux, 1)*0.99, np.percentile(flux,99)*1.01])
plt.savefig( os.path.join( planetdir, planetname+"_global_fit.png"))
plt.close()

Expand Down
2 changes: 1 addition & 1 deletion exotic/api/ew.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def get_data(self):
r = urllib.request.urlopen(
os.path.join(base_uri,self.files['file_data_json'][2:]))
jdata = json.loads(r.read().decode(r.info().get_param('charset') or 'utf-8'))
return np.array(jdata[1:],dtype=np.float).T
return np.array(jdata[1:],dtype=float).T

def translate_keys(rdict):
""" Translates the keys to a compatible format for EXOTIC/ELCA
Expand Down
79 changes: 39 additions & 40 deletions exotic/api/filters.py
Original file line number Diff line number Diff line change
@@ -1,79 +1,78 @@
# Sources for FWHM band wavelengths are referenced below, respectively
# note that all below units default to nm
fwhm = {
__fwhm = {
# AAVSO, Source(s): AAVSO International Database; https://www.aavso.org/filters
# Johnson
"Johnson U": {"name": "U", "desc": "Johnson U", "fwhm": ("333.8", "398.8")},
"Johnson B": {"name": "B", "desc": "Johnson B", "fwhm": ("391.6", "480.6")},
"Johnson V": {"name": "V", "desc": "Johnson V", "fwhm": ("502.8", "586.8")},
"Johnson R": {"name": "RJ", "desc": "Johnson R", "fwhm": ("590.0", "810.0")},
"Johnson I": {"name": "IJ", "desc": "Johnson I", "fwhm": ("780.0", "1020.0")},
"Johnson U": {"name": "U", "fwhm": ("333.8", "398.8")},
"Johnson B": {"name": "B", "fwhm": ("391.6", "480.6")},
"Johnson V": {"name": "V", "fwhm": ("502.8", "586.8")},
"Johnson R": {"name": "RJ", "fwhm": ("590.0", "810.0")},
"Johnson I": {"name": "IJ", "fwhm": ("780.0", "1020.0")},

# Cousins
"Cousins R": {"name": "R", "desc": "Cousins R", "fwhm": ("561.7", "719.7")},
"Cousins I": {"name": "I", "desc": "Cousins I", "fwhm": ("721.0", "875.0")},
"Cousins R": {"name": "R", "fwhm": ("561.7", "719.7")},
"Cousins I": {"name": "I", "fwhm": ("721.0", "875.0")},

# Near-Infrared
"Near-Infrared J": {"name": "J", "desc": "Near-Infrared J", "fwhm": ("1040.0", "1360.0")},
"Near-Infrared H": {"name": "H", "desc": "Near-Infrared H", "fwhm": ("1420.0", "1780.0")},
"Near-Infrared K": {"name": "K", "desc": "Near-Infrared K", "fwhm": ("2015.0", "2385.0")},
"Near-Infrared J": {"name": "J", "fwhm": ("1040.0", "1360.0")},
"Near-Infrared H": {"name": "H", "fwhm": ("1420.0", "1780.0")},
"Near-Infrared K": {"name": "K", "fwhm": ("2015.0", "2385.0")},

# Sloan
"Sloan u": {"name": "SU", "desc": "Sloan u", "fwhm": ("321.8", "386.8")},
"Sloan g": {"name": "SG", "desc": "Sloan g", "fwhm": ("402.5", "551.5")},
"Sloan r": {"name": "SR", "desc": "Sloan r", "fwhm": ("553.1", "693.1")},
"Sloan i": {"name": "SI", "desc": "Sloan i", "fwhm": ("697.5", "827.5")},
"Sloan z": {"name": "SZ", "desc": "Sloan z", "fwhm": ("841.2", "978.2")},
"Sloan u": {"name": "SU", "fwhm": ("321.8", "386.8")},
"Sloan g": {"name": "SG", "fwhm": ("402.5", "551.5")},
"Sloan r": {"name": "SR", "fwhm": ("553.1", "693.1")},
"Sloan i": {"name": "SI", "fwhm": ("697.5", "827.5")},
"Sloan z": {"name": "SZ", "fwhm": ("841.2", "978.2")},

# Stromgren
"Stromgren u": {"name": "STU", "desc": "Stromgren u", "fwhm": ("336.3", "367.7")},
"Stromgren v": {"name": "STV", "desc": "Stromgren v", "fwhm": ("401.5", "418.5")},
"Stromgren b": {"name": "STB", "desc": "Stromgren b", "fwhm": ("459.55", "478.05")},
"Stromgren y": {"name": "STY", "desc": "Stromgren y", "fwhm": ("536.7", "559.3")},
"Stromgren Hbw": {"name": "STHBW", "desc": "Stromgren Hbw", "fwhm": ("481.5", "496.5")},
"Stromgren Hbn": {"name": "STHBN", "desc": "Stromgren Hbn", "fwhm": ("487.5", "484.5")},
"Stromgren u": {"name": "STU", "fwhm": ("336.3", "367.7")},
"Stromgren v": {"name": "STV", "fwhm": ("401.5", "418.5")},
"Stromgren b": {"name": "STB", "fwhm": ("459.55", "478.05")},
"Stromgren y": {"name": "STY", "fwhm": ("536.7", "559.3")},
"Stromgren Hbw": {"name": "STHBW", "fwhm": ("481.5", "496.5")},
"Stromgren Hbn": {"name": "STHBN", "fwhm": ("487.5", "484.5")},

# Optec
"Optec Wing A": {"name": "MA", "desc": "Optec Wing A", "fwhm": ("706.5", "717.5")},
"Optec Wing B": {"name": "MB", "desc": "Optec Wing B", "fwhm": ("748.5", "759.5")},
"Optec Wing C": {"name": "MI", "desc": "Optec Wing C", "fwhm": ("1003.0", "1045.0")},
"Optec Wing A": {"name": "MA", "fwhm": ("706.5", "717.5")},
"Optec Wing B": {"name": "MB", "fwhm": ("748.5", "759.5")},
"Optec Wing C": {"name": "MI", "fwhm": ("1003.0", "1045.0")},

# PanSTARRS
"PanSTARRS z-short": {"name": "ZS", "desc": "PanSTARRS z-short", "fwhm": ("826.0", "920.0")},
"PanSTARRS Y": {"name": "Y", "desc": "PanSTARRS Y", "fwhm": ("946.4", "1054.4")},
"PanSTARRS w": {"name": "N/A", "desc": "PanSTARRS w", "fwhm": ("404.2", "845.8")},
"PanSTARRS z-short": {"name": "ZS", "fwhm": ("826.0", "920.0")},
"PanSTARRS Y": {"name": "Y", "fwhm": ("946.4", "1054.4")},
"PanSTARRS w": {"name": "N/A", "fwhm": ("404.2", "845.8")},

# MObs Clear Filter; Source(s): Martin Fowler
"MObs CV": {"name": "CV", "desc": "MObs CV", "fwhm": ("350.0", "850.0")},
"MObs CV": {"name": "CV", "fwhm": ("350.0", "850.0")},

# Astrodon CBB; Source(s): George Silvis; https://astrodon.com/products/astrodon-exo-planet-filter/
"Astrodon ExoPlanet-BB": {"name": "CBB", "desc": "Astrodon ExoPlanet-BB", "fwhm": ("500.0", "1000.0")},
"Astrodon ExoPlanet-BB": {"name": "CBB", "fwhm": ("500.0", "1000.0")},
}
# expose as fwhm and for convenience set 'desc' field equal to key
fwhm = {k: v for k, v in __fwhm.items() if (v.update(desc=k),)}

# aliases to back-reference naming standard updates
fwhm_alias = {
"J NIR 1.2 micron": "Near-Infrared J",
"J NIR 1.2micron": "Near-Infrared J",
"H NIR 1.6 micron": "Near-Infrared H",
"H NIR 1.6micron": "Near-Infrared H",
"K NIR 2.2 micron": "Near-Infrared K",
"K NIR 2.2micron": "Near-Infrared K",

"LCO Bessell B": "Johnson B",
"LCO Bessell V": "Johnson V",
"LCO Bessell R": "Cousins R",
"LCO Bessell I": "Cousins I",

"J NIR 1.2 micron": "Near-Infrared J",
"H NIR 1.6 micron": "Near-Infrared H",
"K NIR 2.2 micron": "Near-Infrared K",

"LCO SDSS u'": "Sloan u",
"LCO SDSS g'": "Sloan g",
"LCO SDSS r'": "Sloan r",
"LCO SDSS i'": "Sloan i",

"LCO Pan-STARRS Y": "PanSTARRS Y",
"LCO Pan-STARRS zs": "PanSTARRS z-short",
"LCO Pan-STARRS Y": "PanSTARRS Y",
"LCO Pan-STARRS w": "PanSTARRS w",

"Exop": "Astrodon ExoPlanet-BB",

"Clear (unfiltered) reduced to V sequence": "MObs CV",

"Exop": "Astrodon ExoPlanet-BB",
}
Loading

0 comments on commit 5894b8f

Please sign in to comment.