lsst / rubin_sim

Scheduler, survey strategy analysis, and other simulation tools for Rubin Observatory.
https://rubin-sim.lsst.io
GNU General Public License v3.0
41 stars 37 forks source link

force wavelenth arrays to be idenical for twilight solar spectra #375

Closed yoachim closed 11 months ago

yoachim commented 11 months ago

Quirks in Bandpass and Sed, so adding a line to prevent extra resampling of an Sed object.

rhiannonlynne commented 11 months ago

Where is the solar spectra coming from? (usually kurucz models aren't uniformly sampled, so I'm wondering where this is coming from).

rhiannonlynne commented 11 months ago

I didn't dig through the code to see how this affects the problem Mike specified .. it seems like it's a cross-platform issue that was the cause of the problem for them (i.e. something like "1100 != 1100"??). I'm not entirely sure if this is going to avoid the problem ... and honestly, I'm not sure why it's happening. What's actually happening in the code is this:

The way to really truly avoid the nan currently is to read in a solar sed that extends beyond the expected range of the wavelengths for the filters, including the Canon filter. What's odd, is this seems to be likely already true? ** OH -- yeah, ok, so this is the problem (I finally unpicked the rest of the steps around this code). You're resampling the Canon filters onto the solar* spectrum wavelength range, but you should just pick a useful range for these. .. why not 350 to 800 nm where they all are well cut off? The solar sed ranges from 300.0 to 2499.999999999758 and it's likely the precision for this long-wavelength value that's causing the problem.

I'm also going to put in a PR to change the "use a nan" to "use the specified fill value" and set that to default to 0. I'll also look around for some other places to simplify what we're doing, as it just got so complicated with extra calls when it was in use for catalogs. this will help prevent this in the future, but for now -- instead of resampling using a different wavelength step, please resample using a more limit wavelength range.

rhiannonlynne commented 11 months ago

If you could please also run ruff and address the errors in this file before closing the PR, that would be great.