Skip to content

Commit

Permalink
make updates after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed Jul 24, 2024
1 parent 3636c89 commit 879b1db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def __init__(self, *args, **kwargs):
dataset='dataset',
multiselect=None,
default_text='None',
subset_selected_changed_callback=self._update_extract)
subset_selected_changed_callback=self._update_extract) # noqa

self.bg_spec_add_results = AddResults(self, 'bg_spec_results_label',
'bg_spec_results_label_default',
Expand Down Expand Up @@ -547,7 +547,7 @@ def extract(self, return_bg=False, add_data=True, **kwargs):
spec.meta['_pixel_scale_factor'] = pix_scale_factor

# inform the user if scale factor keyword not in metadata
if 'PIXAR_SR' not in self.spectral_cube.meta:
if 'PIXAR_SR' not in self.cube.meta:
snackbar_message = SnackbarMessage(
("PIXAR_SR FITS header keyword not found when parsing spectral cube. "
"Flux/Surface Brightness will use default PIXAR_SR value of 1 sr/pix^2."),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,14 +367,14 @@ def test_background_subtraction(cubeviz_helper, spectrum1d_cube_largest):
# the background subtracted from each slice in wavelength from the aperture should be equal
# to the background -- which is the minimum per spectral slice in this example cube -- divided
# by the number of pixels in the aperture:
cube_min_per_slice = extract_plg._obj.spectral_cube['flux'].min(axis=(0, 1))
cube_min_per_slice = extract_plg._obj.cube['flux'].min(axis=(0, 1))
np.testing.assert_allclose(
bg_spec.flux.value / n_aperture_pixels,
cube_min_per_slice
)

# background normalized per spaxel should be equal to the minimum per spectral slice:
cube_min_per_slice = extract_plg._obj.spectral_cube['flux'].min(axis=(0, 1))
cube_min_per_slice = extract_plg._obj.cube['flux'].min(axis=(0, 1))
np.testing.assert_allclose(
bg_spec_normed.flux.value / n_bg_pixels,
cube_min_per_slice
Expand Down

0 comments on commit 879b1db

Please sign in to comment.