ocssw
V2022
|
main_l1info.cpp
Go to the documentation of this file.
63 /* equatorial radius, didn't bother to use polar value also since precision not that important for current use */
121 #define PRINT_USAGE(x) printf(USAGESTR,(x),VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH,GITSHA,__DATE__,__TIME__,(x))
205 box_t ****box = NULL; /* will become 3 dimensional box array in [DNF][direction][box_num][lonFlag] */
264 printf("INPUT ERROR: -n (number of lat divisions) option must be greater than or equal to 0\n");
496 /***********************************************************************************************
498 ***********************************************************************************************/
526 /***********************************************************************************************
528 ***********************************************************************************************/
559 // Most instruments scan to the left (so, use default scan_direction = -1); however, some exceptions scan to the right.
669 /***************************************************************************************************
670 * Determine MAX and MIN values for epix_lat and spix_lat based on current and all preceeding scan lines
671 ***************************************************************************************************/
743 /***************************************************************************************************
744 * Determine MAX and MIN values for both lat and lon based on current and all preceeding scan lines
745 ***************************************************************************************************/
757 if (l1rec->lat[ip] >= -90. && l1rec->lat[ip] <= 90. && l1rec->lon[ip] >= -180. && l1rec->lon[ip] <= 180.) {
782 box[curr_daynight_mode-1][curr_spacecraft_direction][box_index][lonFlag].daynightflag = curr_daynight_mode;
786 if (l1rec->lat[ip] < -90 || l1rec->lat[ip] > 90 || l1rec->lon[ip] < -180 || l1rec->lon[ip] > 180) {
787 fprintf(stderr, "-W- lat/lon pixel out of range: lat=%f, lon=%f, pixel_index=%d\n", l1rec->lat[ip], l1rec->lon[ip], ip);
820 /***************************************************************************************************
821 * Merge initial scans box with appropriate box now that we know the initial_spacecraft_direction
822 ***************************************************************************************************/
828 if (box[day_night][DEFAULT_SPACECRAFT_DIRECTION][box_index][lonFlag].north_lat != DEFAULT_COORD_VALUE) {
829 set_north_south_boundaries(box[day_night][DEFAULT_SPACECRAFT_DIRECTION][box_index][lonFlag].north_lat,
832 set_north_south_boundaries(box[day_night][DEFAULT_SPACECRAFT_DIRECTION][box_index][lonFlag].south_lat,
835 set_west_east_boundaries(box[day_night][DEFAULT_SPACECRAFT_DIRECTION][box_index][lonFlag].west_lon,
838 set_west_east_boundaries(box[day_night][DEFAULT_SPACECRAFT_DIRECTION][box_index][lonFlag].east_lon,
841 box[day_night][initial_spacecraft_direction][box_index][lonFlag].daynightflag = box[day_night][DEFAULT_SPACECRAFT_DIRECTION][box_index][lonFlag].daynightflag;
844 box[day_night][DEFAULT_SPACECRAFT_DIRECTION][box_index][lonFlag].north_lat = DEFAULT_COORD_VALUE;
845 box[day_night][DEFAULT_SPACECRAFT_DIRECTION][box_index][lonFlag].south_lat = DEFAULT_COORD_VALUE;
846 box[day_night][DEFAULT_SPACECRAFT_DIRECTION][box_index][lonFlag].west_lon = DEFAULT_COORD_VALUE;
847 box[day_night][DEFAULT_SPACECRAFT_DIRECTION][box_index][lonFlag].east_lon = DEFAULT_COORD_VALUE;
848 box[day_night][DEFAULT_SPACECRAFT_DIRECTION][box_index][lonFlag].daynightflag = DEFAULT_DAYNIGHT_MODE;
872 /***************************************************************************************************
874 ***************************************************************************************************/
909 /***************************************************************************************************
911 ***************************************************************************************************/
917 for (spacecraft_direction_index = 0; spacecraft_direction_index < NUM_SPACECRAFT_DIRECTION_MODES; spacecraft_direction_index++) {
920 if (box[day_night][spacecraft_direction_index][box_index][lonFlag].north_lat != DEFAULT_COORD_VALUE) {
950 for (spacecraft_direction_index = 0; spacecraft_direction_index < NUM_SPACECRAFT_DIRECTION_MODES; spacecraft_direction_index++) {
982 fprintf(fp, "percent_match=%f, num_match=%d, num_no_match=%d\n", percent_match, num_match, num_no_match);
986 /***************************************************************************************************
988 ***************************************************************************************************/
997 if (gring_helper->get_gring_strings(gring_lon_string, gring_lat_string, gring_seq_string) == SUCCESS) {
1007 fprintf(stderr, "-W- Not enough scans to form a gring; number of scans to include in gring = %d\n",gring_geobox_cnt);
1018 for (spacecraft_direction_index = 0; spacecraft_direction_index < NUM_SPACECRAFT_DIRECTION_MODES; spacecraft_direction_index++) {
1041 set_north_south_boundaries(float32 lat, float32 *northern_boundary, float32 *southern_boundary) {
1065 check_if_in_box(float32 lat, float32 lon, float32 northern_boundary, float32 southern_boundary,
1089 check_if_in_west_east_boundaries(float32 lon, float32 western_boundary, float32 eastern_boundary) {
1113 set_west_east_boundaries(float32 lon, float32 * western_boundary, float32 * eastern_boundary) {
1129 set_west_east_boundaries2(float32 lon, float32 * western_boundary, float32 * eastern_boundary) {
int32 l1file(int32 sdfid, int32 *nsamp, int32 *nscans, int16 *dtynum)
Definition: l1stat_chk.c:586
void * allocateMemory(size_t numBytes, const char *name)
Definition: allocateMemory.c:7
Definition: main_l1info.cpp:85
Definition: FP_failed_pkt_queue.h:66
Definition: main_l1info.cpp:77
u5 which has been done in the LOCALGRANULEID metadata should have an extension NRT It is requested to identify the NRT production Changes from v6 which may affect scientific the sector rotation may actually occur during one of the scans earlier than the one where it is first reported As a the b1 values are about the LOCALGRANULEID metadata should have an extension NRT It is requested to identify the NRT to fill pixels affected by dead subframes with a special value Output the metadata of noisy and dead subframe Dead Subframe EV and Detector Quality Flag2 Removed the function call of Fill_Dead_Detector_SI to stop interpolating SI values for dead but also for all downstream products for science test only Changes from v5 which will affect scientific to conform to MODIS requirements Removed the Mixed option from the ScanType in the code because the L1A Scan Type is never Mixed Changed for ANSI C compliance and comments to better document the fact that when the HDF_EOS metadata is stricly the and products are off by and in the track direction
Definition: HISTORY.txt:273
void set_north_south_boundaries(float32, float32 *, float32 *)
Definition: main_l1info.cpp:1041
void set_west_east_boundaries2(float32, float32 *, float32 *)
Definition: main_l1info.cpp:1129
void free2d_float(float **p)
Free a two-dimensional array created by allocate2d_float.
Definition: allocate2d.c:142
void cdata_()
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.
int check_if_in_box(float32, float32, float32, float32, float32, float32)
Definition: main_l1info.cpp:1065
const char * sensorId2InstrumentName(int sensorId)
Definition: sensorInfo.c:212
PARAM_TYPE_NONE Default value No parameter is buried in the product name name_prefix is case insensitive string compared to the product name PARAM_TYPE_VIS_WAVE The visible wavelength bands from the sensor are buried in the product name The product name is compared by appending and name_suffix ie aph_412_giop where prod_ix will be set to PARAM_TYPE_IR_WAVE same search method as PARAM_TYPE_VIS_WAVE except only wavelength above are looped through but prod_ix is still based ie aph_2_giop for the second and prod_ix set to PARAM_TYPE_INT name_prefix is compared with the beginning of the product name If name_suffix is not empty the it must match the end of the product name The characters right after the prefix are read as an integer and prod_ix is set to that number strncpy(l2prod->name_prefix, "myprod", UNITLEN)
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 set_west_east_boundaries(float32, float32 *, float32 *)
Definition: main_l1info.cpp:1113
int check_if_in_west_east_boundaries(float32, float32, float32)
Definition: main_l1info.cpp:1089
void process_scan(l1str *l1rec, size_t recnum, size_t escan)
Definition: gringHelper.cpp:70
How many dimensions is the output array Default is Not sure if anything above will work correctly strcpy(l2prod->title, "no title yet")
Definition: gringHelper.h:47
Definition: gringHelper.h:13