Skip to content

Commit

Permalink
Fixing test_bandpass.py and test_l3.py
Browse files Browse the repository at this point in the history
  • Loading branch information
eunkyuh committed Dec 4, 2024
1 parent 0fd74b9 commit 44b7665
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions romanisim/tests/test_bandpass.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ def test_unevenly_sampled_wavelengths_flux_to_counts(sca=1):
# Add spectral flux density units
total_flux *= u.erg / (u.s * u.cm ** 2 * u.hertz)
an_flux *= u.erg / (u.s * u.cm ** 2 * u.hertz)
import pdb
pdb.set_trace()

for filter in IFILTLIST:
# Define filter area
Expand All @@ -245,6 +247,9 @@ def test_unevenly_sampled_wavelengths_flux_to_counts(sca=1):

# Computed flux
computed_flux = bandpass.compute_count_rate(flux=total_flux, bandpass=filter, sca=sca, wavedist=total_wavedist)
print(filter)
print(an_counts_sum.value, computed_flux)
print(np.isclose(an_counts_sum.value, computed_flux, rtol=4.0e-2))

# Test that proper results (within 4%) are returned for select bands.
assert np.isclose(an_counts_sum.value, computed_flux, rtol=4.0e-2)
3 changes: 2 additions & 1 deletion romanisim/tests/test_l3.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,8 @@ def test_simulate_vs_cps():
metadata['wcsinfo']['ra_ref'] = 270
metadata['wcsinfo']['dec_ref'] = 66
# Adding the detector information as the simulations now support all 18 detectors with their own throughput curves
sca = int(meta['instrument']['detector'][3:])
# Using the default detector from the default_parameters_dictionary as all sca arguments are set to it within l3.py
sca = int(romanisim.parameters.default_parameters_dictionary['instrument']['detector'][3:])

# Set up blank image
im = imdict['im'].copy()
Expand Down

0 comments on commit 44b7665

Please sign in to comment.