Skip to content

Commit

Permalink
upade sky generation
Browse files Browse the repository at this point in the history
  • Loading branch information
yoachim committed Nov 19, 2024
1 parent 1103c5c commit 5b894c6
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions rubin_sim/skybrightness/generate_hdf5.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,15 @@ def generate_sky(
mjd1 = dict_of_lists["mjds"][-3]
mjd3 = dict_of_lists["mjds"][-1]
if (mjd2 > mjd1) & (mjd2 < mjd3):
indx = np.where(last_5_mjds == mjd2)[0]
indx = np.min(np.where(last_5_mjds == mjd2)[0])
# Linear interpolation weights
wterm = (mjd2 - mjd1) / (mjd3 - mjd1)
w1 = 1.0 - wterm
w2 = wterm
for filter_name in filter_names:
interp_sky = w1 * sky_brightness[filter_name][-3]
interp_sky += w2 * sky_brightness[filter_name][-1]
diff = np.abs(last_5_mags[int(indx)][filter_name] - interp_sky)
diff = np.abs(last_5_mags[indx][filter_name] - interp_sky)
if np.size(diff[~np.isnan(diff)]) > 0:
if np.max(diff[~np.isnan(diff)]) > dm:
can_interp = False
Expand Down Expand Up @@ -200,15 +200,15 @@ def generate_sky(
"outfile": outfile,
"outpath": outpath,
"nside": nside,
"sunLimit": sunLimit,
"airmas_overhead": airmass_overhead,
"dm": dm,
"airmass_limit": airmass_limit,
"alt_limit": alt_limit,
"ra": ra,
"dec": dec,
#"sunLimit": sunLimit,
#"airmas_overhead": airmass_overhead,
#"dm": dm,
#"airmass_limit": airmass_limit,
#"alt_limit": alt_limit,
#"ra": ra,
#"dec": dec,
"verbose": verbose,
"required_mjds": required_mjds,
#"required_mjds": required_mjds,
"version": version,
"fingerprint": fingerprint,
}
Expand Down

0 comments on commit 5b894c6

Please sign in to comment.