OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
calfile_utils.h File Reference
#include "l1.h"
#include "aer_struc.h"
#include "target_struc.h"
#include <dfutils.h>
Include dependency graph for calfile_utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  cal_struct
 

Enumerations

enum  caltype { DET2DET, CROSSCAL, BINMATCH }
 

Functions

idDS calfile_open (char *ofile, int sensorID, int ydim, int xdim, int nprods, int nvars1d, char l2prods[L1_MAXPROD][32], char vars1Dnames[L1_MAXPROD][32], long *numExistingRuns, caltype ctype)
 
int calfile_close (idDS ds_id)
 
int calfile_create (char *ofile, idDS *ds_id, int sensorID, int ydim, int xdim, int nprods, int nvars1d, char l2prods[L1_MAXPROD][32], char vars1Dnames[L1_MAXPROD][32], caltype ctype)
 
int calfile_write (idDS ds_id, calstr *calrec, int recnum, int ydim, int xdim, int nprods, int nbands, int nvars1d, char l2prods[L1_MAXPROD][32], char vars1Dnames[L1_MAXPROD][32], caltype ctype)
 
void inversion_init (long xdim, long iscan, int nbands, long ipix, aestr *aerec, tgstr *tgrec)
 
calstr * alloc_calrec (int xdim, int nbands, int nprods, int nvar1d)
 
void free_calrec (calstr *calrec, int nbands, int nprods)
 

Variables

float *** aots
 
float *** nlws
 
int16_t fileID
 

Enumeration Type Documentation

◆ caltype

enum caltype
Enumerator
DET2DET 
CROSSCAL 
BINMATCH 

Definition at line 20 of file calfile_utils.h.

Function Documentation

◆ alloc_calrec()

calstr* alloc_calrec ( int  ydim,
int  nbands,
int  nprods,
int  nvar1d 
)

alloc_calrec Allocate space for a detector run record

Parameters
ydim- y-dimension of records to allocate
nbands- number of wavelength bands
nprods- number of output products (2D)
nvar1d- number of 1 dimensional arrays in output product
Returns
- allocated calrec structure

Definition at line 516 of file calfile_utils.c.

◆ calfile_close()

int calfile_close ( idDS  ds_id)

calfile_close - close an open output file

Parameters
ds_id
Returns

Definition at line 210 of file calfile_utils.c.

◆ calfile_create()

int calfile_create ( char *  ofile,
idDS ds_id,
int  sensorID,
int  ydim,
int  xdim,
int  nprods,
int  nvars1d,
char  l2prods[L1_MAXPROD][32],
char  vars1Dnames[L1_MAXPROD][32],
caltype  ctype 
)

calfile_create - creates a output file

Parameters
ofile- filename to open for writing
ds_id- HDF/netCDF dataset id (idDS)
sensorID- sensorID
ydim- size of y-dimension for output arrays
xdim- size of x-dimension for output arrays
nprods- number of output products
nvars1d- number of 1D output products
l2prods- output product names
vars1Dnames- 1D product names
ctype- calibration type (e.g. DET2DET, CROSSCAL)
Returns

Definition at line 230 of file calfile_utils.c.

◆ calfile_open()

idDS calfile_open ( char *  ofile,
int  sensorID,
int  ydim,
int  xdim,
int  nprods,
int  nvars1d,
char  l2prods[L1_MAXPROD][32],
char  vars1Dnames[L1_MAXPROD][32],
long *  numExistingRecords,
caltype  ctype 
)

det_open opens an output file, if it doesn't exist it creates one, if it does exist it appends by copying existing file to a temporary location and bumping the size of the arrays to create a new output file of the same name

Parameters
ofile- filename to open for writing
sensorID- sensor ID number
ydim- size of y-dimension for output arrays
xdim- size of x-dimension for output arrays
nprods- number of output products
nvars1d- number of 1D output products
l2prods- output product names
vars1Dnames- 1D product names
numExistingRecords- number of existing records, used for appending...
ctype- calibration type (e.g. DET2DET, CROSSCAL, BINMATCH)
Returns

Definition at line 48 of file calfile_utils.c.

◆ calfile_write()

int calfile_write ( idDS  ds_id,
calstr *  calrec,
int  recnum,
int  ydim,
int  xdim,
int  nprods,
int  nbands,
int  nvars1d,
char  l2prods[L1_MAXPROD][32],
char  vars1Dnames[L1_MAXPROD][32],
caltype  ctype 
)

calfile_write() - writes data to output file

Parameters
ds_id- HDF/netCDF dataset id (idDS)
calrec- structure containing data to write
recnum- record number for record to write
ydim- size of y-dimension for output arrays
xdim- size of x-dimension for output arrays
nprods- number of output products
nbands- number of wavelength bands
nvars1d- number of 1 dimensional arrays
l2prods- output product names
vars1Dnames- 1D product names
ctype- calibration type (e.g. DET2DET, CROSSCAL)
Returns

Definition at line 348 of file calfile_utils.c.

◆ free_calrec()

void free_calrec ( calstr *  calrec,
int  nbands,
int  nprods 
)

free_calrec - free allocated calibration structures

Parameters
calrec
nbands- number of wavelength bands
nprods- number of output products (2D)
nvars1d- number of 1 dimensional arrays in output product

Definition at line 578 of file calfile_utils.c.

◆ inversion_init()

void inversion_init ( long  ndets,
long  iscan,
int  nbands,
long  ipix,
aestr *  aerec,
tgstr *  tgrec 
)

inversion_init Initialize the average nLw and aot arrays for input into inversion

Parameters
ndets- number of contiguous detectors
iscan- scan number of l1 file
nbands- number of wavelength bands
ipix- pixel number
aerec- aerosol calibration record structure
tgrec- nlw calibration record structure

Definition at line 480 of file calfile_utils.c.

Variable Documentation

◆ aots

float*** aots

Definition at line 45 of file main_l1det2det.c.

◆ fileID

int16_t fileID

Definition at line 43 of file main_l1det2det.c.

◆ nlws

float*** nlws

Definition at line 45 of file main_l1det2det.c.