Skip to content

Commit

Permalink
Update test for updated file (#2651)
Browse files Browse the repository at this point in the history
* Update test for updated file

* Apply suggestions from code review

* Fix the rest of phot results

---------

Co-authored-by: P. L. Lim <[email protected]>
  • Loading branch information
rosteen and pllim authored Jan 5, 2024
1 parent b38c5a0 commit 88a5ed1
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions jdaviz/configs/imviz/tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,11 +381,11 @@ def test_parse_hst_drz(self, imviz_helper):
data = imviz_helper.app.data_collection[0]
comp = data.get_component('SCI,1')
assert data.label == 'contents[SCI,1]' # download_file returns cache loc
assert data.shape == (4298, 4220)
assert data.shape == (4299, 4219)
assert_allclose(data.meta['PHOTFLAM'], 7.8711728E-20)
assert isinstance(data.coords, WCS)
assert comp.units == 'electron/s'
assert comp.data.shape == (4298, 4220)
assert comp.data.shape == (4299, 4219)

# --- Since download is expensive, we attach FITS WCS-specific tests here. ---

Expand All @@ -407,29 +407,29 @@ def test_parse_hst_drz(self, imviz_helper):
assert_allclose(sky.dec.deg, 10.802045612042956, rtol=1e-3)
data_unit = u.electron / u.s
assert_quantity_allclose(tbl[0]['background'], 0.0014 * data_unit)
assert_quantity_allclose(tbl[0]['sum'], 126.789257 * data_unit, rtol=1e-3)
assert_quantity_allclose(tbl[0]['sum'], 115.944737 * data_unit, rtol=1e-3)
assert_quantity_allclose(tbl[0]['sum_aper_area'], 2583.959958 * (u.pix * u.pix), rtol=1e-3)
assert_array_equal(tbl[0]['pixarea_tot'], None)
assert_array_equal(tbl[0]['aperture_sum_counts'], None)
assert_array_equal(tbl[0]['aperture_sum_counts_err'], None)
assert_array_equal(tbl[0]['counts_fac'], None)
assert_array_equal(tbl[0]['aperture_sum_mag'], None)
assert_array_equal(tbl[0]['flux_scaling'], None)
assert_quantity_allclose(tbl[0]['min'], -0.026433 * data_unit, rtol=1e-3)
assert_quantity_allclose(tbl[0]['max'], 3.567083 * data_unit, rtol=1e-3)
assert_quantity_allclose(tbl[0]['mean'], 0.049164 * data_unit, rtol=1e-3)
assert_quantity_allclose(tbl[0]['median'], 0.021777 * data_unit, rtol=1e-3)
assert_quantity_allclose(tbl[0]['mode'], -0.032999 * data_unit, rtol=1e-3)
assert_quantity_allclose(tbl[0]['std'], 0.140967 * data_unit, rtol=1e-3)
assert_quantity_allclose(tbl[0]['mad_std'], 0.023014 * data_unit, rtol=1e-3)
assert_quantity_allclose(tbl[0]['var'], 0.019872 * (data_unit * data_unit), rtol=1e-3)
assert_quantity_allclose(tbl[0]['biweight_location'], 0.021012 * data_unit, rtol=1e-3)
assert_quantity_allclose(tbl[0]['biweight_midvariance'], 0.000613 * (data_unit * data_unit), rtol=1e-3) # noqa
assert_quantity_allclose(tbl[0]['fwhm'], 25.22627 * u.pix, rtol=1e-3)
assert_quantity_allclose(tbl[0]['semimajor_sigma'], 12.9581226 * u.pix, rtol=1e-3)
assert_quantity_allclose(tbl[0]['semiminor_sigma'], 7.8490214 * u.pix, rtol=1e-3)
assert_quantity_allclose(tbl[0]['orientation'], 88.733606 * u.deg, rtol=1e-3)
assert_quantity_allclose(tbl[0]['eccentricity'], 0.795676, rtol=1e-3)
assert_quantity_allclose(tbl[0]['min'], -0.042749 * data_unit, rtol=1e-3)
assert_quantity_allclose(tbl[0]['max'], 1.588676 * data_unit, rtol=1e-3)
assert_quantity_allclose(tbl[0]['mean'], 0.04495 * data_unit, rtol=1e-3)
assert_quantity_allclose(tbl[0]['median'], 0.021585 * data_unit, rtol=1e-3)
assert_quantity_allclose(tbl[0]['mode'], -0.025143 * data_unit, rtol=1e-3)
assert_quantity_allclose(tbl[0]['std'], 0.102367 * data_unit, rtol=1e-3)
assert_quantity_allclose(tbl[0]['mad_std'], 0.023415 * data_unit, rtol=1e-3)
assert_quantity_allclose(tbl[0]['var'], 0.010479 * (data_unit * data_unit), rtol=1e-3)
assert_quantity_allclose(tbl[0]['biweight_location'], 0.021173 * data_unit, rtol=1e-3)
assert_quantity_allclose(tbl[0]['biweight_midvariance'], 0.00062 * (data_unit * data_unit), rtol=1e-3) # noqa
assert_quantity_allclose(tbl[0]['fwhm'], 21.538407 * u.pix, rtol=1e-3)
assert_quantity_allclose(tbl[0]['semimajor_sigma'], 10.04406 * u.pix, rtol=1e-3)
assert_quantity_allclose(tbl[0]['semiminor_sigma'], 8.150735 * u.pix, rtol=1e-3)
assert_quantity_allclose(tbl[0]['orientation'], 79.605418 * u.deg, rtol=1e-3)
assert_quantity_allclose(tbl[0]['eccentricity'], 0.584355, rtol=1e-3)

# Request specific extension (name only), use given label
imviz_helper.load_data(filename, ext='CTX', data_label='jclj01010_drz',
Expand Down

0 comments on commit 88a5ed1

Please sign in to comment.