Go to the documentation of this file.
20 "\n This program takes a product (or products if netCDF output) from an L3 bin"
21 "\n or SMI file, reprojects the data using proj.4 and writes a mapped file in"
22 "\n the requested output format."
27 "\n 110 = No valid data to map"
29 "\n The argument list is a set of keyword=value pairs. Arguments can"
30 "\n be specified on the command line, or put into a parameter file, or the"
31 "\n two methods can be used together, with command line overriding."
33 "\nThe list of valid keywords follows:"
45 "\n netcdf4: netCDF4 file, can contain more than one product"
46 "\n hdf4: HDF4 file (old SMI format)"
47 "\n png: PNG image file"
48 "\n ppm: PPM image file"
49 "\n tiff: TIFF file with georeference tags");
52 "sub-string in ofile name that will be substituted by the product name");
54 "second output filename");
56 "second output file format"
57 "\n same options as oformat");
64 "comma separated list of products."
65 "\n Each product can have an optional colon and modifier appended."
66 "\n For example, \"product=chlor_a,chlor_a:stdev,Kd_490:nobs\""
67 "\n Available modifiers:"
68 "\n avg average value (default)"
69 "\n stdev standard deviation"
71 "\n nobs number of observations in the bin"
72 "\n nscenes number of contributing scenes"
73 "\n obs_time average observation time (TAI93)"
74 "\n bin_num bin ID number"
78 "size of output pixel (default from input file)"
79 "\n in meters or SMI dimensions"
80 "\n 90km: 432 x 216 image for full globe"
82 "\n 18km: 2160 x 1080"
85 "\n 2km: 17280 x 8640"
86 "\n 1km: 34560 x 17280"
87 "\n hkm: 69120 x 34560"
88 "\n qkm: 138240 x 69120"
90 "\n smi4: 8192 x 4096"
91 "\n land: 8640 x 4320"
92 "\n #.#: width of a pixel in meters"
93 "\n #.#km: width of a pixel in kilometers"
94 "\n #.#deg: width of a pixel in degrees");
96 "width of output image in pixels; supercedes resolution parameter.\n");
99 "proj.4 projection string or one"
100 "\n of the following predefined projections:"
101 "\n smi: Standard Mapped image, cylindrical projection,"
102 "\n uses central_meridian. NSEW defaults to whole globe."
103 "\n projection=\"+proj=eqc +lon_0=<central_meridian>\""
104 "\n platecarree: Plate Carree image, cylindrical projection,"
105 "\n uses central_meridian."
106 "\n projection=\"+proj=eqc +lon_0=<central_meridian>\""
107 "\n mollweide: Mollweide projection"
108 "\n projection=\"+proj=moll +lon_0=<central_meridian>\""
109 "\n lambert: Lambert conformal conic (2SP) projection"
110 "\n projection=\"+proj=lcc +lon_0=<central_meridian>"
111 "\n +lat_0=<scene center latitude>"
112 "\n +lat_1=<scene south latitude>"
113 "\n +lat_2=<scene north latitude>\""
114 "\n albersconic: Albers Equal Area Conic projection"
115 "\n projection=\"+proj=aea +lon_0=<central_meridian>"
116 "\n +lat_0=<scene center latitude>"
117 "\n +lat_1=<scene south latitude>"
118 "\n +lat_2=<scene north latitude>\""
119 "\n mercator: Mercator cylindrical map projection"
120 "\n projection=\"+proj=merc +lon_0=<central_meridian>\""
121 "\n transmerc: Transverse Mercator cylindrical map projection"
122 "\n projection=\"+proj=tmerc +lon_0=<central_meridian>"
123 "\n +lat_0=<scene center latitude>\""
124 "\n utm: Universal Transverse Mercator cylindrical map projection"
125 "\n projection=\"+proj=utm +zone=<utm_zone> [+south]\""
126 "\n obliquemerc: Oblique Mercator cylindrical map projection"
127 "\n projection=\"+proj=omerc +gamma=0 +lat_0=<lat_0>"
128 "\n +lonc=<central_meridian> +alpha=<azimuth>"
129 "\n +k_0=1 +x_0=0 +y_0=0\""
130 "\n ease2: EASE-Grid 2.0 projection"
131 "\n projection=\"EPSG:6933\""
132 "\n stere: Stereographic projection"
133 "\n projection=\"+proj=stere +lat_0=<lat_0> +lat_ts=<lat_ts>"
134 "\n +lon_0=<central_meridian>"
135 "\n +ellps=WGS84 +datum=WGS84 +units=m\""
136 "\n conus: USA Contiguous Albers Equal Area Conic USGS version"
137 "\n projection=\"+proj=aea +lat_1=29.5 +lat_2=45.5"
138 "\n +lat_0=23.0 +lon_0=-96 +x_0=0 +y_0=0"
139 "\n +ellps=GRS80 +datum=NAD83 +units=m\""
140 "\n alaska: Alaskan Albers Equal Area Conic USGS version"
141 "\n projection=\"EPSG:3338\""
142 "\n gibs: latitudinally dependent projection"
143 "\n Plate Carree between 60S and 60N"
144 "\n else use Polar Sterographic"
145 "\n North Polar: projection=\"EPSG:3413\""
146 "\n South Polar: projection=\"EPSG:3031\""
147 "\n raw: Raw dump of bin file contents."
151 "central meridian for projection in deg east."
152 "\n Used only for raw dump and predefined projections as above.");
154 "latitude of true scale for projection in deg north."
155 "\n Used only for predefined projections above as required.");
157 "latitude of origin for projection in deg north."
158 "\n Used only for predefined projections above as required.");
160 "latitude of first standard parallel (south)."
161 "\n Used only for predefined projections above as required.");
163 "latitude of second standard parallel (north)."
164 "\n Used only for predefined projections above as required.");
166 "projection rotation angle in deg north."
167 "\n Used only for predefined projections above as required.");
170 "\n Used only for the UTM projection;"
171 "\n Append 'S' for southern hemisphere zones (e.g. 59S).");
173 "Northernmost Latitude (default: file north)");
175 "Southernmost Latitude (default: file south)");
177 "Easternmost Longitude (default: file east)");
179 "Westernmost Longitude (default: file west)");
181 "should we trim output"
182 "\n to match input NSEW range"
186 "interpolation method:"
187 "\n nearest: use the value of the nearest bin for the pixel"
188 "\n bin: bin all of the pixels that intersect the area of the"
190 "\n area: bin weighted by area of all the pixels that intersect"
191 "\n the area of the output pixel"
196 "apply color palette:"
197 "\n yes: color image"
198 "\n no: grayscale image");
200 "palette filename (default from product.xml)");
202 "make missing data transparent (only valid for color PNG and TIFF)");
204 "minimum value for scaling (default from product.xml)");
206 "maximum value for scaling (default from product.xml)");
208 "data scaling type (default from product.xml)"
209 "\n linear: linear scaling"
210 "\n log: logarithmic scaling"
211 "\n arctan: arc tangent scaling"
216 "stop the status printing");
218 "processing version string");
220 "should we do quality factor processing");
222 "product to use for quality factor processing");
224 "should we use product_rgb to make a"
225 "\n pseudo-true color image");
227 "rhos_670,rhos_555,rhos_412",
228 "\n Three products to use for RGB. Default is sensor-specific.");
230 "fudge factor used to modify size of L3 pixels");
232 "minimum percentage of filled pixels before"
233 "\n an image is generated");
235 "number of rows to cache in memory.");
237 "set land pixels to pixel value 254");
239 "RGB value to use for land mask; comma separate string");
241 "$OCDATAROOT/common/landmask_GMT15ARC.nc",
"land mask file");
243 "write full latitude and longitude arrays."
254 if (dsId.
fid == -1) {
255 printf(
"-E- %s: Input file '%s' does not exist or cannot open. \n",
261 char* instrumentStr =
readAttrStr(dsId,
"instrument");
275 char* sensorNameStr =
readAttrStr(dsId,
"Sensor Name");
281 if (sensorId == -1) {
282 printf(
"Did not find a valid sensor ID - using OCRVC as the sensor ID.\n");
302 char tmpStr[FILENAME_MAX];
306 if ((dataRoot = getenv(
"OCDATAROOT")) ==
NULL) {
307 fprintf(
stderr,
"-E- OCDATAROOT environment variable is not defined. \n");
315 sprintf(tmpStr,
"%s/common/l3mapgen_defaults.par", dataRoot);
327 sprintf(tmpStr,
"%s/%s/l3mapgen_defaults.par", dataRoot, sensorDir);
328 int defaultLoaded = 0;
329 if (access(tmpStr, R_OK) != -1) {
331 printf(
"Loading default parameters from %s\n", tmpStr);
336 if (subsensorId != -1) {
337 sprintf(tmpStr,
"%s/%s/%s/l3mapgen_defaults.par", dataRoot, sensorDir,
339 if (access(tmpStr, R_OK) != -1) {
341 printf(
"Loading default parameters from %s\n", tmpStr);
347 if (!defaultLoaded) {
348 printf(
"-E- Failed to load sensor program defaults for %s \n",
357 sprintf(tmpStr,
"%s/common/l3mapgen_defaults_%s.par", dataRoot,
359 if (access(tmpStr, R_OK) != -1) {
361 printf(
"Loading default parameters from %s\n", tmpStr);
366 sprintf(tmpStr,
"%s/%s/l3mapgen_defaults_%s.par", dataRoot, sensorDir,
368 if (access(tmpStr, R_OK) != -1) {
370 printf(
"Loading default parameters from %s\n", tmpStr);
375 if (subsensorId != -1) {
376 sprintf(tmpStr,
"%s/%s/%s/l3mapgen_defaults_%s.par", dataRoot,
379 if (access(tmpStr, R_OK) != -1) {
381 printf(
"Loading default parameters from %s\n", tmpStr);
388 printf(
"-E- Failed to load parameters for suite %s for sensor %s\n",
clo_getOptionString(option),
clo_option_t * clo_addOption(clo_optionList_t *list, const char *key, enum clo_dataType_t dataType, const char *defaultVal, const char *desc)
const char * sensorId2SensorDir(int sensorId)
char * clo_getString(clo_optionList_t *list, const char *key)
void clo_readArgs(clo_optionList_t *list, int argc, char *argv[])
list(APPEND LIBS ${PGSTK_LIBRARIES}) add_executable(atteph_info_modis atteph_info_modis.c) target_link_libraries(atteph_info_modis $
int instrumentPlatform2SensorId(const char *instrument, const char *platform)
idDS openDS(const char *filename)
int sensorName2SensorId(const char *name)
clo_option_t * clo_findOption(clo_optionList_t *list, const char *key)
int sensorId2SubsensorId(int sensorId)
int clo_isOptionSet(clo_option_t *option)
void clo_setVersion2(const char *programName, const char *versionStr)
void clo_setEnableDumpOptions(int val)
char * readAttrStr(idDS ds_id, const char *name)
void clo_setHelpStr(const char *str)
char * clo_getOptionString(clo_option_t *option)
void clo_readFile(clo_optionList_t *list, const char *fileName)
const char * sensorId2SensorName(int sensorId)
const char * subsensorId2SubsensorDir(int subsensorId)