Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dev_scripts/rfp_etc_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
tmp = MakeDevMeta(ref_type='ETC')
# Update meta per detector to get the right values from the form and update description
tmp.meta_etc.instrument_detector = f"WFI{det:02d}"
tmp.meta_etc.description = 'To support new ETC ref file creation by Rick Cosentino to help the ETC team use CRDS.'
tmp.meta_etc.description = 'To support new ETC ref file creation by Rick Cosentino to help the ETC team use CRDS. Now generated from data model.'
# Update the file name to match the detector
fl_name = 'new_roman_etc_' + tmp.meta_etc.instrument_detector
# Instantiate an object and write the file out
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import crds
import numpy as np
import roman_datamodels as rdm
import roman_datamodels.stnode as rds
from roman_datamodels.datamodels import EtcRefModel
import yaml
from crds.client import api

Expand Down Expand Up @@ -103,31 +103,24 @@ def _get_etc_detector_form(self):

return merged_form

# Abstract base classes not needed for ETC config reference file
def calculate_error(self):
return super().calculate_error()

def update_data_quality_array(self):
return super().update_data_quality_array()

def populate_datamodel_tree(self):
"""
Build the Roman datamodel tree for the exposure time calculator
using the merged detector yaml form section.
"""
#TODO replace rds.ExposureTimeRef with the correct roman_datamodels reference class when available.
try:
etc_datamodel_tree = rds.ExposureTimeCalcRef()
except AttributeError:
# use a plain dict
etc_datamodel_tree = {
"meta": {},
"form": {}
}
etc_datamodel_tree["meta"] = self.meta_data.export_asdf_meta()
etc_datamodel_tree["form"] = self.etc_detector_form

etc_datamodel_tree = EtcRefModel()
etc_datamodel_tree['meta'] = self.meta_data.export_asdf_meta()
etc_datamodel_tree['form'] = self.etc_detector_form

return etc_datamodel_tree

# Abstract base classes not needed for ETC config reference file
def calculate_error(self):
return super().calculate_error()

def update_data_quality_array(self):
return super().update_data_quality_array()

# -------------------------------
# Standalone function to update form file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ common:
readnoise_excess_scaling: 1.0
detectors:
WFI01:
saturation_on: true
saturation_fullwell: 60000.0
dark_current_on: true
dark_current: 0.0
readnoise_on: true
readnoise: 6.196895122528076
readnoise_correlation_on: false
flat_field_noise_on: true
saturation_on: true # Saturation used in ETC
saturation_fullwell: 60000.0 # Median saturation limit in DN (counts)
dark_current_on: true # Dark used in ETC
dark_current: 0.0 # Average dark in DN/s (counts/sec)
readnoise_on: true # Read noise used in ETC
readnoise: 6.196895122528076 # Read noise value in DN (counts)
readnoise_correlation_on: false
flat_field_noise_on: true
flat_field_electrons: 716.3978518135043
WFI02:
saturation_on: true
Expand Down
Loading