ocssw
V2022
|
gringHelper.cpp
Go to the documentation of this file.
77 gring_test_val = includeScanInGring(l1rec->lat,l1rec->lon,l1rec->flags,l1rec->l1file->npix,recnum,escan,scanBounds);
83 //printf("Include last good scan %d where starting lat = %f, last direction = %d\n",(int)recnum,l1rec->lat[recnum],last_direction);
84 //printf(" scanBoundsOut: slat = %f, slon = %f, elat = %f, elon = %f\n", scanBounds->slat, scanBounds->slon, scanBounds->elat, scanBounds->elon);
85 // This scan should be included in the gring, so caller stuffs scanBoundsOut into a geobox array.
86 // Note that a geobox (borrowed from l2_generic.c) is just the endpoints (slon,slat,elon,elat) of a scan line.
116 bool gringHelper::includeScanInGring(float *lat, float *lon, int32_t *flags, size_t num_pixels, size_t recnum, size_t escan,
140 // Store this good pixel in good_epix. Eventually (at or near the end), it will be the last good one.
142 // Store this good pixel in cpix. Eventually (somewhere in the middle), it will be last good one at or before cpix.
149 // If this is a good scan, set the scan bounds (i.e. endpoints), and test to see if it should be included in the gring
159 // CONDITION 1: If this is the FIRST good scan, return scanBounds, after resetting "state information".
164 //printf("includeScanInGring: First good scan returned, recnum = %d, lat[good_spix] = %f\n", (int)recnum, lat[good_spix]);
167 // This is a good scan, but not the first good one. So, we can start tracking direction; i.e. no sense in
181 // CONDITION 2: If the latitude of this scan is more than delta_degrees_lat from the last_lat, return scanBounds,
182 // after resetting "state information". Also CONDITION 1 must have already been satisfied; i.e. last_lat
187 //printf("includeScanInGring: Scan returned due to delta lat, recnum = %d, lat[good_cpix] = %f\n", (int)recnum, lat[good_cpix]);
190 // CONDITION 3: If the satellite passes over a pole, detect the change from e.g. ascending to descending (or vice versa)
191 // and return scanBounds after resetting "state information". Also CONDITION 1 must have already been satisfied; i.e. last_lat
196 //printf("includeScanInGring: Scan returned due to change in direction, recnum = %d, lat[good_cpix] = %f\n", (int)recnum, lat[good_cpix]);
201 // If we get this far, this is not a scan to include in the gring. So, just return 0. However, if this is the last scan, we want to use
204 // If we got this far (without returning) AND this is the last scan, use the last GOOD scan (still stored in scanBounds).
361 int gringHelper::get_gring_strings(std::string& gring_lon_string, std::string& gring_lat_string, std::string& gring_seq_string) {
383 //printf("INFO: get_gring_strings: lat=%f lon=%f\n",gring_lat[gring_pt_num],gring_lon[gring_pt_num]);
416 void gringHelper::xlat_floatArray2String(std::string& myString, float *myArray, int array_length) {
438 void gringHelper::xlat_intArray2String(std::string& myString, size_t *myArray, int array_length) {
Definition: gringHelper.h:30
@ NAVFAIL
void free2d_float(float **p)
Free a two-dimensional array created by allocate2d_float.
Definition: allocate2d.c:142
int get_gring_strings(std::string &gring_lon_string, std::string &gring_lat_string, std::string &gring_seq_string)
Definition: gringHelper.cpp:361
Utility functions for allocating and freeing two-dimensional arrays of various types.
Definition: gringHelper.h:20
float ** allocate2d_float(size_t h, size_t w)
Allocate a two-dimensional array of type float of a given size.
Definition: allocate2d.c:125
void process_scan(l1str *l1rec, size_t recnum, size_t escan)
Definition: gringHelper.cpp:70
Definition: gringHelper.h:13