Skip to content

Commit

Permalink
Added background argument to PandeiaCalculation.set_scene().
Browse files Browse the repository at this point in the history
At the moment, only non-date backrounds can be set
(minzodi/ecliptic + low/medium/high).
Set the default background level to ecliptic low.
Ideally, we want to enable setting dated backgrounds (TBD).
  • Loading branch information
pcubillos committed Apr 16, 2024
1 parent 07f2bd8 commit b131961
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion gen_tso/pandeia_io/pandeia_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,10 @@ def get_configs(self, output=None):
raise ValueError(f"Invalid config output: '{output}'")


def set_scene(self, sed_type, sed_model, norm_band, norm_magnitude):
def set_scene(
self, sed_type, sed_model, norm_band, norm_magnitude,
background='ecliptic_low',
):
"""
Set the stellar point-source scene to observe.
Expand All @@ -716,6 +719,10 @@ def set_scene(self, sed_type, sed_model, norm_band, norm_magnitude):
Band over which to normalize the spectrum.
norm_magnitude: float
Magnitude of the star at norm_band.
background: String
Set the background flux. Select from:
'ecliptic_low', 'ecliptic_medium', 'ecliptic_high',
'minzodi_low', 'minzodi_medium', 'minzodi_high'
Examples
--------
Expand All @@ -731,6 +738,10 @@ def set_scene(self, sed_type, sed_model, norm_band, norm_magnitude):
"""
scene = make_scene(sed_type, sed_model, norm_band, norm_magnitude)
self.calc['scene'] = [scene]
bkg, bkg_level = background.strip().split('_')
self.calc['background'] = bkg
self.calc['background_level'] = bkg_level


def get_saturation_values(
self, disperser, filter, subarray, readout, ngroup=2,
Expand Down

0 comments on commit b131961

Please sign in to comment.