MISR Toolkit
1.5.1
|
Go to the source code of this file.
Data Structures | |
struct | MTKt_RegressionCoeff |
Macros | |
#define | MTKT_REGRESSION_COEFF_INIT |
Functions | |
MTKt_status | MtkRegressionCoeffAllocate (int nline, int nsample, MTKt_RegressionCoeff *regressbuf) |
Allocate buffer to contain regression coefficients. More... | |
MTKt_status | MtkRegressionCoeffFree (MTKt_RegressionCoeff *regressbuf) |
Free memory for regression coefficients. More... | |
MTKt_status | MtkLinearRegressionCalc (int Size, const double *X, const double *Y, const double *YSigma, double *A, double *B, double *Correlation) |
Use linear regression to fit a set of observations (x,y) to the model: y(x) = a + b * x. The values of 'x' are assumed to be known exactly. The values of 'y' may have an associated uncertainty, 'y_sigma'. Measurements with larger uncertainty are given less weight. Uncertainty must be greater than 0. More... | |
MTKt_status | MtkSmoothData (const MTKt_DataBuffer *Data, const MTKt_DataBuffer *Valid_mask, int Width_line, int Width_sample, MTKt_DataBuffer *Data_smoothed) |
Smooth the given array with a boxcar average of the specified width. The algorithm is similar to the IDL smooth routine. Smoothed data is type float. More... | |
MTKt_status | MtkRegressionCoeffCalc (const MTKt_DataBuffer *Data1, const MTKt_DataBuffer *Valid_mask1, const MTKt_DataBuffer *Data2, const MTKt_DataBuffer *Data2_sigma, const MTKt_DataBuffer *Valid_mask2, const MTKt_MapInfo *Map_info, int Regression_size_factor, MTKt_RegressionCoeff *Regression_coeff, MTKt_MapInfo *Regression_map_info) |
Calculate linear regression coefficients for translating values in data buffer 1 to corresponding values in data buffer 2. More... | |
MTKt_status | MtkResampleRegressionCoeff (const MTKt_RegressionCoeff *Regression_coeff, const MTKt_MapInfo *Regression_coeff_map_info, const MTKt_MapInfo *Target_map_info, MTKt_RegressionCoeff *Regression_coeff_out) |
Resample regression coefficients at each pixel in the target map. Resampling is by cubic convolution. More... | |
MTKt_status | MtkApplyRegression (const MTKt_DataBuffer *Source, const MTKt_DataBuffer *Source_mask, const MTKt_MapInfo *Source_map_info, const MTKt_RegressionCoeff *Regression_coeff, const MTKt_MapInfo *Regression_coeff_map_info, MTKt_DataBuffer *Regressed, MTKt_DataBuffer *Regressed_mask) |
Apply regression to given data. Uses MtkResampleCubicConvolution to resample regression coefficients to resolution of the input data. Output data is the same size and resolution as the input data. More... | |
MTKt_status | MtkDownsample (const MTKt_DataBuffer *Source, const MTKt_DataBuffer *Source_mask, int Size_factor, MTKt_DataBuffer *Result, MTKt_DataBuffer *Result_mask) |
Downsample data by averaging pixels. More... | |
MTKt_status | MtkUpsampleMask (const MTKt_DataBuffer *Source_mask, int Size_factor, MTKt_DataBuffer *Result_mask) |
Upsample a mask by nearest neighbor sampling. More... | |
#define MTKT_REGRESSION_COEFF_INIT |
Definition at line 32 of file MisrRegression.h.
MTKt_status MtkApplyRegression | ( | const MTKt_DataBuffer * | Source, |
const MTKt_DataBuffer * | Source_mask, | ||
const MTKt_MapInfo * | Source_map_info, | ||
const MTKt_RegressionCoeff * | Regression_coeff, | ||
const MTKt_MapInfo * | Regression_coeff_map_info, | ||
MTKt_DataBuffer * | Regressed, | ||
MTKt_DataBuffer * | Regressed_mask | ||
) |
Apply regression to given data. Uses MtkResampleCubicConvolution to resample regression coefficients to resolution of the input data. Output data is the same size and resolution as the input data.
[in] | Source | Input data. (float) |
[in] | Source_mask | Valid mask for input data. (uint8) |
[in] | Source_map_info | Map info for input data |
[in] | Regression_coeff | Regression coefficients |
[in] | Regression_coeff_map_info | Map info for regression coefficients |
[out] | Regressed | Output data. (float) |
[out] | Regressed_mask | Valid mask for output data. (uint8) |
Definition at line 36 of file MtkApplyRegression.c.
MTKt_status MtkDownsample | ( | const MTKt_DataBuffer * | Source, |
const MTKt_DataBuffer * | Source_mask, | ||
int | Size_factor, | ||
MTKt_DataBuffer * | Result, | ||
MTKt_DataBuffer * | Result_mask | ||
) |
Downsample data by averaging pixels.
[in] | Source | Source data. (float) |
[in] | Source_mask | Valid mask for source data. (uint8) |
[in] | Size_factor | Number of pixels to aggregate along each dimension. |
[out] | Result | Downsampled result. (float) |
[out] | Result_mask | Valid mask for result. (uint8) |
Definition at line 36 of file MtkDownsample.c.
MTKt_status MtkLinearRegressionCalc | ( | int | Size, |
const double * | X, | ||
const double * | Y, | ||
const double * | Y_Sigma, | ||
double * | A, | ||
double * | B, | ||
double * | Correlation | ||
) |
Use linear regression to fit a set of observations (x,y) to the model: y(x) = a + b * x. The values of 'x' are assumed to be known exactly. The values of 'y' may have an associated uncertainty, 'y_sigma'. Measurements with larger uncertainty are given less weight. Uncertainty must be greater than 0.
[in] | Size | Size of X and Y arrays |
[in] | X | X array |
[in] | Y | Y array |
[in] | Y_Sigma | Uncertainty in Y |
[out] | A | A |
[out] | B | B |
[out] | Correlation | Correlation |
Definition at line 39 of file MtkLinearRegressionCalc.c.
MTKt_status MtkRegressionCoeffAllocate | ( | int | nline, |
int | nsample, | ||
MTKt_RegressionCoeff * | regressbuf | ||
) |
Allocate buffer to contain regression coefficients.
MTKe_int16
regressbuf
[in] | nline | Number of lines |
[in] | nsample | Number of samples |
[out] | regressbuf | Data Buffer |
Definition at line 36 of file MtkRegressionCoeffAllocate.c.
MTKt_status MtkRegressionCoeffCalc | ( | const MTKt_DataBuffer * | Data1, |
const MTKt_DataBuffer * | Valid_mask1, | ||
const MTKt_DataBuffer * | Data2, | ||
const MTKt_DataBuffer * | Data2_sigma, | ||
const MTKt_DataBuffer * | Valid_mask2, | ||
const MTKt_MapInfo * | Map_info, | ||
int | Regression_size_factor, | ||
MTKt_RegressionCoeff * | Regression_coeff, | ||
MTKt_MapInfo * | Regression_coeff_map_info | ||
) |
Calculate linear regression coefficients for translating values in data buffer 1 to corresponding values in data buffer 2.
[in] | Data1 | Data buffer 1 |
[in] | Valid_mask1 | Valid mask for data buffer 1 |
[in] | Data2 | Data buffer 2 |
[in] | Data2_sigma | Uncertainty for data buffer 2 |
[in] | Valid_mask2 | Valid mask for data buffer 2 |
[in] | Map_info | Map info for input data. |
[in] | Regression_size_factor | Number of pixels to aggregate along each axis when generating regression coefficients. |
[out] | Regression_coeff | Regression coefficients. |
[out] | Regression_coeff_map_info | Map info for regression coefficients |
Definition at line 36 of file MtkRegressionCoeffCalc.c.
MTKt_status MtkRegressionCoeffFree | ( | MTKt_RegressionCoeff * | regressbuf | ) |
Free memory for regression coefficients.
regressbuf
that was previously allocated with MtkRegressionCoeffAllocate() and we wish to free it.[in,out] | regressbuf | Data Buffer |
Definition at line 33 of file MtkRegressionCoeffFree.c.
MTKt_status MtkResampleRegressionCoeff | ( | const MTKt_RegressionCoeff * | Regression_coeff, |
const MTKt_MapInfo * | Regression_coeff_map_info, | ||
const MTKt_MapInfo * | Target_map_info, | ||
MTKt_RegressionCoeff * | Regression_coeff_out | ||
) |
Resample regression coefficients at each pixel in the target map. Resampling is by cubic convolution.
[in] | Regression_coeff | Regression coefficients. |
[in] | Regression_coeff_map_info | Map info for regression coefficients. |
[in] | Target_map_info | Map info for target grid. |
[out] | Regression_coeff_out | Regression coefficients resampled to target grid. |
Definition at line 38 of file MtkResampleRegressionCoeff.c.
MTKt_status MtkSmoothData | ( | const MTKt_DataBuffer * | Data, |
const MTKt_DataBuffer * | Valid_mask, | ||
int | Width_line, | ||
int | Width_sample, | ||
MTKt_DataBuffer * | Data_smoothed | ||
) |
Smooth the given array with a boxcar average of the specified width. The algorithm is similar to the IDL smooth routine. Smoothed data is type float.
[in] | Data | Data. (float) |
[in] | Valid_mask | Mask inidicating where data is valid. (uint8) |
[in] | Width_line | Width of smoothing window along line dimension. Must be and odd number. |
[in] | Width_sample | Width of smoothing window along sample dimension. Must be an odd number. |
[out] | Data_smoothed | Smoothed data. (float) |
Definition at line 36 of file MtkSmoothData.c.
MTKt_status MtkUpsampleMask | ( | const MTKt_DataBuffer * | Source_mask, |
int | Size_factor, | ||
MTKt_DataBuffer * | Result_mask | ||
) |
Upsample a mask by nearest neighbor sampling.
[in] | Source_mask | Source mask. (uint8) |
[in] | Size_factor | Number of pixels to expand along each dimension. |
[out] | Result_mask | Upsampled result. (uint8) |
Definition at line 36 of file MtkUpsampleMask.c.