Spacecraft Control Framework 1.0
Spacecraft Control Library
|
Star image processing functions. More...
Go to the source code of this file.
Classes | |
struct | gaussian_fit_s |
Structure for Gaussian fit. More... | |
struct | gaussian_xyfit_s |
Structure for X/Y Gaussian fit. More... | |
struct | star_blob |
Blob in a star image. More... | |
Typedefs | |
typedef struct gaussian_fit_s | gaussian_fit_t |
Structure for Gaussian fit. | |
typedef struct gaussian_xyfit_s | gaussian_xyfit_t |
Structure for X/Y Gaussian fit. | |
Functions | |
ml_matrix | vm_to_intensity (ml_matrix v) |
Converts visual magnitude to intensity. More... | |
ml_matrix | intensity_to_vm (ml_matrix i) |
Converts intensity to visual magnitude. More... | |
double | vm_to_intensity (double v) |
Converts visual magnitude to intensity. More... | |
double | intensity_to_vm (double i) |
Converts intensity to visual magnitude. More... | |
void | index_to_sub (int r, int c, int k, int *kR, int *kC) |
Matrix index to subscripts. | |
ml_matrix | centroid_COM (const ml_matrix &p, double threshold, int n) |
Find centroids in a pixelmap using the center of mass method. More... | |
ml_matrix | coarse_centroid_COM (const ml_matrix &p, double threshold=0.0, int n=5) |
Find centroids in a pixelmap using blobify & center of mass method. More... | |
int | edge_correction (int k0, int kC, int m) |
Edge correction. More... | |
ml_matrix | zodiacal_light (const ml_matrix &r, const ml_matrix &beta) |
Zodiacal light. More... | |
double | zodiacal_light (double r) |
Zodiacal light. More... | |
void | apply_threshold (ml_matrix &x, double b=-1.0, double T=0.0) |
Star image noise processing function. More... | |
ml_matrix | fit_gaussian (const ml_matrix &pixels, const ml_matrix &r0, gaussian_xyfit_t &data) |
Fit symmetric Gaussians to a star image. More... | |
std::list< star_blob > | Blobify (const ml_matrix &pixels, int minPix=4) |
Blobify a pixelmap. More... | |
Star image processing functions.
ml_matrix vm_to_intensity | ( | ml_matrix | v | ) |
Converts visual magnitude to intensity.
Converts visual magnitude to intensity.
v | Visual magnitude |
Referenced by star_meas::SetStarData(), and zodiacal_light().
ml_matrix intensity_to_vm | ( | ml_matrix | i | ) |
Converts intensity to visual magnitude.
Converts intensity to visual magnitude.
i | Intensity |
double vm_to_intensity | ( | double | v | ) |
Converts visual magnitude to intensity.
Converts visual magnitude to intensity.
v | Visual magnitude |
double intensity_to_vm | ( | double | i | ) |
Converts intensity to visual magnitude.
Converts intensity to visual magnitude.
i | Intensity |
ml_matrix centroid_COM | ( | const ml_matrix & | p, |
double | threshold, | ||
int | n | ||
) |
Find centroids in a pixelmap using the center of mass method.
Find centroids in a pixelmap using the center of mass method.
p | pixel values (:,:) |
threshold | threshold for including in the center of mass |
n | size of the region of interest |
References edge_correction(), and index_to_sub().
ml_matrix coarse_centroid_COM | ( | const ml_matrix & | p, |
double | threshold, | ||
int | n | ||
) |
Find centroids in a pixelmap using blobify & center of mass method.
Find centroids in a pixelmap using blobify & center of mass method.
The pixelmap is first thresholded to remove pixels below the background noise. The remaining pixels are then grouped in "blobs". Centroids are computed for the blobs using a center of mass method.
TODO parameter for minimum number of pixels in blobs TODO parameter or better way for calculating noise floor b
p | pixel values (:,:) |
threshold | threshold for including in the center of mass |
n | size of the region of interest |
References apply_threshold(), and Blobify().
int edge_correction | ( | int | k0, |
int | kC, | ||
int | m | ||
) |
ml_matrix zodiacal_light | ( | const ml_matrix & | r, |
const ml_matrix & | beta | ||
) |
Zodiacal light.
Used by imager functions. This is background noise.
Reference: R. Meissner, "Brightness Measurements of Stars and the Night-Sky with a Silicon-Photomultiplier-Telescope" Physikalischen Institut A, 9/2012.
r | Distance from the sun (AU) |
beta | Ecliptic latitude (rad) |
References PI, and vm_to_intensity().
Referenced by imager_model::update().
double zodiacal_light | ( | double | r | ) |
Zodiacal light.
Zodiacal light.
Uses the worst-case beta.
Reference: R. Meissner, "Brightness Measurements of Stars and the Night-Sky with a Silicon-Photomultiplier-Telescope" Physikalischen Institut A, 9/2012.
r | Distance from the sun (AU) |
References PI, and vm_to_intensity().
void apply_threshold | ( | ml_matrix & | x, |
double | b, | ||
double | T | ||
) |
Star image noise processing function.
Star image noise processing function.
Values in x below the threshold, T, will be set to zero. The sky background noise, b, will be subtracted from the remaining pixels.
p(p<T) = 0 p = p - b;
If b is less than zero, the mean will be calculated. If T is less than or equal to zero, it will be approximated as b + 2.5*sigma.
x | Pixelmap |
b | Sky background noise value, to be subtracted from pixels |
T | Threshold value |
Referenced by coarse_centroid_COM().
ml_matrix fit_gaussian | ( | const ml_matrix & | pixels, |
const ml_matrix & | r0, | ||
gaussian_xyfit_t & | data | ||
) |
Fit symmetric Gaussians to a star image.
Fit symmetric Gaussians to a star image.
This should be a subarray containing a single star.
pixels | Pixelmap |
r0 | Initial guess |
data | Algorithm data results |
References gaussian_fit_s::height, gaussian_xyfit_s::height, gaussian_fit_s::iter, gaussian_xyfit_s::iter, gaussian_fit_s::status, gaussian_xyfit_s::status, gaussian_fit_s::std_dev, and gaussian_xyfit_s::std_dev.
std::list< star_blob > Blobify | ( | const ml_matrix & | pixels, |
int | minPix | ||
) |
Blobify a pixelmap.
Blobify a pixelmap.
A bounding box is stored along with the indices of the pixels in the blob. The pixelmap is assumed to be thresholded so that most of the pixels are zero and only those nonzero pixels will be grouped into blobs. Currently only single-pixel stars are removed. The blobs are sorted in descending order by total counts.
TODO: set a cap on number or percentage of nonzero pixels.
pixels |
Referenced by coarse_centroid_COM().