zkbt / chromatic

Tools for visualizing spectrosopic light curves, with flux as a function of wavelength and time.
MIT License
14 stars 4 forks source link

Issue with white light curve binning returning 0w when I set some "bad wavelengths" #217

Open catrionamurray opened 1 year ago

catrionamurray commented 1 year ago

Not 100% sure what the issue is but I tried doing a WLC fit for the HAT-P-18b dataset and encountered this issue: EDIT I found the issue, described below

Screen Shot 2023-01-08 at 9 40 56 AM
catrionamurray commented 1 year ago

hatp18_wlc_issue

catrionamurray commented 1 year ago
from chromatic import *
from astroquery.mast import Observations

# download the JWST ERS data directly from MAST
hatp18_filename = "jw02734-o001_t001_niriss_clear-gr700xd-substrip256_x1dints.fits"
Observations.download_file(f"mast:JWST/product/{hatp18_filename}");

# read the data file into chromatic
hatp18 = read_rainbow(hatp18_filename)

hatp18.wavelike["ok"] = (hatp18.wavelength.to_value('micron') < 1.98) | (hatp18.wavelength.to_value('micron')>2.01)

It happens when I add in this line to set the "ok" wavelengths. If I remove that line it works fine!

catrionamurray commented 1 year ago

I think this is solved if I change the threshold minimum_acceptable_ok<1 - otherwise it removes the bin if any wavelengths are bad.