Skip to content

Commit

Permalink
Merge branch 'main' into bkgsub
Browse files Browse the repository at this point in the history
  • Loading branch information
schlafly authored Nov 14, 2024
2 parents c1b6a09 + 0579dac commit 579cbde
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions romancal/source_catalog/source_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,19 +507,18 @@ def _aper_local_background(self):
bkg_median = []
bkg_std = []
for mask in bkg_aper_masks:
bkg_data = mask.get_values(self.model.data.value)
bkg_data = mask.get_values(self.model.data)
values = sigclip(bkg_data, masked=False)
nvalues.append(values.size)
bkg_median.append(np.median(values))
bkg_std.append(np.std(values))

nvalues = np.array(nvalues)
bkg_median = np.array(bkg_median)
# standard error of the median
bkg_median_err = np.sqrt(np.pi / (2.0 * nvalues)) * np.array(bkg_std)
bkg_median = u.Quantity(bkg_median)
bkg_std = u.Quantity(bkg_std)

bkg_median <<= self.model.data.unit
bkg_median_err <<= self.model.data.unit
# standard error of the median
bkg_median_err = np.sqrt(np.pi / (2.0 * nvalues)) * bkg_std

return bkg_median, bkg_median_err

Expand Down Expand Up @@ -1165,7 +1164,7 @@ def catalog(self):
self._update_metadata()
catalog.meta.update(self.meta)

# convert QTable to Table
# convert QTable to Table to avoid having Quantity columns
catalog = Table(catalog)

# split SkyCoord columns into separate RA and Dec columns
Expand Down

0 comments on commit 579cbde

Please sign in to comment.