MISR Toolkit  1.5.1
MisrRegression.h
Go to the documentation of this file.
1 /*===========================================================================
2 = =
3 = MisrRegression =
4 = =
5 =============================================================================
6 
7  Jet Propulsion Laboratory
8  MISR
9  MISR Toolkit
10 
11  Copyright 2005, California Institute of Technology.
12  ALL RIGHTS RESERVED.
13  U.S. Government Sponsorship acknowledged.
14 
15 ============================================================================*/
16 
17 #ifndef MISRREGRESSION_H
18 #define MISRREGRESSION_H
19 
20 #include "MisrUtil.h"
21 #include "MisrError.h"
22 #include "MisrProjParam.h"
23 #include "MisrMapQuery.h"
24 
25 typedef struct {
31 
32 #define MTKT_REGRESSION_COEFF_INIT { \
33  MTKT_DATABUFFER_INIT, \
34  MTKT_DATABUFFER_INIT, \
35  MTKT_DATABUFFER_INIT, \
36 }
37 
39  int nline,
40  int nsample,
41  MTKt_RegressionCoeff *regressbuf
42 );
43 
45  MTKt_RegressionCoeff *regressbuf
46 );
47 
49  int Size,
50  const double *X,
51  const double *Y,
52  const double *YSigma,
53  double *A,
54  double *B,
55  double *Correlation
56 );
57 
59  const MTKt_DataBuffer *Data,
60  const MTKt_DataBuffer *Valid_mask,
61  int Width_line,
62  int Width_sample,
63  MTKt_DataBuffer *Data_smoothed
64 );
65 
67  const MTKt_DataBuffer *Data1,
68  const MTKt_DataBuffer *Valid_mask1,
69  const MTKt_DataBuffer *Data2,
70  const MTKt_DataBuffer *Data2_sigma,
71  const MTKt_DataBuffer *Valid_mask2,
72  const MTKt_MapInfo *Map_info,
73  int Regression_size_factor,
74  MTKt_RegressionCoeff *Regression_coeff,
75  MTKt_MapInfo *Regression_map_info
76 ) ;
77 
79  const MTKt_RegressionCoeff *Regression_coeff,
80  const MTKt_MapInfo *Regression_coeff_map_info,
81  const MTKt_MapInfo *Target_map_info,
82  MTKt_RegressionCoeff *Regression_coeff_out
83 ) ;
84 
86  const MTKt_DataBuffer *Source,
87  const MTKt_DataBuffer *Source_mask,
88  const MTKt_MapInfo *Source_map_info,
89  const MTKt_RegressionCoeff *Regression_coeff,
90  const MTKt_MapInfo *Regression_coeff_map_info,
91  MTKt_DataBuffer *Regressed,
92  MTKt_DataBuffer *Regressed_mask
93 );
94 
96  const MTKt_DataBuffer *Source,
97  const MTKt_DataBuffer *Source_mask,
98  int Size_factor,
99  MTKt_DataBuffer *Result,
100  MTKt_DataBuffer *Result_mask
101  );
102 
104  const MTKt_DataBuffer *Source_mask,
105  int Size_factor,
106  MTKt_DataBuffer *Result_mask
107  );
108 
109 #endif /* MISRREGRESSION_H */
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 val...
MTKt_DataBuffer valid_mask
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 ...
Definition: MtkSmoothData.c:36
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...
Map Information.
Definition: MisrMapQuery.h:65
2-dimensional Data Buffer
Definition: MisrUtil.h:98
MTKt_DataBuffer slope
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 ...
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...
MTKt_DataBuffer intercept
MTKt_status MtkRegressionCoeffFree(MTKt_RegressionCoeff *regressbuf)
Free memory for regression coefficients.
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.
Definition: MtkDownsample.c:36
MTKt_status MtkRegressionCoeffAllocate(int nline, int nsample, MTKt_RegressionCoeff *regressbuf)
Allocate buffer to contain regression coefficients.
MTKt_status
Definition: MisrError.h:11
MTKt_DataBuffer correlation
MTKt_status MtkUpsampleMask(const MTKt_DataBuffer *Source_mask, int Size_factor, MTKt_DataBuffer *Result_mask)
Upsample a mask by nearest neighbor sampling.

MISR Toolkit - Copyright © 2005 - 2020 Jet Propulsion Laboratory
Generated on Fri Jun 19 2020 22:49:51