Skip to content

Commit

Permalink
Add output columns for wavelet rms and mean
Browse files Browse the repository at this point in the history
  • Loading branch information
darafferty committed Jun 11, 2024
1 parent ced517c commit 561a767
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
4 changes: 4 additions & 0 deletions bdsf/gausfit.py
Original file line number Diff line number Diff line change
Expand Up @@ -1004,6 +1004,8 @@ def __init__(self, img, gaussian, isl_idx, g_idx, flg=0):
self.gresid_mean_def = Float(doc="Island mean in Gaussian residual image", colname='Resid_Isl_mean', units='Jy/beam')
self.sresid_rms_def = Float(doc="Island rms in Shapelet residual image", colname='Resid_Isl_rms', units='Jy/beam')
self.sresid_mean_def = Float(doc="Island mean in Shapelet residual image", colname='Resid_Isl_mean', units='Jy/beam')
self.wave_rms_def = Float(doc="Island rms in wavelet image, Jy/beam", colname='Wave_Isl_rms', units='Jy/beam')
self.wave_mean_def = Float(doc="Island mean in wavelet image, Jy/beam", colname='Wave_Isl_mean', units='Jy/beam')
self.jlevel_def = Int(doc="Wavelet number to which Gaussian belongs", colname='Wave_id')
self.spec_indx_def = Float(doc="Spectral index", colname='Spec_Indx', units=None)
self.e_spec_indx_def = Float(doc="Error in spectral index", colname='E_Spec_Indx', units=None)
Expand Down Expand Up @@ -1081,5 +1083,7 @@ def __init__(self, img, gaussian, isl_idx, g_idx, flg=0):
self.size_pixE = errors[3:6]
self.rms = img.islands[isl_idx].rms
self.mean = img.islands[isl_idx].mean
self.wave_rms = 0.0 # set if needed in the wavelet operation
self.wave_mean = 0.0 # set if needed in the wavelet operation
self.total_flux_isl = img.islands[isl_idx].total_flux
self.total_flux_islE = img.islands[isl_idx].total_fluxE
2 changes: 1 addition & 1 deletion bdsf/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,7 @@ def make_output_columns(obj, fits=False, objtype='gaul', incl_spin=False,
'deconv_size_sky', 'deconv_size_skyE',
'deconv_size_sky_uncorr', 'deconv_size_skyE_uncorr',
'total_flux_isl', 'total_flux_islE', 'rms',
'mean', 'gresid_rms', 'gresid_mean',
'mean', 'gresid_rms', 'gresid_mean', 'wave_rms', 'wave_mean',
'code']
elif objtype == 'srl':
if incl_aper:
Expand Down
9 changes: 9 additions & 0 deletions bdsf/wavelet_atrous.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,15 @@ def copy_gaussians(img, isl1, isl2):
gcp = Gaussian(img, g.parameters[:], isl1.island_id, gaus_id)
gcp.gaus_num = gaus_id
gcp.jlevel = g.jlevel
if g.jlevel > 0:
# Preserve the wavelet rms and mean values if the isl2 Gaussian was fit to
# a wavelet image
gcp.wave_rms = g.rms
gcp.wave_mean = g.mean
else:
gcp.wave_rms = 0.0
gcp.wave_mean = 0.0

isl1.gaul.append(gcp)
img.ngaus += 1
img.gaussians.append(gcp)
Expand Down
4 changes: 4 additions & 0 deletions doc/source/write_catalog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ The information included in the Gaussian and source catalogs varies by format an

* **Resid_Isl_mean:** the averge residual background mean value of the island (derived from the residual map, after subtraction of fitted Gaussians), in Jy/beam

* **Wave_Isl_rms:** the average background rms value of the island in the wavelet image in which the Gaussian was fit (derived from the rms map), in Jy/beam (``'gaul'`` catalogs only). If the Gaussian is from the fit to the ch0 image (i.e., Wave_id = 0), a value of 0 is used.

* **Wave_Isl_mean:** the averge background mean value of the island in the wavelet image in which the Gaussian was fit (derived from the mean map), in Jy/beam (``'gaul'`` catalogs only). If the Gaussian is from the fit to the ch0 image (i.e., Wave_id = 0), a value of 0 is used.

* **S_Code:** a code that defines the source structure.
* 'S' = a single-Gaussian source that is the only source in the island
* 'C' = a single-Gaussian source in an island with other sources
Expand Down

0 comments on commit 561a767

Please sign in to comment.