From 2d7877e309ff52a6a18aaffad67095e52a3fe594 Mon Sep 17 00:00:00 2001 From: Eunkyu Han Date: Mon, 2 Dec 2024 15:29:50 -0500 Subject: [PATCH] Added docstrings in bandpass.py and removed sca arguments from l3.py --- romanisim/bandpass.py | 12 ++++++++++-- romanisim/l3.py | 8 ++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/romanisim/bandpass.py b/romanisim/bandpass.py index 3a16d46..3ab31e2 100644 --- a/romanisim/bandpass.py +++ b/romanisim/bandpass.py @@ -45,6 +45,8 @@ def read_gsfc_effarea(sca, filename=None): Parameters ---------- + sca : int + the name of the detector. A number between 1-18. filename : str filename to read in @@ -72,6 +74,8 @@ def compute_abflux(sca, effarea=None): Parameters ---------- + sca : int + the name of the detector. A number between 1-18. effarea : astropy.Table.table Table from GSFC with effective areas for each filter. @@ -108,7 +112,8 @@ def get_abflux(bandpass, sca): ---------- bandpass : str the name of the bandpass - + sca : int + the name of the detector. A number between 1-18. Returns ------- float @@ -137,6 +142,8 @@ def compute_count_rate(flux, bandpass, sca, filename=None, effarea=None, wavedis Spectral flux density in units of ergs per second * hertz * cm^2 bandpass : str the name of the bandpass + sca : int + the name of the detector. A number between 1-18. filename : str filename to read in effarea : astropy.Table.table @@ -193,7 +200,8 @@ def etomjysr(bandpass, sca): ---------- bandpass : str the name of the bandpass - + sca : int + the name of the detector. A number between 1-18. Returns ------- float diff --git a/romanisim/l3.py b/romanisim/l3.py index 18e5d6a..b09fcb6 100644 --- a/romanisim/l3.py +++ b/romanisim/l3.py @@ -276,7 +276,7 @@ def l3_psf(bandpass, scale=0, chromatic=False, **kw): return psf -def simulate(shape, wcs, efftimes, filter_name, sca, catalog, nexposures=1, +def simulate(shape, wcs, efftimes, filter_name, catalog, nexposures=1, metadata={}, effreadnoise=None, sky=None, psf=None, bandpass=None, seed=None, rng=None, webbpsf=True, @@ -356,6 +356,8 @@ def simulate(shape, wcs, efftimes, filter_name, sca, catalog, nexposures=1, image = galsim.ImageF(shape[1], shape[0], wcs=romanisim.wcs.GWCS(wcs), xmin=0, ymin=0) + # Using the default SCA + sca = int(romanisim.parameters.default_parameters_dictionary['instrument']['detector'][3:]) pixscalefrac = get_pixscalefrac(image.wcs, shape) etomjysr = romanisim.bandpass.etomjysr(filter_name, sca) / pixscalefrac ** 2 # this should really be per-pixel to deal with small distortions, @@ -460,7 +462,7 @@ def get_pixscalefrac(wcs, shape): return pixscale -def simulate_cps(image, filter_name, sca, efftimes, objlist=None, psf=None, +def simulate_cps(image, filter_name, efftimes, objlist=None, psf=None, xpos=None, ypos=None, coord=None, sky=0, bandpass=None, effreadnoise=None, maggytoes=None, etomjysr=None, rng=None, seed=None, ignore_distant_sources=10,): @@ -509,6 +511,8 @@ def simulate_cps(image, filter_name, sca, efftimes, objlist=None, psf=None, extras : dict catalog of simulated objects in image, noise, and misc. debug """ + # Using the default SCA + sca = int(romanisim.parameters.default_parameters_dictionary['instrument']['detector'][3:]) if rng is None and seed is None: seed = 144