OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
goci.c File Reference
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <inttypes.h>
#include <unistd.h>
#include <proj.h>
#include <math.h>
#include "hdf5.h"
#include "hdf5_hl.h"
#include "goci.h"
Include dependency graph for goci.c:

Go to the source code of this file.

Functions

int goci_proj4_open (goci_l1b_t *l1b)
 
void goci_proj4_close (goci_l1b_t *l1b)
 
int goci_l1b_open (const char *src_path, goci_l1b_t **goci_l1b)
 
int goci_l1b_close (goci_l1b_t *goci_l1b)
 
int goci_l1b_get_date (goci_l1b_t *goci_l1b, char *tstr_name, int *year, int *month, int *day)
 
int goci_l1b_get_time (goci_l1b_t *goci_l1b, char *tstr_name, int *hour, int *min, int *sec)
 
int goci_l1b_get_band (goci_l1b_t *goci_l1b, int band, int line, uint32_t *buf)
 

Detailed Description

GOCI file format reader.

Author
Paul Martinolich
Naval Research Laboratory

Definition in file goci.c.

Function Documentation

◆ goci_l1b_close()

int goci_l1b_close ( goci_l1b_t goci_l1b)

close GOCI bands

Parameters
[in]goci_l1bGOCI file

Close the GOCI file

Returns
0 for success, -2 for close error

Definition at line 370 of file goci.c.

◆ goci_l1b_get_band()

int goci_l1b_get_band ( goci_l1b_t goci_l1b,
int  band,
int  line,
uint32_t *  buf 
)

read specified band and line from GOCI file.

Parameters
[in]goci_l1bGOCI file
[in]bandBand number to read (0-7)
[in]lineLine to read
[out]bufbuffer to contain data

This function reads a scan line from the GOCI data. The returned value can be converted to radiance by multiply the value by 1E-07.

Returns
0 for success, -4 for read error, -6 for invalid parameter

Definition at line 488 of file goci.c.

◆ goci_l1b_get_date()

int goci_l1b_get_date ( goci_l1b_t goci_l1b,
char *  tstr_name,
int *  year,
int *  month,
int *  day 
)

read a date of GOCI data

Parameters
[in]goci_l1bGOCI l1b file information structure
[in]tstr_namename of time string to read from (char *)
[out]yearYear
[out]monthMonth (1-12)
[out]dayDay (1-31)

This function gets the date from the GOCI data file.

Returns
0 for success, -3 for invalid format

Definition at line 415 of file goci.c.

◆ goci_l1b_get_time()

int goci_l1b_get_time ( goci_l1b_t goci_l1b,
char *  tstr_name,
int *  hour,
int *  min,
int *  sec 
)

read a time of GOCI data

Parameters
[in]goci_l1bGOCI file
[in]tstr_namename of time string to read from (char *)
[out]hourHour of day (0-23)
[out]minMinute (0-59)
[out]secSecond (0-59)

This function gets the time from the GOCI data file.

Returns
0 for success, -3 for invalid format

Definition at line 452 of file goci.c.

◆ goci_l1b_open()

int goci_l1b_open ( const char *  src_path,
goci_l1b_t **  goci_l1b 
)

open GOCI bands

Parameters
[in]src_pathpath to one GOCI file
[out]goci_l1bGOCI file structure

Opens a GOCI data file and attaches to the main data set "Image Data" which is stored as a GRID.

Returns
-1 for open error, -2 for close error, -3 for invalid format -4 for read error, -5 for memory error W. Robinson, SAIC, Nov 2014, the position in the file is really ( radius, sub-sat lon, sub-sat lat ), so derive position accordingly W. Robinson, SAIC, 5 Dec 2014, set up the slot navigation to get better times

Definition at line 226 of file goci.c.

◆ goci_proj4_close()

void goci_proj4_close ( goci_l1b_t l1b)

free all memory related to proj4

Parameters
[in/out]goci_l1b GOCI file structure

Free up the memory used by the proj4 geolocation functions

Definition at line 205 of file goci.c.

◆ goci_proj4_open()

int goci_proj4_open ( goci_l1b_t l1b)

init proj4 for GOCI geolocation

Parameters
[in/out]goci_l1b GOCI file structure

Uses the information in the goci_l1b structure to init the proj4 structure for converting the geolocation information.

Returns
-1 for open error, -2 for close error, -4 for read error

Definition at line 31 of file goci.c.