-
Notifications
You must be signed in to change notification settings - Fork 1
PointSourceExtractor
PointSourceExtractor provides functionality for identifying and characterizing point sources in an image. The source extraction algorithm is described here:
https://iopscience.iop.org/article/10.1088/1538-3873/ab7ee8
PointSourceExtractor()
The default constructor for the class object, used when an image is to be examined for sources.
PointSourceExtractor(double[] XCoords, double[] YCoords)
The constructor for the class object used when an image already has a given list of coordinate locations for sources in the image. Use overload of Extract_Sources
referencing the objects own centroids to determine source characteristics at the coordinate locations.
PointSourceExtractor(JPFITS.FITSBinTable BinTablePSE)
The constructor for the class object based on a PointSourceExtractor saved from another session.
Extract_Sources(double[,] image, double pix_saturation, double pix_min, double pix_max, double kernel_min, double kernel_max, bool threshholds_as_SN, int kernel_radius, int source_separation, bool auto_background, string kernel_filename_template, bool[,]? ROI_region, bool show_waitbar)
Searches for sources within a 2D image array.
-
image
The 2D image array to find sources in. -
pix_saturation
The saturation threshold of the image pixels, for finding saturation islands. Set equal to zero (0) if not needed. -
pix_min
The minimum pixel threshold value (or SN) to consider a potential source. -
pix_max
The maximum pixel threshold value (or SN) to consider a potential source. -
kernel_min
The minimum kernel pixel sum threshold value (or SN) to consider a potential source. -
kernel_max
The maximum kernel pixel sum threshold value (or SN) to consider a potential source. -
threshholds_as_SN
Treat the thresholds as Signal to Noise instead of pixel values. -
kernel_radius
The radius (pixels) of the kernel to find sources within. Secondary sources within the radius will be ignored. -
source_separation
The separation (pixels) between sources. Only the brightest source within the separation radius is kept. -
auto_background
Automatically determine the local background for potential sources. Not required if background is known to be zeroed, but should have no effect if used in this case. -
kernel_filename_template
The template full file name for the kernels to be saved. Sources will be numbered sequentially. Pass empty string for no saving. -
ROI_region
A boolean array of valid area to examine. Pass null or array of equal dimension to source image all true for entire image search. -
show_waitbar
Show a cancellable wait bar.
Extract_Sources(double[,] image, double[] XCoords, double[] YCoords, int kernel_radius, bool auto_background, string kernel_filename_template)
Determines centroids and other kernel information for known sources at given coordinates.
-
image
The 2D image array containing the known sources to extract. -
XCoords
The x-axis coordinates of the sources. These can be PSE.Centroids_X. -
YCoords
The y-axis coordinates of the sources. These can be PSE.Centroids_Y. -
kernel_radius
The radius (pixels) of the kernel to centroid. -
auto_background
Automatically determine the local background for potential sources. Not required if background is known to be zeroed, but should have no effect if used in this case. -
kernel_filename_template
The template full file name for the kernels to be saved. Sources will be numbered sequentially. Pass empty string for no saving.
Extract_Attempt_N_Sources(int N, double[,] image, double pix_saturation, double pix_min, double pix_max, double kernel_min, double kernel_max, bool threshholds_as_SN, int kernel_radius, int source_separation, bool auto_background, string kernel_filename_template, bool[,]? ROI_region, bool show_waitbar)
Attempt to find N strongest sources in an image.
-
N
The number of strongest sources to try to find. - Other parameters as above.
Fit_Sources_Gaussian_Circular(double[] Pinit, double[] LBnds, double[] UBnds)
Performs a least-squares fit on all sources of the form
G(x,y|P) = P(0) * exp( -((x - P(1)).^2 + (y - P(2)).^2 ) / (2*P(3)^2)) + P(4)
-
Pinit
Initial guesses for the fit parameters. Only P(3) and P(4) are used, all other parameter initial estimates are determined locally. -
LBnds
Lower bounds for the fit parameters. Only LBnds(3) and LBnds(4) are used, all other parameter bound estimates are determined locally. -
UBnds
Upper bounds for the fit parameters. Only UBnds(3) and LBnds(4) are used, all other parameter bound estimates are determined locally.
Fit_Sources_Gaussian_Elliptical(double[] Pinit, double[] LBnds, double[] UBnds)
Performs a least-squares fit on all sources of the form
G(x,y|P) = P(0) * exp( -((x - P(1))*cosd(P(3)) + (y - P(2))sind(P(3))).^2 / (2P(4)^2) - ( -(x - P(1))*sind(P(3)) + (y - P(2))cosd(P(3))).^2 / (2P(5)^2) ) + P(6).
-
Pinit
Initial guesses for the fit parameters. Only P(3), P(4), P(5) and P(6) are used, all other parameter initial estimates are determined locally. -
LBnds
Lower bounds for the fit parameters. Same restrictions as above. -
UBnds
Upper bounds for the fit parameters. Same restrictions as above.
Fit_Sources_Moffat_Circular(double[] Pinit, double[] LBnds, double[] UBnds)
Performs a least-squares fit on all sources of the form
M(x,y|P) = P(0) * ( 1 + { (x - P(1))^2 + (y - P(2))^2 } / P(3)^2 ) ^ (-P(4)) + P(5).
-
Pinit
Initial guesses for the fit parameters. Only P(3), P(4), P(5) are used, all other parameter initial estimates are determined locally. -
LBnds
Lower bounds for the fit parameters. Same restrictions as above. -
UBnds
Upper bounds for the fit parameters. Same restrictions as above.