OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
GEO_output.h File Reference
#include "GEO_parameters.h"
#include "GEO_main_func.h"
#include "smfio.h"
#include "hdfi.h"
#include "PGS_PC.h"
#include "mapi.h"
Include dependency graph for GEO_output.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  swath_elem_struct
 
struct  utcpole_metadata_struct
 

Macros

#define GEO_DOUBLE_FILLVALUE   9.9692099683868690e+36
 
#define FILL_INT8   ((int8)-127)
 

Functions

PGSt_SMF_status GEO_initialize_product (int const, fill_values_struct const *, MODFILE *const, int32 const, GEO_param_struct const *)
 
PGSt_SMF_status GEO_derived_products (int const, int const, double[][MAX_FRAMES][3], double[][3], unsigned char[][MAX_FRAMES], double[][MAX_FRAMES][3], char[28], PGSt_double[], double[][MAX_FRAMES][2], double[][MAX_FRAMES][3])
 
PGSt_SMF_status GEO_get_utcpole_metadata (const ECS_metadata_struct *ECS_metadata, utcpole_metadata_struct *utcpole_metadata)
 
PGSt_SMF_status GEO_get_version_metadata (version_metadata_struct *version_metadata)
 
PGSt_SMF_status GEO_landsea_mask (int, int, double[][MAX_PADDED][3], uint8[][MAX_PADDED], uint8 *, uint8[][MAX_PADDED])
 
PGSt_SMF_status GEO_locate_one_scan (GEO_param_struct const *const geo_params, l1a_data_struct *const l1a_data, int const scan_number, qa_metadata_struct *const qa_metadata, GEO_bcoord_struct *const bounding_coords, MODFILE *const geo_file)
 
PGSt_SMF_status GEO_update_L1A_metadata (MODFILE *const l1a_file, GEO_GRing_struct *const GRing_points, EPH_metadata_struct *const EPH_metadata, GEO_bcoord_struct *const bounding_coords)
 
PGSt_SMF_status GEO_write_ECS_metadata (MODFILE *const geo_file, ECS_metadata_struct *const ECS_metadata, EPH_metadata_struct *const EPH_metadata, GEO_bcoord_struct *const bounding_coords, GEO_GRing_struct *const GRing_points, pointer_metadata_struct *const pointer_metadata, qa_metadata_struct *const qa_metadata, char *const sci_state, char *const sci_abnorm)
 
PGSt_SMF_status GEO_write_one_scan (PGSt_double const [], int const, l1a_data_struct const *const, GEO_param_struct const *const, double[][MAX_FRAMES][3], double[][MAX_FRAMES][2], double[][MAX_FRAMES][3], uint8[][MAX_FRAMES], int8[][DETECTORS_QKM][SAMPLES_QKM], PGSt_double const [], uint32[][MAX_FRAMES], uint8[][MAX_FRAMES], uint8[][MAX_FRAMES], uint8, MODFILE *const)
 
PGSt_SMF_status GEO_write_scan_data (MODFILE *const, int const, swath_elem_struct const *, GEO_param_struct const *, double[][MAX_FRAMES][3], double[][MAX_FRAMES][3], double[][MAX_FRAMES][2], uint8[][MAX_FRAMES], uint8[][MAX_FRAMES], uint8[][MAX_FRAMES], int8[3][DETECTORS_QKM][SAMPLES_QKM])
 
PGSt_SMF_status GEO_write_scan_metadata (int const scan_number, l1a_data_struct const *const l1a_data, celestial_bodies_struct const *const cb_vectors, MODFILE *const geo_file, PGSt_double const rpy[], uint32 frame_quality[][MAX_FRAMES])
 
PGSt_SMF_status GEO_write_granule_metadata (MODFILE *const geo_file, MODFILE *const l1a_file, GEO_param_struct const *const geo_parameter, GEO_bcoord_struct const *const bounding_coords, int const version, l1a_data_struct *const l1a_data, qa_metadata_struct *const qa_metadata)
 
int GEO_write_parameters (MODFILE *const, GEO_param_struct const *)
 
PGSt_SMF_status GEO_write_geospecific_metadata (MODFILE *const geo_file, l1a_metadata_struct const *const granule_metadata, int const number_of_scans, GEO_param_struct const *const geo_parameter, qa_metadata_struct const *const qa_metadata, utcpole_metadata_struct const *const utcpole_metadata)
 
int GEO_write_input_metadata (MODFILE *const geo_file, int const l1a_version, PGSt_integer const param_version, pointer_metadata_struct *const pointer_metadata, PGSt_tag sc_tag)
 
int GEO_get_bounding_coords (double terrain_frame_position[DETECTORS_1KM][MAX_FRAMES][3], uint8 frame_flags[DETECTORS_1KM][MAX_FRAMES], int const num_detectors, int const num_frames, GEO_bcoord_struct *const bounding_coords)
 
PGSt_SMF_status GEO_create_swath (int const number_of_scans, int const num_detectors, int32 const swfid)
 

Macro Definition Documentation

◆ FILL_INT8

#define FILL_INT8   ((int8)-127)

Definition at line 108 of file GEO_output.h.

◆ GEO_DOUBLE_FILLVALUE

#define GEO_DOUBLE_FILLVALUE   9.9692099683868690e+36

Definition at line 106 of file GEO_output.h.

Function Documentation

◆ GEO_create_swath()

PGSt_SMF_status GEO_create_swath ( int const  number_of_scans,
int const  num_detectors,
int32 const  swfid 
)

Definition at line 8 of file GEO_create_swath.c.

◆ GEO_derived_products()

PGSt_SMF_status GEO_derived_products ( int const  ,
int const  ,
double  [][MAX_FRAMES][3],
double  [][3],
unsigned char  [][MAX_FRAMES],
double  [][MAX_FRAMES][3],
char  [28],
PGSt_double  [],
double  [][MAX_FRAMES][2],
double  [][MAX_FRAMES][3] 
)

◆ GEO_get_bounding_coords()

int GEO_get_bounding_coords ( double  terrain_frame_position[DETECTORS_1KM][MAX_FRAMES][3],
uint8  frame_flags[DETECTORS_1KM][MAX_FRAMES],
int const  num_detectors,
int const  num_frames,
GEO_bcoord_struct *const  bounding_coords 
)

◆ GEO_get_utcpole_metadata()

PGSt_SMF_status GEO_get_utcpole_metadata ( const ECS_metadata_struct ECS_metadata,
utcpole_metadata_struct utcpole_metadata 
)

Definition at line 10 of file GEO_get_utcpole_metadata.c.

◆ GEO_get_version_metadata()

PGSt_SMF_status GEO_get_version_metadata ( version_metadata_struct version_metadata)

Definition at line 6 of file GEO_get_version_metadata.c.

◆ GEO_initialize_product()

PGSt_SMF_status GEO_initialize_product ( int const  ,
fill_values_struct const ,
MODFILE * const  ,
int32 const  ,
GEO_param_struct const  
)

Definition at line 7 of file GEO_initialize_product.c.

◆ GEO_landsea_mask()

PGSt_SMF_status GEO_landsea_mask ( int  ,
int  ,
double  [][MAX_PADDED][3],
uint8  [][MAX_PADDED],
uint8 *  ,
uint8  [][MAX_PADDED] 
)

Definition at line 6 of file GEO_landsea_mask.c.

◆ GEO_locate_one_scan()

PGSt_SMF_status GEO_locate_one_scan ( GEO_param_struct const *const  geo_params,
l1a_data_struct *const  l1a_data,
int const  scan_number,
qa_metadata_struct *const  qa_metadata,
GEO_bcoord_struct *const  bounding_coords,
MODFILE *const  geo_file 
)

Definition at line 13 of file GEO_locate_one_scan.c.

◆ GEO_update_L1A_metadata()

PGSt_SMF_status GEO_update_L1A_metadata ( MODFILE *const  l1a_file,
GEO_GRing_struct *const  GRing_points,
EPH_metadata_struct *const  EPH_metadata,
GEO_bcoord_struct *const  bounding_coords 
)

Definition at line 8 of file GEO_update_L1A_metadata.c.

◆ GEO_write_ECS_metadata()

PGSt_SMF_status GEO_write_ECS_metadata ( MODFILE *const  geo_file,
ECS_metadata_struct *const  ECS_metadata,
EPH_metadata_struct *const  EPH_metadata,
GEO_bcoord_struct *const  bounding_coords,
GEO_GRing_struct *const  GRing_points,
pointer_metadata_struct *const  pointer_metadata,
qa_metadata_struct *const  qa_metadata,
char *const  sci_state,
char *const  sci_abnorm 
)

Definition at line 10 of file GEO_write_ECS_metadata.c.

◆ GEO_write_geospecific_metadata()

PGSt_SMF_status GEO_write_geospecific_metadata ( MODFILE *const  geo_file,
l1a_metadata_struct const *const  granule_metadata,
int const  number_of_scans,
GEO_param_struct const *const  geo_parameter,
qa_metadata_struct const *const  qa_metadata,
utcpole_metadata_struct const *const  utcpole_metadata 
)

C**************************************************************************** !Description:
Routine in Output group of the Level-1A geolocation software to write geolocation specific granule metadata to the output product. These metadata are stored as individual global HDF attributes using MAPI calls.

Warning messages will be recorded (to the SMF) if metadata inputs are missing, but the routine will not abort, which may result in geolocation products with incomplete granule metadata.

!Input Parameters: geo_file the MAPI structure for the product granule_metadata l1a specific granule metadata number_of_scans the number of scans in the granule geo_parameter program parameters read from (or derived directly from) the geolocation parameter file qa_metadata Quality metadata utcpole_metadata metadata identifying the utcpole.dat file

!Output Parameters: None

Return Values: MODIS_E_GEO If putMODISfileinfo() fails. MODIS_E_BAD_INPUT_ARG If geo_file is null. MODIS_E_MISSING_OUTPUT If an optional data source was unavailable. PGS_S_SUCCESS Otherwise

Externally Defined: BAD_PCKTS "GEO_product.h" CUM_GFLAGS "GEO_product.h" DATATYPELENMAX "mapi.h" DISCRD_PKTS "GEO_product.h" EA_SOURCE "GEO_product.h" EA_SOURCE_SELECT_LUN "GEO_geo.h" FROFF_FRAME_2 "GEO_product.h" FROFF_FRAME_4 "GEO_product.h" FROFF_SCAN_20 "GEO_product.h" FROFF_SCAN_40 "GEO_product.h" GEO_EST_RMS_ERROR "GEO_product.h" PARVERS "GEO_product.h" INCOMP_SCANS "GEO_product.h" I32 "mapi.h" MAPIOK "mapi.h" MAX_EFRM "GEO_product.h" MAX_SFRM "GEO_product.h" MAX_SV_FRM "GEO_product.h" MISS_PCKTS "GEO_product.h" MODIS_E_BAD_INPUT_ARG "PGS_MODIS_35251.h" MODIS_E_GEO "PGS_MODIS_35251.h" MODIS_E_MISSING_OUTPUT "PGS_MODIS_35251.h" NUMSCN "GEO_product.h" PGSd_PC_VALUE_LENGTH_MAX "PGS_PC.h" POLAR_MOTION "GEO_product.h" R32 "mapi.h" TERRAIN_CORRECT_LUN "GEO_geo.h" TERRAIN_CORRECTION "GEO_product.h" TXT "mapi.h" UI32 "mapi.h" UTCPOLE_FH "GEO_product.h"

Called by: GEO_write_granule_metadata

Routines Called: putMODISfileinfo "mapi.h" modsmf "smfio.h" PGS_PC_GetConfigData "PGS_PC.h"

!Revision History:

Log
GEO_write_geospecific_metadata.c,v

Revision 6.4 2011/02/14 21:59:46 kuyper Removed cast that is no longer needed with current version of M-API toolkit.

Revision 6.3 2010/05/28 21:34:38 kuyper Resolved Bug 2249 by writing value of terrain correction flag as a file attribute. Helped resolve Bug 2470 by dropping a parameter. Changed to return status code. Improved const-safety.

Revision 6.3 2010/05/28 21:20:17 kuyper Resolved Bug 2249 by writing value of terrain correction flag as a file attribute. Helped resolve Bug 2470 by dropping a parameter. Improved const-safety.

Revision 6.2 2009/05/30 22:53:03 kuyper Corrected metadata name, case number, and message contents.

Revision 6.1 2009/05/28 22:59:01 kuyper Added FractionalOffset file attributes. Corrected prolog. Improved error messages.

James Kuyper Jr. James.nosp@m..R.K.nosp@m.uyper.nosp@m.@nas.nosp@m.a.gov

Revision 5.1 2004/09/13 18:06:50 vlin

  1. input parameter maneuver_list added.
  2. maneuver_list->revision written as a file attribute to output file.

Revision 4.2 2003/10/27 18:49:23 vlin Size of message buffer was changed.

Revision 4.1 2003/02/21 22:54:51 kuyper Corrected to use void* pointers with p format code.

Requirements: PR03-F-4.1-1 PR03-F-4.1-1.6 PR03-F-4.1-2 PR03-I-1 PR03-I-2 PR03-S-1

!Team-unique Header:

This software is developed by the MODIS Science Data Support
Team for the National Aeronautics and Space Administration,
Goddard Space Flight Center, under contract NAS5-32373.

References and Credits None

Design Notes

!END****************************************************************************

Definition at line 6 of file GEO_write_geospecific_metadata.c.

◆ GEO_write_granule_metadata()

PGSt_SMF_status GEO_write_granule_metadata ( MODFILE *const  geo_file,
MODFILE *const  l1a_file,
GEO_param_struct const *const  geo_parameter,
GEO_bcoord_struct const *const  bounding_coords,
int const  version,
l1a_data_struct *const  l1a_data,
qa_metadata_struct *const  qa_metadata 
)

Definition at line 8 of file GEO_write_granule_metadata.c.

◆ GEO_write_input_metadata()

int GEO_write_input_metadata ( MODFILE *const  geo_file,
int const  l1a_version,
PGSt_integer const  param_version,
pointer_metadata_struct *const  pointer_metadata,
PGSt_tag  sc_tag 
)

Definition at line 8 of file GEO_write_input_metadata.c.

◆ GEO_write_one_scan()

PGSt_SMF_status GEO_write_one_scan ( PGSt_double const  [],
int const  ,
l1a_data_struct const * const  ,
GEO_param_struct const * const  ,
double  [][MAX_FRAMES][3],
double  [][MAX_FRAMES][2],
double  [][MAX_FRAMES][3],
uint8  [][MAX_FRAMES],
int8  [][DETECTORS_QKM][SAMPLES_QKM],
PGSt_double const  [],
uint32  [][MAX_FRAMES],
uint8  [][MAX_FRAMES],
uint8  [][MAX_FRAMES],
uint8  ,
MODFILE * const   
)

Definition at line 8 of file GEO_write_one_scan.c.

◆ GEO_write_parameters()

int GEO_write_parameters ( MODFILE *const  geo_file,
GEO_param_struct const parameter 
)

C**************************************************************************** !Description:
Routine in Output group of the Level-1A geolocation software to write geolocation processing parameters to the output product. These parameters, which are read from the geolocation parameter file, are output using MAPI calls.

!Input Parameters: geo_file the MAPI structure for the product parameter geolocation processing parameters structure

!Output Parameters: None

Return values: SUCCESS if all geolocation processing parameters written to geo_file FAIL otherwise.

Externally Defined: BAND_NUMBER "GEO_product.h" BAND_POSITION "GEO_product.h" DATATYPELENMAX "mapi.h" DETECTOR_SPACE "GEO_product.h" DETECTOR_OFFSETS "GEO_product.h" FAIL "GEO_basic.h" FOCAL_LENGTH "GEO_product.h" I16 "mapi.h" MAPIOK "mapi.h" MAX_BAND_NUMBER "GEO_geo.h" MODIS_E_BAD_INPUT_ARG "PGS_MODIS_35251.h" MODIS_E_GEO "PGS_MODIS_35251.h" MUNITS "mapi.h" NUMBANDS "GEO_product.h" NUM_SAMPLES "GEO_product.h" PARM_GRP "GEO_product.h" R64 "mapi.h" SCANDIM "GEO_product.h" SUCCESS "GEO_basic.h" T_OFFSET "GEO_product.h" TRACKDIM "GEO_product.h" TXT "mapi.h" UI16 "mapi.h" UI32 "mapi.h"

Called by: GEO_write_granule_metadata()

Routines Called: createMODISarray "mapi.h" modsmf "smfio.h" putMODISarinfo "mapi.h" putMODISarray "mapi.h" putMODISdimname "mapi.h" putMODISfileinfo "mapi.h"

!Revision History:

Log
GEO_write_parameters.c,v

Revision 6.2 2011/02/14 21:11:40 kuyper Corrected const-qualification of *parameter.

Revision 6.1 2009/05/28 23:09:04 kuyper Added BAND_NUMBER file attribute. Corrected prolog. Made error messages more informative.

James Kuyper Jr. James.nosp@m..R.K.nosp@m.uyper.nosp@m.@nas.nosp@m.a.gov

Revision 4.1 2003/02/21 23:08:11 kuyper Corrected to use void* pointers with p format code.

Revision 3.1 2002/06/13 22:57:47 kuyper Removed unnecessary NCSA acknowledgement.

Revision 2.5 1998/11/16 19:37:46 kuyper Removed scaling of band_position to meters.

Revision 2.4 1998/02/08 22:30:28 jjb Merged from V2.0 DAAC Delivery.

1997/12/30 Liqun Ma Added NCSA acknowledgement

Revision 2.3 1997/11/03 20:20:08 jjb Corrected 'units' strings for band_position and T_offset parameters.

Revision 2.2 1997/10/27 16:08:25 ding@.nosp@m.ltpm.nosp@m.ail.g.nosp@m.sfc..nosp@m.nasa..nosp@m.gov Added setting of parameter SDS dimension names.

Revision 2.1 1997/10/21 18:16:22 kuyper Returned from ClearCase

Revision /main/GEO_V2_DEV/1 1997/10/03 kuyper Removed mirror model parameters, poly_coeff, and coordinate transformation matrices. Added num_samples parameter. Expanded INVALID_INPUT_ARG message. Added scandim and trackdim attributes for detector_offsets SDS.

Revision 1.10 1997/07/21 16:24:34 kuyper Baselined Version 1

Revision 1.11 1997/04/10 19:36:40 fhliang Initial revision of SDST re-delivery of GEO_write_parameters.c.

Revision 1.10 1997/04/09 14:23:25 kuyper Added T_tel2inst, per filespec.

Revision 1.9 1997/03/26 18:18:48 fhliang Initial revision of SDST delivery of GEO_write_parameters.c

 Revision 1.8  1997/02/13 20:03:42  kuyper
 Changed POLY_M1,POLY_M2 to fixed length of 3,
   to match filespec.

 Revision 1.7  1996/12/26 23:07:24  kuyper
 Used new local array, save_band[], instead of global band_position,
 to save temporary band_positions.

 Revision 1.6  1996/12/06 22:29:01  kuyper
 Changed to exit on first failure in loop.

 Revision 1.5  1996/12/06 22:09:43  kuyper
 Corrected T_mirr2inst line.

 Revision 1.4  1996/12/06 21:19:57  kuyper
 Get parameters from structure passed by reference, rather than globals.
 Attach 'units' attribute to some of the arrays.
 Changed list of parameters.
 Collapse repeated code to a single loop, using an array of structures to
 control the loop.
 Validate input arguments.

 Revision 1.3  1996/07/24 21:59:19  kuyper
 Standardized order of #include files.
 Declared arguments const.
 Inserted required '!'s in comments.
 Removed ret_val.
 Converted constants to double, to skip implied conversion.
 Made implicit casts explicit.

 Revision 1.2  1996/07/18 21:33:50  kuyper
 Included self-checking header file.
 Replaced extern declarations with corresponding header files.
 Added needed header file.
 James Kuyper Jr. (kuyper@ltpmail.gsfc.nasa.gov)

 10/10/95
 Tracey W. Holmes
 Added debug option.

 9/27/95
 Frederick S. Patt
 Corrected declaration of N_samp; corrected indexing of
   band offset arrays

 7/3/95
 Tracey W. Holmes (holmes@modis-xl.gsfc.nasa.gov)
 Added SDP error messages.

 6/21/95
 Frederick S. Patt (patt@modis-xl.gsfc.nasa.gov)
 Finished coding.

!Team-unique Header: This software is developed by the MODIS Science Data Support Team for the National Aeronautics and Space Administration, Goddard Space Flight Center, under contract NAS5-32373.

!END*************************************************************************

Definition at line 6 of file GEO_write_parameters.c.

◆ GEO_write_scan_data()

PGSt_SMF_status GEO_write_scan_data ( MODFILE * const  ,
int const  ,
swath_elem_struct const ,
GEO_param_struct const ,
double  [][MAX_FRAMES][3],
double  [][MAX_FRAMES][3],
double  [][MAX_FRAMES][2],
uint8  [][MAX_FRAMES],
uint8  [][MAX_FRAMES],
uint8  [][MAX_FRAMES],
int8  [3][DETECTORS_QKM][SAMPLES_QKM] 
)

◆ GEO_write_scan_metadata()

PGSt_SMF_status GEO_write_scan_metadata ( int const  scan_number,
l1a_data_struct const *const  l1a_data,
celestial_bodies_struct const *const  cb_vectors,
MODFILE *const  geo_file,
PGSt_double const  rpy[],
uint32  frame_quality[][MAX_FRAMES] 
)

Definition at line 11 of file GEO_write_scan_metadata.c.