OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
l1.h File Reference
#include "l1_input.h"
#include "filehandle.h"
#include "l2_flags.h"
#include <clo.h>
#include <genutils.h>
#include <timeutils.h>
#include <libnav.h>
#include <stdint.h>
#include <stdbool.h>
Include dependency graph for l1.h:

Go to the source code of this file.

Classes

struct  geom_struc_def
 
struct  anc_add_struc_def
 
struct  anc_aer_struc_def
 
struct  cld_dat_struc_def
 
struct  l1_struct
 

Macros

#define INSTITUTION   "NASA Goddard Space Flight Center, Ocean Ecology Laboratory, Ocean Biology Processing Group"
 
#define LICENSE   "https://science.nasa.gov/earth-science/earth-science-data/data-information-policy/"
 
#define NAMING_AUTHORITY   "gov.nasa.gsfc.sci.oceandata"
 
#define KEYWORDS_VOCABULARY   "NASA Global Change Master Directory (GCMD) Science Keywords"
 
#define STDNAME_VOCABULARY   "CF Standard Name Table v36"
 
#define CREATOR_NAME   "NASA/GSFC/OBPG"
 
#define CREATOR_EMAIL   "data@oceancolor.gsfc.nasa.gov"
 
#define CREATOR_URL   "https://oceandata.sci.gsfc.nasa.gov"
 
#define PROJECT   "Ocean Biology Processing Group (NASA/GSFC/OBPG)"
 
#define PUBLISHER_NAME   "NASA/GSFC/OBPG"
 
#define PUBLISHER_EMAIL   "data@oceancolor.gsfc.nasa.gov"
 
#define PUBLISHER_URL   "https://oceandata.sci.gsfc.nasa.gov"
 
#define MIN(a, b)   (((a)<(b)) ? (a) : (b))
 
#define MAX(a, b)   (((a)>(b)) ? (a) : (b))
 
#define PI   3.141592654
 
#define RADEG   57.29577951
 
#define OFF   0
 
#define ON   1
 
#define NO   0
 
#define YES   1
 
#define SUCCESS   0
 
#define FATAL_ERROR   1
 
#define LONLAT_ERROR   110
 
#define MAXPIX   10000
 
#define BANDW   10
 
#define BT_LO   -1000
 
#define BT_HI   1000
 
#define SOLZNIGHT   85.0
 
#define SOLZNIGHTA   80.0
 
#define GLINT_MIN   0.0001
 
#define AGZONE0   0
 
#define AGZONE1   640
 
#define AGZONE2   1008
 
#define AGZONE3   1600
 
#define AGZONE4   2192
 
#define AGZONE5   2560
 
#define STDPROC   0 /* evalmask bit definitions */
 
#define OLDAERMOD   1 /* init to old aerosol models */
 
#define MODCLOUD   2 /* enables MODIS/MERIS cloud mask algorithm */
 
#define MODCIRRUS   16 /* enables MODIS cirrus mask */
 
#define NEWSENSINFO   32 /* use test sensor info file */
 
#define NEWRAYTAB   64 /* use test rayleigh tables */
 
#define NEWAERTAB   128 /* use test aerosol tables */
 
#define NEWPOLTAB   256 /* use test polarization tables */
 
#define MSKMODMIR1   1024 /* mask modis mirror-side 1 (navfail) */
 
#define MSKMODMIR2   2048 /* mask modis mirror-side 2 (navfail) */
 
#define SSTMODS   4096 /* reserved for testing SST changes */
 
#define ALTSENSORINFO   8192 /* use .alt sensor infor file in eval */
 
#define TRANSSPHER   32768 /* enables spherical path geom for dtran */
 
#define XCALRVS   1
 
#define XCALPOL   2
 
#define XCALOLI   4
 

Functions

void l1_input_init ()
 
void l1_input_delete (l1_input_t *input)
 
void l1_add_options (clo_optionList_t *list)
 
void l1_read_default_files (clo_optionList_t *list, filehandle *l1file, const char *ifile)
 
void l1_load_options (clo_optionList_t *list, filehandle *l1file)
 
void l1_get_input_params (filehandle *l1file, char *input_parms)
 
void l1_get_input_files (filehandle *l1file, char *input_files)
 
void bindex_set (int32_t wave[], int nwave, int dwave_vswir)
 
int bindex_get (int32_t wave)
 
int bindex_get_555 (void)
 
int windex (float wave, float twave[], int ntwave)
 
int invbindx (int band, int32_t *bindx, int nbands)
 
void radiance2bt (l1str *l1rec, int resolution)
 
void flag_bowtie_deleted (l1str *l1rec, size_t ipix, int extract_offset)
 
int get_f0_neckel (int32_t wl, int32_t width, float *f0)
 
int get_f0_thuillier (int32_t wl, int32_t width, float *f0)
 
void get_f0_thuillier_ext (int32_t wl, int32_t width, float *f0)
 
int init_geom_per_band (l1str *)
 
int geom_per_band_deriv (l1str *)
 
int destroy_geom_per_band (geom_struc *)
 
void init_l1 (l1str *l1rec)
 
int32_t alloc_l1 (filehandle *l1file, l1str *l1rec)
 
void free_l1 (l1str *l1rec)
 
int openl1 (filehandle *l1file)
 
int readl1 (filehandle *l1file, int32_t recnum, l1str *l1rec)
 
int readl1_lonlat (filehandle *l1file, int32_t recnum, l1str *l1rec)
 
void closel1 (filehandle *l1file)
 
void closel1_generic (filehandle *l1file)
 
int openl1_write (filehandle *l1file)
 
int writel1 (filehandle *l1file, int32_t recnum, l1str *l1rec)
 
int openl1_read_hdf (filehandle *l1file)
 
int openl1_write_hdf (filehandle *l1file)
 
int writel1_hdf (filehandle *l1file, int32_t recnum, l1str *l1rec)
 
void closel1_hdf (filehandle *l1file)
 
int l1subpix (filehandle *l1file, l1str *l1rec)
 
void l1_mask_set (l1str *l1rec, int32_t ip)
 
int setflags (l1str *l1rec)
 
void setflagbits_l1 (int level, l1str *l1rec, int32_t ipix)
 
char get_cldmask (l1str *l1rec, int32_t ip)
 
int modis_cloud_mask (l1str *l1rec, int32_t ip)
 
int get_sdps_cld_mask (l1str *, int32_t, char *)
 

Macro Definition Documentation

◆ AGZONE0

#define AGZONE0   0

Definition at line 63 of file l1.h.

◆ AGZONE1

#define AGZONE1   640

Definition at line 64 of file l1.h.

◆ AGZONE2

#define AGZONE2   1008

Definition at line 65 of file l1.h.

◆ AGZONE3

#define AGZONE3   1600

Definition at line 66 of file l1.h.

◆ AGZONE4

#define AGZONE4   2192

Definition at line 67 of file l1.h.

◆ AGZONE5

#define AGZONE5   2560

Definition at line 68 of file l1.h.

◆ ALTSENSORINFO

#define ALTSENSORINFO   8192 /* use .alt sensor infor file in eval */

Definition at line 82 of file l1.h.

◆ BANDW

#define BANDW   10

Definition at line 52 of file l1.h.

◆ BT_HI

#define BT_HI   1000

Definition at line 55 of file l1.h.

◆ BT_LO

#define BT_LO   -1000

Definition at line 54 of file l1.h.

◆ CREATOR_EMAIL

#define CREATOR_EMAIL   "data@oceancolor.gsfc.nasa.gov"

Definition at line 23 of file l1.h.

◆ CREATOR_NAME

#define CREATOR_NAME   "NASA/GSFC/OBPG"

Definition at line 22 of file l1.h.

◆ CREATOR_URL

#define CREATOR_URL   "https://oceandata.sci.gsfc.nasa.gov"

Definition at line 24 of file l1.h.

◆ FATAL_ERROR

#define FATAL_ERROR   1

Definition at line 48 of file l1.h.

◆ GLINT_MIN

#define GLINT_MIN   0.0001

Definition at line 59 of file l1.h.

◆ INSTITUTION

#define INSTITUTION   "NASA Goddard Space Flight Center, Ocean Ecology Laboratory, Ocean Biology Processing Group"

Definition at line 17 of file l1.h.

◆ KEYWORDS_VOCABULARY

#define KEYWORDS_VOCABULARY   "NASA Global Change Master Directory (GCMD) Science Keywords"

Definition at line 20 of file l1.h.

◆ LICENSE

#define LICENSE   "https://science.nasa.gov/earth-science/earth-science-data/data-information-policy/"

Definition at line 18 of file l1.h.

◆ LONLAT_ERROR

#define LONLAT_ERROR   110

Definition at line 49 of file l1.h.

◆ MAX

#define MAX (   a,
  b 
)    (((a)>(b)) ? (a) : (b))

Definition at line 34 of file l1.h.

◆ MAXPIX

#define MAXPIX   10000

Definition at line 50 of file l1.h.

◆ MIN

#define MIN (   a,
  b 
)    (((a)<(b)) ? (a) : (b))

Definition at line 31 of file l1.h.

◆ MODCIRRUS

#define MODCIRRUS   16 /* enables MODIS cirrus mask */

Definition at line 74 of file l1.h.

◆ MODCLOUD

#define MODCLOUD   2 /* enables MODIS/MERIS cloud mask algorithm */

Definition at line 73 of file l1.h.

◆ MSKMODMIR1

#define MSKMODMIR1   1024 /* mask modis mirror-side 1 (navfail) */

Definition at line 79 of file l1.h.

◆ MSKMODMIR2

#define MSKMODMIR2   2048 /* mask modis mirror-side 2 (navfail) */

Definition at line 80 of file l1.h.

◆ NAMING_AUTHORITY

#define NAMING_AUTHORITY   "gov.nasa.gsfc.sci.oceandata"

Definition at line 19 of file l1.h.

◆ NEWAERTAB

#define NEWAERTAB   128 /* use test aerosol tables */

Definition at line 77 of file l1.h.

◆ NEWPOLTAB

#define NEWPOLTAB   256 /* use test polarization tables */

Definition at line 78 of file l1.h.

◆ NEWRAYTAB

#define NEWRAYTAB   64 /* use test rayleigh tables */

Definition at line 76 of file l1.h.

◆ NEWSENSINFO

#define NEWSENSINFO   32 /* use test sensor info file */

Definition at line 75 of file l1.h.

◆ NO

#define NO   0

Definition at line 44 of file l1.h.

◆ OFF

#define OFF   0

Definition at line 42 of file l1.h.

◆ OLDAERMOD

#define OLDAERMOD   1 /* init to old aerosol models */

Definition at line 72 of file l1.h.

◆ ON

#define ON   1

Definition at line 43 of file l1.h.

◆ PI

#define PI   3.141592654

Definition at line 38 of file l1.h.

◆ PROJECT

#define PROJECT   "Ocean Biology Processing Group (NASA/GSFC/OBPG)"

Definition at line 25 of file l1.h.

◆ PUBLISHER_EMAIL

#define PUBLISHER_EMAIL   "data@oceancolor.gsfc.nasa.gov"

Definition at line 27 of file l1.h.

◆ PUBLISHER_NAME

#define PUBLISHER_NAME   "NASA/GSFC/OBPG"

Definition at line 26 of file l1.h.

◆ PUBLISHER_URL

#define PUBLISHER_URL   "https://oceandata.sci.gsfc.nasa.gov"

Definition at line 28 of file l1.h.

◆ RADEG

#define RADEG   57.29577951

Definition at line 40 of file l1.h.

◆ SOLZNIGHT

#define SOLZNIGHT   85.0

Definition at line 57 of file l1.h.

◆ SOLZNIGHTA

#define SOLZNIGHTA   80.0

Definition at line 58 of file l1.h.

◆ SSTMODS

#define SSTMODS   4096 /* reserved for testing SST changes */

Definition at line 81 of file l1.h.

◆ STDNAME_VOCABULARY

#define STDNAME_VOCABULARY   "CF Standard Name Table v36"

Definition at line 21 of file l1.h.

◆ STDPROC

#define STDPROC   0 /* evalmask bit definitions */

Definition at line 71 of file l1.h.

◆ SUCCESS

#define SUCCESS   0

Definition at line 47 of file l1.h.

◆ TRANSSPHER

#define TRANSSPHER   32768 /* enables spherical path geom for dtran */

Definition at line 83 of file l1.h.

◆ XCALOLI

#define XCALOLI   4

Definition at line 87 of file l1.h.

◆ XCALPOL

#define XCALPOL   2

Definition at line 86 of file l1.h.

◆ XCALRVS

#define XCALRVS   1

Definition at line 85 of file l1.h.

◆ YES

#define YES   1

Definition at line 45 of file l1.h.

Function Documentation

◆ alloc_l1()

int32_t alloc_l1 ( filehandle *  l1file,
l1str *  l1rec 
)

Definition at line 15 of file alloc_l1.c.

◆ bindex_get()

int bindex_get ( int32_t  wave)

Definition at line 45 of file windex.c.

◆ bindex_get_555()

int bindex_get_555 ( void  )

Definition at line 57 of file windex.c.

◆ bindex_set()

void bindex_set ( int32_t  wave[],
int  nwave,
int  dwave_vswir 
)

Definition at line 15 of file windex.c.

◆ closel1()

void closel1 ( filehandle *  l1file)

Definition at line 68 of file l1_io.c.

◆ closel1_generic()

void closel1_generic ( filehandle *  l1file)

Definition at line 766 of file l1_generic_write.c.

◆ closel1_hdf()

void closel1_hdf ( filehandle *  l1file)

Definition at line 701 of file l1_hdf_generic_write.c.

◆ destroy_geom_per_band()

int destroy_geom_per_band ( geom_struc *  )

◆ flag_bowtie_deleted()

void flag_bowtie_deleted ( l1str *  l1rec,
size_t  ipix,
int  extract_offset 
)

Definition at line 881 of file l1b_viirs_nc.c.

◆ free_l1()

void free_l1 ( l1str *  l1rec)

Definition at line 6 of file alloc_l1.c.

◆ geom_per_band_deriv()

int geom_per_band_deriv ( l1str *  )

Definition at line 51 of file geom_per_band.c.

◆ get_cldmask()

char get_cldmask ( l1str *  l1rec,
int32_t  ip 
)

Definition at line 280 of file cloud_flag.c.

◆ get_f0_neckel()

int get_f0_neckel ( int32_t  wl,
int32_t  width,
float *  f0 
)

Definition at line 5 of file get_f0.c.

◆ get_f0_thuillier()

int get_f0_thuillier ( int32_t  wl,
int32_t  width,
float *  f0 
)

Definition at line 71 of file get_f0.c.

◆ get_f0_thuillier_ext()

void get_f0_thuillier_ext ( int32_t  wl,
int32_t  width,
float *  f0 
)

Definition at line 137 of file get_f0.c.

◆ get_sdps_cld_mask()

int get_sdps_cld_mask ( l1str *  ,
int32_t  ,
char *   
)

Definition at line 5 of file cloud_flag.c.

◆ init_geom_per_band()

int init_geom_per_band ( l1str *  )

Definition at line 7 of file geom_per_band.c.

◆ init_l1()

void init_l1 ( l1str *  l1rec)

Definition at line 11 of file init_l1.c.

◆ invbindx()

int invbindx ( int  band,
int32_t *  bindx,
int  nbands 
)

Definition at line 106 of file windex.c.

◆ l1_add_options()

void l1_add_options ( clo_optionList_t list)

Definition at line 76 of file l1_options.c.

◆ l1_get_input_files()

void l1_get_input_files ( filehandle *  l1file,
char *  input_files 
)

Definition at line 644 of file l1_options.c.

◆ l1_get_input_params()

void l1_get_input_params ( filehandle *  l1file,
char *  input_parms 
)

Definition at line 444 of file l1_options.c.

◆ l1_input_delete()

void l1_input_delete ( l1_input_t *  input)

Definition at line 65 of file l1_options.c.

◆ l1_input_init()

void l1_input_init ( )

Definition at line 11 of file l1_options.c.

◆ l1_load_options()

void l1_load_options ( clo_optionList_t list,
filehandle *  l1file 
)

Definition at line 247 of file l1_options.c.

◆ l1_mask_set()

void l1_mask_set ( l1str *  l1rec,
int32_t  ip 
)

Definition at line 3 of file setflags_l1.c.

◆ l1_read_default_files()

void l1_read_default_files ( clo_optionList_t list,
filehandle *  l1file,
const char *  ifile 
)

Definition at line 192 of file l1_options.c.

◆ l1subpix()

int l1subpix ( filehandle *  l1file,
l1str *  l1rec 
)

Definition at line 17 of file l1subpix.c.

◆ modis_cloud_mask()

int modis_cloud_mask ( l1str *  l1rec,
int32_t  ip 
)

◆ openl1()

int openl1 ( filehandle *  l1file)

Definition at line 207 of file l1_io.c.

◆ openl1_read_hdf()

int openl1_read_hdf ( filehandle *  l1file)

◆ openl1_write()

int openl1_write ( filehandle *  l1file)

Definition at line 176 of file l1_generic_write.c.

◆ openl1_write_hdf()

int openl1_write_hdf ( filehandle *  l1file)

Definition at line 502 of file l1_hdf_generic_write.c.

◆ radiance2bt()

void radiance2bt ( l1str *  l1rec,
int  resolution 
)

Definition at line 170 of file brightness.c.

◆ readl1()

int readl1 ( filehandle *  l1file,
int32_t  recnum,
l1str *  l1rec 
)

Definition at line 400 of file l1_io.c.

◆ readl1_lonlat()

int readl1_lonlat ( filehandle *  l1file,
int32_t  recnum,
l1str *  l1rec 
)

Definition at line 587 of file l1_io.c.

◆ setflagbits_l1()

void setflagbits_l1 ( int  level,
l1str *  l1rec,
int32_t  ipix 
)

Definition at line 129 of file setflags_l1.c.

◆ setflags()

int setflags ( l1str *  l1rec)

Definition at line 16 of file setflags_l1.c.

◆ windex()

int windex ( float  wave,
float  twave[],
int  ntwave 
)

Definition at line 73 of file windex.c.

◆ writel1()

int writel1 ( filehandle *  l1file,
int32_t  recnum,
l1str *  l1rec 
)

Definition at line 647 of file l1_generic_write.c.

◆ writel1_hdf()

int writel1_hdf ( filehandle *  l1file,
int32_t  recnum,
l1str *  l1rec 
)

Definition at line 618 of file l1_hdf_generic_write.c.