NASA Logo
Ocean Color Science Software

ocssw V2022
productInfo.h
Go to the documentation of this file.
1 #ifndef PRODUCT_INFO_H
2 #define PRODUCT_INFO_H
3 
4 #include <stdint.h>
5 #include <float.h>
6 
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10 
11 /* default values for the product info structure */
12 
13 #define PRODUCT_DEFAULT_description "no description"
14 #define PRODUCT_DEFAULT_units ""
15 #define PRODUCT_DEFAULT_palette "default"
16 #define PRODUCT_DEFAULT_paramDesignator "none"
17 #define PRODUCT_DEFAULT_paramWaveMin -1
18 #define PRODUCT_DEFAULT_paramWaveMax -1
19 #define PRODUCT_DEFAULT_standardName NULL
20 #define PRODUCT_DEFAULT_category "Miscellaneous"
21 #define PRODUCT_DEFAULT_dataType "float"
22 #define PRODUCT_DEFAULT_prefix NULL
23 #define PRODUCT_DEFAULT_suffix NULL
24 #define PRODUCT_DEFAULT_algorithmName ""
25 #define PRODUCT_DEFAULT_productName ""
26 #define PRODUCT_DEFAULT_cat_ix -1
27 #define PRODUCT_DEFAULT_prod_ix -1
28 #define PRODUCT_DEFAULT_rank 2
29 #define PRODUCT_DEFAULT_fillValue -32767
30 #define PRODUCT_DEFAULT_fillValue_byte -1
31 #define PRODUCT_DEFAULT_fillValue_ubyte 0xFF
32 #define PRODUCT_DEFAULT_fillValue_ushort 0xFFFF
33 #define PRODUCT_DEFAULT_fillValue_uint 0xFFFFFFFF
34 #define PRODUCT_DEFAULT_validMin (-FLT_MAX)
35 #define PRODUCT_DEFAULT_validMax FLT_MAX
36 #define PRODUCT_DEFAULT_displayScale "linear"
37 #define PRODUCT_DEFAULT_displayMin 0
38 #define PRODUCT_DEFAULT_displayMax 0
39 #define PRODUCT_DEFAULT_scaleFactor 1
40 #define PRODUCT_DEFAULT_addOffset 0
41 #define PRODUCT_DEFAULT_reference NULL
42 #define PRODUCT_DEFAULT_comment NULL
43 #define PRODUCT_DEFAULT_titleFormat "no format string"
44 
48 typedef struct productInfo_str {
49  char *description;
50  char *units;
51  char *palette;
55  char *standardName;
56  char *category;
57  char *dataType;
58  char *prefix;
59  char *suffix;
60  char *algorithmName;
61  char *productName;
62  int cat_ix;
63  int prod_ix;
64  int rank;
65  double fillValue;
66  double validMin;
67  double validMax;
68  char *displayScale;
69  double displayMin;
70  double displayMax;
71  double scaleFactor;
72  double addOffset;
73  char *reference;
74  char *comment;
75  char *titleFormat;
76 } productInfo_t;
77 
78 
79 /*
80  * function prototypes
81  */
82 
83 void clearProductInfo(productInfo_t* info);
84 void initProductInfo(productInfo_t* info);
85 productInfo_t* allocateProductInfo();
86 void freeProductInfo(productInfo_t* info);
87 void copyProductInfo(productInfo_t* dest, const productInfo_t* src);
88 void getFirstProductInfo(productInfo_t* info);
89 int getNextProductInfo(productInfo_t* info);
90 int findProductInfo(const char* name, int sensorId, productInfo_t* info);
91 char* getProductNameFull(productInfo_t* info);
92 void printProductInfo(const char* productFullName, const productInfo_t* info);
93 const char* getGCMDKeywords(const char* suite);
94 
95 #ifdef __cplusplus
96 }
97 
98 #include <string>
99 
100 struct ProductAlias {
103  std::string suffix;
104 };
105 
106 bool findProductAlias(std::string productName, int sensorId, ProductAlias &productAlias);
107 
108 #endif
109 
110 
111 #endif
double displayMax
Definition: productInfo.h:70
char * algorithmName
Definition: productInfo.h:60
double addOffset
Definition: productInfo.h:72
void copyProductInfo(productInfo_t *dest, const productInfo_t *src)
char * standardName
Definition: productInfo.h:55
void initProductInfo(productInfo_t *info)
double fillValue
Definition: productInfo.h:65
char * productName
Definition: productInfo.h:61
char * paramDesignator
Definition: productInfo.h:52
@ string
void freeProductInfo(productInfo_t *info)
bool findProductAlias(string productName, int sensorId, ProductAlias &productAlias)
int findProductInfo(const char *name, int sensorId, productInfo_t *info)
double displayMin
Definition: productInfo.h:69
char * description
Definition: productInfo.h:49
void clearProductInfo(productInfo_t *info)
Definition: productInfo.cpp:57
char * reference
Definition: productInfo.h:73
char * titleFormat
Definition: productInfo.h:75
double scaleFactor
Definition: productInfo.h:71
char * displayScale
Definition: productInfo.h:68
int getNextProductInfo(productInfo_t *info)
productInfo_t * allocateProductInfo()
const char * getGCMDKeywords(const char *suite)
void printProductInfo(const char *productFullName, const productInfo_t *info)
void getFirstProductInfo(productInfo_t *info)
char * getProductNameFull(productInfo_t *info)