From 69664ff76bda099b52758e8d0f1f80e813fabd66 Mon Sep 17 00:00:00 2001 From: Bryan Hilbert Date: Mon, 4 Mar 2024 17:37:21 -0500 Subject: [PATCH] source_files should be an ArrayField of CharFields --- .../common_monitors/dark_monitor.py | 23 +++++++++++++++---- .../apps/jwql/monitor_models/dark_current.py | 20 ++++++++-------- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/jwql/instrument_monitors/common_monitors/dark_monitor.py b/jwql/instrument_monitors/common_monitors/dark_monitor.py index c7a98ff21..4cbe2f776 100755 --- a/jwql/instrument_monitors/common_monitors/dark_monitor.py +++ b/jwql/instrument_monitors/common_monitors/dark_monitor.py @@ -712,7 +712,7 @@ def process(self, file_list): step_args = {'dark_current': {'skip': True}} # Call the pipeline - outputs = run_parallel_pipeline(pipeline_files, "dark", [output_suffix], self.instrument, step_args=step_args) + #outputs = run_parallel_pipeline(pipeline_files, "dark", [output_suffix], self.instrument, step_args=step_args) for filename in file_list: processed_file = filename.replace("_dark", f"_{output_suffix}") @@ -864,7 +864,7 @@ def process(self, file_list): 'readpattern': self.readpatt, 'mean': amp_mean[key], 'stdev': amp_stdev[key], - 'source_files': source_files, + 'source_files': json.dumps(source_files), 'obs_start_time': min_time, 'obs_mid_time': mid_time, 'obs_end_time': max_time, @@ -936,7 +936,7 @@ def run(self): self.query_end = Time.now().mjd # Loop over all instruments - for instrument in ['miri', 'nircam']: # JWST_INSTRUMENT_NAMES: + for instrument in ['nircam']: # JWST_INSTRUMENT_NAMES: self.instrument = instrument logging.info(f'\n\nWorking on {instrument}') @@ -950,7 +950,7 @@ def run(self): # Get a list of all possible readout patterns associated with the aperture possible_readpatts = RAPID_READPATTERNS[instrument] - for aperture in possible_apertures: + for aperture in ['NRCB1_FULL']: #possible_apertures: logging.info('') logging.info(f'Working on aperture {aperture} in {instrument}') @@ -960,12 +960,25 @@ def run(self): self.skipped_initial_ints = limits['N_skipped_integs'][match][0] self.aperture = aperture - for readpatt in possible_readpatts: + for readpatt in ['RAPID']: #possible_readpatts: self.readpatt = readpatt logging.info(f'\tWorking on readout pattern: {self.readpatt}') # Locate the record of the most recent MAST search self.query_start = self.most_recent_search() + + + + + self.query_start = 59697. # apr 28, 2022 + self.query_end = 59697.26 + + + + + + + logging.info(f'\tQuery times: {self.query_start} {self.query_end}') # Query MAST using the aperture and the time of the diff --git a/jwql/website/apps/jwql/monitor_models/dark_current.py b/jwql/website/apps/jwql/monitor_models/dark_current.py index 41ae1ccac..3b67deba4 100644 --- a/jwql/website/apps/jwql/monitor_models/dark_current.py +++ b/jwql/website/apps/jwql/monitor_models/dark_current.py @@ -37,7 +37,7 @@ class FGSDarkDarkCurrent(models.Model): readpattern = models.CharField(blank=True, null=True) mean = models.FloatField(blank=True, null=True) stdev = models.FloatField(blank=True, null=True) - source_files = models.TextField(blank=True, null=True) # This field type is a guess. + source_files = ArrayField(models.CharField(blank=True, null=True)) obs_start_time = models.DateTimeField(blank=True, null=True) obs_mid_time = models.DateTimeField(blank=True, null=True) obs_end_time = models.DateTimeField(blank=True, null=True) @@ -68,7 +68,7 @@ class FGSDarkPixelStats(models.Model): x_coord = ArrayField(models.IntegerField()) y_coord = ArrayField(models.IntegerField()) type = models.CharField(blank=True, null=True) - source_files = models.TextField(blank=True, null=True) # This field type is a guess. + source_files = ArrayField(models.CharField(blank=True, null=True)) obs_start_time = models.DateTimeField(blank=True, null=True) obs_mid_time = models.DateTimeField(blank=True, null=True) obs_end_time = models.DateTimeField(blank=True, null=True) @@ -104,7 +104,7 @@ class MIRIDarkDarkCurrent(models.Model): readpattern = models.CharField(blank=True, null=True) mean = models.FloatField(blank=True, null=True) stdev = models.FloatField(blank=True, null=True) - source_files = models.TextField(blank=True, null=True) # This field type is a guess. + source_files = ArrayField(models.CharField(blank=True, null=True)) obs_start_time = models.DateTimeField(blank=True, null=True) obs_mid_time = models.DateTimeField(blank=True, null=True) obs_end_time = models.DateTimeField(blank=True, null=True) @@ -135,7 +135,7 @@ class MIRIDarkPixelStats(models.Model): x_coord = ArrayField(models.IntegerField()) y_coord = ArrayField(models.IntegerField()) type = models.CharField(blank=True, null=True) - source_files = models.TextField(blank=True, null=True) # This field type is a guess. + source_files = ArrayField(models.CharField(blank=True, null=True)) obs_start_time = models.DateTimeField(blank=True, null=True) obs_mid_time = models.DateTimeField(blank=True, null=True) obs_end_time = models.DateTimeField(blank=True, null=True) @@ -171,7 +171,7 @@ class NIRCamDarkDarkCurrent(models.Model): readpattern = models.CharField(blank=True, null=True) mean = models.FloatField(blank=True, null=True) stdev = models.FloatField(blank=True, null=True) - source_files = models.TextField(blank=True, null=True) # This field type is a guess. + source_files = ArrayField(models.CharField(blank=True, null=True)) obs_start_time = models.DateTimeField(blank=True, null=True) obs_mid_time = models.DateTimeField(blank=True, null=True) obs_end_time = models.DateTimeField(blank=True, null=True) @@ -202,7 +202,7 @@ class NIRCamDarkPixelStats(models.Model): x_coord = ArrayField(models.IntegerField()) y_coord = ArrayField(models.IntegerField()) type = models.CharField(blank=True, null=True) - source_files = models.TextField(blank=True, null=True) # This field type is a guess. + source_files = ArrayField(models.CharField(blank=True, null=True)) obs_start_time = models.DateTimeField(blank=True, null=True) obs_mid_time = models.DateTimeField(blank=True, null=True) obs_end_time = models.DateTimeField(blank=True, null=True) @@ -238,7 +238,7 @@ class NIRISSDarkDarkCurrent(models.Model): readpattern = models.CharField(blank=True, null=True) mean = models.FloatField(blank=True, null=True) stdev = models.FloatField(blank=True, null=True) - source_files = models.TextField(blank=True, null=True) # This field type is a guess. + source_files = ArrayField(models.CharField(blank=True, null=True)) obs_start_time = models.DateTimeField(blank=True, null=True) obs_mid_time = models.DateTimeField(blank=True, null=True) obs_end_time = models.DateTimeField(blank=True, null=True) @@ -269,7 +269,7 @@ class NIRISSDarkPixelStats(models.Model): x_coord = ArrayField(models.IntegerField()) y_coord = ArrayField(models.IntegerField()) type = models.CharField(blank=True, null=True) - source_files = models.TextField(blank=True, null=True) # This field type is a guess. + source_files = ArrayField(models.CharField(blank=True, null=True)) obs_start_time = models.DateTimeField(blank=True, null=True) obs_mid_time = models.DateTimeField(blank=True, null=True) obs_end_time = models.DateTimeField(blank=True, null=True) @@ -305,7 +305,7 @@ class NIRSpecDarkDarkCurrent(models.Model): readpattern = models.CharField(blank=True, null=True) mean = models.FloatField(blank=True, null=True) stdev = models.FloatField(blank=True, null=True) - source_files = models.TextField(blank=True, null=True) # This field type is a guess. + source_files = ArrayField(models.CharField(blank=True, null=True)) obs_start_time = models.DateTimeField(blank=True, null=True) obs_mid_time = models.DateTimeField(blank=True, null=True) obs_end_time = models.DateTimeField(blank=True, null=True) @@ -336,7 +336,7 @@ class NIRSpecDarkPixelStats(models.Model): x_coord = ArrayField(models.IntegerField()) y_coord = ArrayField(models.IntegerField()) type = models.CharField(blank=True, null=True) - source_files = models.TextField(blank=True, null=True) # This field type is a guess. + source_files = ArrayField(models.CharField(blank=True, null=True)) obs_start_time = models.DateTimeField(blank=True, null=True) obs_mid_time = models.DateTimeField(blank=True, null=True) obs_end_time = models.DateTimeField(blank=True, null=True)