Skip to content

Commit

Permalink
Added docstrings in bandpass.py and removed sca arguments from l3.py
Browse files Browse the repository at this point in the history
  • Loading branch information
eunkyuh committed Dec 2, 2024
1 parent 6aa28c5 commit 2d7877e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
12 changes: 10 additions & 2 deletions romanisim/bandpass.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions romanisim/l3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,):
Expand Down Expand Up @@ -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:])

Check warning on line 515 in romanisim/l3.py

View check run for this annotation

Codecov / codecov/patch

romanisim/l3.py#L515

Added line #L515 was not covered by tests

if rng is None and seed is None:
seed = 144
Expand Down

0 comments on commit 2d7877e

Please sign in to comment.