MISR Toolkit  1.5.1
MtkRegressionCoeffAllocate.c
Go to the documentation of this file.
1 /*===========================================================================
2 = =
3 = MtkRegressionCoeffAllocate =
4 = =
5 =============================================================================
6 
7  Jet Propulsion Laboratory
8  MISR
9  MISR Toolkit
10 
11  Copyright 2008, California Institute of Technology.
12  ALL RIGHTS RESERVED.
13  U.S. Government Sponsorship acknowledged.
14 
15 ============================================================================*/
16 
17 #include "MisrRegression.h"
18 #include "MisrUtil.h"
19 #include <stdlib.h>
20 
37  int nline,
38  int nsample,
39  MTKt_RegressionCoeff *regressbuf
40 )
41 {
42  MTKt_status status_code; /* Return status of this function */
43  MTKt_status status; /* Return status of called routines */
45  /* Regression buffer structure */
46 
47  if (regressbuf == NULL)
49 
50  if (nline < 1)
52 
53  if (nsample < 1)
55 
56  status = MtkDataBufferAllocate(nline, nsample, MTKe_uint8, &rbuf.valid_mask);
57  MTK_ERR_COND_JUMP(status);
58 
59  status = MtkDataBufferAllocate(nline, nsample, MTKe_float, &rbuf.slope);
60  MTK_ERR_COND_JUMP(status);
61 
62  status = MtkDataBufferAllocate(nline, nsample, MTKe_float, &rbuf.intercept);
63  MTK_ERR_COND_JUMP(status);
64 
65  status = MtkDataBufferAllocate(nline, nsample, MTKe_float, &rbuf.correlation);
66  MTK_ERR_COND_JUMP(status);
67 
68  *regressbuf = rbuf;
69 
70  return MTK_SUCCESS;
71 
72 ERROR_HANDLE:
74  return status_code;
75 }
MTKt_status MtkDataBufferAllocate(int nline, int nsample, MTKt_DataType datatype, MTKt_DataBuffer *databuf)
Allocate Data Buffer.
MTKt_status MtkRegressionCoeffAllocate(int nline, int nsample, MTKt_RegressionCoeff *regressbuf)
Allocate buffer to contain regression coefficients.
MTKt_DataBuffer valid_mask
#define MTK_ERR_CODE_JUMP(code)
Definition: MisrError.h:175
MTKt_DataBuffer slope
MTKt_DataBuffer intercept
MTKt_status MtkRegressionCoeffFree(MTKt_RegressionCoeff *regressbuf)
Free memory for regression coefficients.
#define MTKT_REGRESSION_COEFF_INIT
#define MTK_ERR_COND_JUMP(code)
Definition: MisrError.h:188
MTKt_status
Definition: MisrError.h:11
MTKt_DataBuffer correlation

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