Skip to content

Commit d2f4894

Browse files
committed
Added new profoundAperPhot for standalone aperture photometry (previously could only be done as part of profoundProFound). It's a bit experimental, but seems to be working and won't impact core functions.
Users can provide vector app_diam lists (so multiple sizes can be extracted at once) and potentially target only subsets of segID.
1 parent 8535433 commit d2f4894

4 files changed

Lines changed: 8 additions & 32 deletions

File tree

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: ProFound
22
Type: Package
33
Title: Photometry Tools
4-
Version: 1.25.0
5-
Date: 2025-09-16
4+
Version: 1.25.1
5+
Date: 2025-09-17
66
Author: Aaron Robotham
77
Maintainer: Aaron Robotham <aaron.robotham@uwa.edu.au>
88
Description: Core package containing all the tools for simple and advanced source extraction. This is used to create inputs for 'ProFit', or for source detection, extraction and photometry in its own right.

R/profoundSegim.R

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -173,30 +173,6 @@
173173
}
174174
}
175175

176-
.fluxcalcapp = function(x=NULL, y=NULL, flux=NULL, xcen=NULL, ycen=NULL, rad_app=NULL, centype='max'){
177-
if(is.null(xcen)){
178-
if(centype == 'wt'){
179-
xcen = .meanwt(x, flux)
180-
}else if(centype == 'max'){
181-
xcen = x[which.max(flux)]
182-
}
183-
}
184-
185-
if(is.null(ycen)){
186-
if(centype == 'wt'){
187-
ycen = .meanwt(y, flux)
188-
}else if(centype == 'max'){
189-
ycen = y[which.max(flux)]
190-
}
191-
}
192-
193-
rad2 = (x - xcen)^2 + (y - ycen)^2
194-
sel = which(rad2 < rad_app^2)
195-
rad_out = max(rad2[sel])
196-
sel_out = which(rad2 == rad_out)
197-
return(list(flux_app=sum(flux[sel], na.rm=TRUE), flux_min = mean(flux[sel_out]), N=length(sel)))
198-
}
199-
200176
profoundMakeSegim=function(image=NULL, mask=NULL, objects=NULL, skycut=1, pixcut=3,
201177
tolerance=4, ext=2, reltol=0, cliptol=Inf, sigma=1, smooth=TRUE,
202178
SBlim=NULL, magzero=0, gain=NULL, pixscale=1, sky=NULL,
@@ -758,7 +734,7 @@ profoundSegimStats=function(image=NULL, segim=NULL, mask=NULL, sky=NULL, skyRMS=
758734
#segvec=which(tabulate(segim)>0)
759735
#segvec=segvec[segvec>0]
760736

761-
segsel=which(segim>0)
737+
segsel = which(segim>0)
762738

763739
xloc = rep(1:xlen, times = ylen)[segsel]
764740
yloc = rep(1:ylen, each = xlen)[segsel]

man/profoundProFound.Rd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,13 @@ Integer scalar; the maximum number of curve of growth dilations that should be m
8686
Numeric scalar; After the curve of growth dilations, \option{threshold} is the relative change of the converging property (see \option{converge}) that flags convergence. If consecutive iterations have a relative difference within this ratio then the dilation is stopped, and this iteration is used to define the segmentation of the object. The effect of this is that different objects will be dilated for a different number of iterations. Usually fainter sources require more. Note from v1.4: covergence has to be monotonically decreasing as dilation occurs, i.e. the flux can grow from x1.4 to x1.1 (next iteration), but not x1.4 to x2. Dilations with increasing growth rate are ignored.
8787
}
8888
\item{magzero}{
89-
Numeric scalar; the magnitude zero point. What this implies depends on the magnitude system being used (e.g. AB or Vega). If provided along with \option{pixscale} then the flux and surface brightness outputs will represent magnitudes and mag/asec^2.
89+
Numeric scalar; the magnitude zero point. What this implies depends on the magnitude system being used (e.g. AB or Vega).
9090
}
9191
\item{gain}{
9292
Numeric scalar; the gain (in photo-electrons per ADU). This is only used to compute object shot-noise component of the flux error (else this is set to 0).
9393
}
9494
\item{pixscale}{
95-
Numeric scalar; the pixel scale, where pixscale=asec/pix (e.g. 0.4 for SDSS). If set to 1 (default), then the output is in terms of pixels, otherwise it is in arcseconds. If provided along with \option{magzero} then the flux and surface brightness outputs will represent magnitudes and mag/asec^2.
95+
Numeric scalar; the pixel scale, where pixscale=asec/pix (e.g. 0.4 for SDSS). Note if this is not set then an attempt is made to determine the \option{pixelscale} from the detected WCS information. If provided along with \option{magzero} then the surface brightness output will represent mag/asec^2.
9696
}
9797
\item{sky}{
9898
User provided estimate of the absolute sky level. If this is not provided then it will be computed internally using \code{\link{profoundMakeSkyGrid}}. Can be a scalar or a matrix matching the dimensions of \option{image} (allows values to vary per pixel). This will be subtracted off the \option{image} internally, so only provide this if the sky does need to be subtracted!
@@ -245,7 +245,7 @@ Character scalar, only relevent when \option{deblendtype}='psf'. Either 'extende
245245
Character scaler; specifies whether fluxes will be output in Jansky / MicroJansky ('Jansky' / 'microjansky'), or in raw/unscaled image ADUs ('Raw' / 'ADU' / 'ADUs', the default). You can only use Jansky / MicroJansky if the specified \option{magzero} gets the data into the AB system, else the fluxes will not be Jansky.
246246
}
247247
\item{app_diam}{
248-
Numeric scalar; the diameter in arc seconds to use for circular aperture photometry. This will use the appropriate pixel scale to convert the aperture into image units. The circular aperture photometry is output to columns \option{flux_app} and \option{mag_app} in \option{segstats}. The default of NA means this is ignored (and \option{flux_app} / \option{mag_app} will be NA).
248+
Numeric scalar; the diameter in arc seconds to use for circular aperture photometry (hence 'app'). This will use the appropriate pixel scale to convert the aperture into image units. The circular aperture photometry is output to columns \option{flux_app} and \option{mag_app} in \option{segstats}. The default of NA means this is ignored (and \option{flux_app} / \option{mag_app} will be NA).
249249
}
250250
\item{Ndeblendlim}{
251251
Integer scalar; the limit for the number of pixels to consider in a deblending complex (Ngroup [number of segments in the group] x Npix [number of pixels in the group]). You might want to set this to a value similar to allowable machine memory (1e8 - 1e9 often) just to avoid extreme cases (e.g. large stars with lots of pixels and lots of segments). Only relevant if \option{deblend}=TRUE, see \code{\link{profoundFluxDeblend}}.

man/profoundSegimStats.Rd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ User provided estimate of the absolute sky level. Can be a scalar or a matrix ma
3737
User provided estimate of the RMS of the sky. Can be a scalar or a matrix matching the dimensions of \option{image} (allows values to vary per pixel).
3838
}
3939
\item{magzero}{
40-
Numeric scalar; the magnitude zero point. What this implies depends on the magnitude system being used (e.g. AB or Vega). If provided along with \option{pixscale} then the flux and surface brightness outputs will represent magnitudes and mag/asec^2.
40+
Numeric scalar; the magnitude zero point. What this implies depends on the magnitude system being used (e.g. AB or Vega).
4141
}
4242
\item{gain}{
4343
Numeric scalar; the gain (in photo-electrons per ADU). This is only used to compute object shot-noise component of the flux error (else this is set to 0).
4444
}
4545
\item{pixscale}{
46-
Numeric scalar; the pixel scale, where pixscale=asec/pix (e.g. 0.4 for SDSS). If set to 1 (default), then the output is in terms of pixels, otherwise it is in arcseconds. If provided along with \option{magzero} then the flux and surface brightness outputs will represent magnitudes and mag/asec^2.
46+
Numeric scalar; the pixel scale, where pixscale=asec/pix (e.g. 0.4 for SDSS). Note if this is not set then an attempt is made to determine the \option{pixelscale} from the detected WCS information. If provided along with \option{pixscale} then the surface brightness output will represent mag/asec^2.
4747
}
4848
\item{keyvalues}{
4949
List; header values to be used for the WCS.

0 commit comments

Comments
 (0)