Skip to content

Commit

Permalink
Merge pull request spacetelescope#1495 from york-stsci/monitors_setup…
Browse files Browse the repository at this point in the history
…_migrations

Monitors setup migrations
  • Loading branch information
mfixstsci authored Feb 23, 2024
2 parents 7a4d932 + ddb8939 commit 2680c2e
Show file tree
Hide file tree
Showing 17 changed files with 637 additions and 259 deletions.
9 changes: 4 additions & 5 deletions jwql/instrument_monitors/nircam_monitors/claw_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def make_background_plots(self, plot_type='bkg'):
"""

columns = ['filename', 'filter', 'pupil', 'detector', 'effexptm', 'expstart_mjd', 'entry_date', 'mean', 'median',
'stddev', 'frac_masked'] # , 'total_bkg']
'stddev', 'frac_masked', 'total_bkg']

# Get all of the background data.
background_data = NIRCamClawStats.objects.all().values(*columns)
Expand Down Expand Up @@ -192,8 +192,7 @@ def make_background_plots(self, plot_type='bkg'):
df = df[df['stddev'] != 0] # older data has no accurate stddev measures
plot_data = df['stddev'].values
if plot_type == 'model':
total_bkg = [1. for x in df['median'].values]
plot_data = df['median'].values # / df['total_bkg'].values
plot_data = df['median'].values / df['total_bkg'].values
plot_expstarts = df['expstart_mjd'].values

# Plot the background data over time
Expand Down Expand Up @@ -331,8 +330,8 @@ def process(self):
'stddev': float(stddev),
'frac_masked': len(segmap_orig[(segmap_orig != 0) | (dq & 1 != 0)]) / (segmap_orig.shape[0] * segmap_orig.shape[1]),
'skyflat_filename': os.path.basename(self.outfile),
# 'doy': float(doy),
# 'total_bkg': float(total_bkg),
'doy': float(doy),
'total_bkg': float(total_bkg),
'entry_date': datetime.datetime.now()
}
entry = self.stats_table(**claw_db_entry)
Expand Down
46 changes: 46 additions & 0 deletions jwql/utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,52 @@
},
}

# Names of all of the monitor database tables
MONITOR_TABLE_NAMES = [
"fgs_bad_pixel_query_history", "fgs_bad_pixel_stats",
"miri_bad_pixel_query_history", "miri_bad_pixel_stats",
"nircam_bad_pixel_query_history", "nircam_bad_pixel_stats",
"niriss_bad_pixel_query_history", "niriss_bad_pixel_stats",
"nirspec_bad_pixel_query_history", "nirspec_bad_pixel_stats",
"nircam_bias_query_history", "nircam_bias_stats",
"niriss_bias_query_history", "niriss_bias_stats",
"nirspec_bias_query_history", "nirspec_bias_stats",
"nircam_claw_query_history", "nircam_claw_stats",
"monitor",
"central_storage",
"filesystem_characteristics",
"filesystem_general",
"filesystem_instrument",
"fgs_anomaly",
"miri_anomaly",
"nircam_anomaly",
"niriss_anomaly",
"nirspec_anomaly",
"fgs_cosmic_ray_query_history", "fgs_cosmic_ray_stats",
"miri_cosmic_ray_query_history", "miri_cosmic_ray_stats",
"nircam_cosmic_ray_query_history", "nircam_cosmic_ray_stats",
"niriss_cosmic_ray_query_history", "niriss_cosmic_ray_stats",
"nirspec_cosmic_ray_query_history", "nirspec_cosmic_ray_stats",
"fgs_dark_dark_current", "fgs_dark_pixel_stats", "fgs_dark_query_history",
"miri_dark_dark_current", "miri_dark_pixel_stats", "miri_dark_query_history",
"nircam_dark_dark_current", "nircam_dark_pixel_stats", "nircam_dark_query_history",
"niriss_dark_dark_current", "niriss_dark_pixel_stats", "niriss_dark_query_history",
"nirspec_dark_dark_current", "nirspec_dark_pixel_stats", "nirspec_dark_query_history",
"fgs_edb_blocks_stats", "fgs_edb_daily_stats", "fgs_edb_every_change_stats", "fgs_edb_time_interval_stats", "fgs_edb_time_stats",
"miri_edb_blocks_stats", "miri_edb_daily_stats", "miri_edb_every_change_stats", "miri_edb_time_interval_stats", "miri_edb_time_stats",
"nircam_edb_blocks_stats", "nircam_edb_daily_stats", "nircam_edb_every_change_stats", "nircam_edb_time_interval_stats", "nircam_edb_time_stats",
"niriss_edb_blocks_stats", "niriss_edb_daily_stats", "niriss_edb_every_change_stats", "niriss_edb_time_interval_stats", "niriss_edb_time_stats",
"nirspec_edb_blocks_stats", "nirspec_edb_daily_stats", "nirspec_edb_every_change_stats", "nirspec_edb_time_interval_stats", "nirspec_edb_time_stats",
"nirspec_grating_stats",
"fgs_readnoise_query_history", "fgs_readnoise_stats",
"miri_readnoise_query_history", "miri_readnoise_stats",
"nircam_readnoise_query_history", "nircam_readnoise_stats",
"niriss_readnoise_query_history", "niriss_readnoise_stats",
"nirspec_readnoise_query_history", "nirspec_readnoise_stats",
"miri_ta_query_history", "miri_ta_stats",
"nirspec_ta_query_history", "nirspec_ta_stats"
]

# Suffix for msa files
MSA_SUFFIX = ["msa"]

Expand Down
Loading

0 comments on commit 2680c2e

Please sign in to comment.