Skip to content

Commit

Permalink
source_files should be an ArrayField of CharFields
Browse files Browse the repository at this point in the history
  • Loading branch information
bhilbert4 committed Mar 4, 2024
1 parent 1fd264b commit 69664ff
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 15 deletions.
23 changes: 18 additions & 5 deletions jwql/instrument_monitors/common_monitors/dark_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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}')

Expand All @@ -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}')

Expand All @@ -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
Expand Down
20 changes: 10 additions & 10 deletions jwql/website/apps/jwql/monitor_models/dark_current.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 69664ff

Please sign in to comment.