OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022

#include <L3File.h>

Inheritance diagram for L3File:
[legend]
Collaboration diagram for L3File:
[legend]

Public Member Functions

 L3File ()
 
virtual ~L3File ()
 
virtual int64_t rowbin2record (int32_t row, int64_t bin)
 
virtual int64_t rowcol2record (int32_t row, int32_t col)
 
virtual int64_t latlon2record (float lat, float lon)
 
virtual int64_t bin2record (int64_t bin)
 
virtual void clearCache ()
 
virtual void setNumCacheRows (int32_t numRows)
 
virtual bool open (const char *fileName)
 
virtual void close ()
 
virtual meta_l3bTypegetMetaData ()
 
virtual int32_t getNumProducts ()
 
virtual std::string getProductName (size_t index=0)
 
virtual bool setActiveProductList (const char *prodStr)
 
virtual int32_t getNumActiveProducts ()
 
virtual std::string getActiveProductName (size_t index=0)
 
virtual int32_t getNumRows ()
 
virtual L3RowgetRow (int32_t row)
 
virtual L3BingetBin (int32_t row, int32_t col)
 
virtual L3BingetClosestBin (float lat, float lon)
 
template<typename Geometry >
L3BingetBinsInside (Geometry geo, bool areaWeighted=false)
 
virtual Hdf::hdf_bingetHdfBinObject () const
 
virtual bool hasQuality ()
 
virtual void setQualityProcessing (bool val)
 
virtual bool getQualityProcessing () const
 
virtual L3ShapegetShape () const
 

Protected Member Functions

virtual L3RowreadRow (int32_t row)
 
virtual int initRecordLookup ()
 
template<typename Geometry >
bool addBinsFromRow (float lat0, float lon0, Geometry geo, bool areaWeighted)
 

Protected Attributes

L3Shapeshape
 
Hdf::hdf_binbinObj
 
std::list< L3Row * > rowList
 
int numCacheRows
 
int64_t * baseRecord
 
int32_t * extentbin
 
float * sumBuffer
 
L3Bin outBin
 
uint8_t * qualityBuffer
 
size_t * prodMap
 
size_t numProds
 
std::vector< std::stringactiveProdNameList
 

Detailed Description

class to read the information out of a L3 bin file

Definition at line 143 of file L3File.h.

Constructor & Destructor Documentation

◆ L3File()

L3File ( )

Definition at line 391 of file L3File.cpp.

◆ ~L3File()

~L3File ( )
virtual

Definition at line 403 of file L3File.cpp.

Member Function Documentation

◆ addBinsFromRow()

bool addBinsFromRow ( float  lat0,
float  lon0,
Geometry  geo,
bool  areaWeighted 
)
inlineprotected

Search for bins in this row that are inside the geometry. Add the bins found into class member outBin

Parameters
lat0latitude to start at
lon0longitude to start at
geogeometry to intersect with
Returns
true if a bin in this row intersected the geometry

Definition at line 171 of file L3File.h.

◆ bin2record()

int64_t bin2record ( int64_t  bin)
virtual

Get the record number in the file for the given bin

Parameters
binbin number (1-relative)
Returns
record number in the file or -1 if not found

Definition at line 575 of file L3File.cpp.

◆ clearCache()

void clearCache ( )
virtual

Definition at line 411 of file L3File.cpp.

◆ close()

void close ( )
virtual

Reimplemented in L3FileSMI.

Definition at line 443 of file L3File.cpp.

◆ getActiveProductName()

string getActiveProductName ( size_t  index = 0)
virtual

Definition at line 632 of file L3File.cpp.

◆ getBin()

L3Bin * getBin ( int32_t  row,
int32_t  col 
)
virtual

return the bin at row/col

Parameters
rowof desired bin
colof desired bin
Returns
pointer to the bin object or NULL if bin not in file

Definition at line 761 of file L3File.cpp.

◆ getBinsInside()

L3Bin* getBinsInside ( Geometry  geo,
bool  areaWeighted = false 
)
inline

return a bin with binned data for all of the bins that intersect Geometry

Parameters
geoboost geometry to define an area
Returns
pointer to a bin containing all of the binned data found in this area, or NULL if no bins found. This pointer is good until the next call to this function.

Definition at line 266 of file L3File.h.

◆ getClosestBin()

L3Bin * getClosestBin ( float  lat,
float  lon 
)
virtual

return the bin closest to lat, lon

Parameters
latlatitude of desired bin
lonlongitude of desired bin
Returns
pointer to the bin object or NULL if bin not in file

Definition at line 739 of file L3File.cpp.

◆ getHdfBinObject()

Hdf::hdf_bin * getHdfBinObject ( ) const
virtual

get the underlying hdf_bin object

Returns
the hdf_bin obj or NULL if file is not opened yet.

Definition at line 784 of file L3File.cpp.

◆ getMetaData()

meta_l3bType * getMetaData ( )
virtual

Reimplemented in L3FileSMI.

Definition at line 475 of file L3File.cpp.

◆ getNumActiveProducts()

int32_t getNumActiveProducts ( )
virtual

Definition at line 628 of file L3File.cpp.

◆ getNumProducts()

int32_t getNumProducts ( )
virtual

Reimplemented in L3FileSMI.

Definition at line 581 of file L3File.cpp.

◆ getNumRows()

int32_t getNumRows ( )
virtual

get the number of rows in the bin file

Returns
number of rows or -1 if file not opened yet

Definition at line 726 of file L3File.cpp.

◆ getProductName()

string getProductName ( size_t  index = 0)
virtual

Reimplemented in L3FileSMI.

Definition at line 587 of file L3File.cpp.

◆ getQualityProcessing()

bool getQualityProcessing ( ) const
virtual

Definition at line 811 of file L3File.cpp.

◆ getRow()

L3Row * getRow ( int32_t  row)
virtual

Definition at line 695 of file L3File.cpp.

◆ getShape()

virtual L3Shape* getShape ( ) const
inlinevirtual

Definition at line 317 of file L3File.h.

◆ hasQuality()

bool hasQuality ( )
virtual

Reimplemented in L3FileSMI.

Definition at line 788 of file L3File.cpp.

◆ initRecordLookup()

int initRecordLookup ( )
protectedvirtual

init the internal data structures to lookup the record index

Returns
status 0 if good, -1 if bad

Reimplemented in L3FileSMI.

Definition at line 486 of file L3File.cpp.

◆ latlon2record()

int64_t latlon2record ( float  lat,
float  lon 
)
virtual

Get the record number in the file for the closest lat, lon

Parameters
latlatitude of the bin
lonlongitude of the bin
Returns
record number in the file or -1 if not found

Definition at line 562 of file L3File.cpp.

◆ open()

bool open ( const char *  fileName)
virtual

Reimplemented in L3FileSMI.

Definition at line 430 of file L3File.cpp.

◆ readRow()

L3Row * readRow ( int32_t  row)
protectedvirtual

Reimplemented in L3FileSMI.

Definition at line 636 of file L3File.cpp.

◆ rowbin2record()

int64_t rowbin2record ( int32_t  row,
int64_t  bin 
)
virtual

Given row, col and bin lookup the record number. Note that row, col and bin are NOT checked for out of bounds. Mostly an internal function.

Parameters
rowrow number of the bin (0-relative)
binbin number (1-relative)
Returns
record number in the file, or -1 if bin is not in the file.

Definition at line 529 of file L3File.cpp.

◆ rowcol2record()

int64_t rowcol2record ( int32_t  row,
int32_t  col 
)
virtual

Get the record number in the file for the given row and col

Parameters
rowrow of the bin (0-relative)
colcol of the bin (0-relative)
Returns
record number in the file or -1 if not found

Definition at line 550 of file L3File.cpp.

◆ setActiveProductList()

bool setActiveProductList ( const char *  prodStr)
virtual

Reimplemented in L3FileSMI.

Definition at line 591 of file L3File.cpp.

◆ setNumCacheRows()

void setNumCacheRows ( int32_t  numRows)
virtual

Definition at line 420 of file L3File.cpp.

◆ setQualityProcessing()

void setQualityProcessing ( bool  val)
virtual

Definition at line 795 of file L3File.cpp.

Member Data Documentation

◆ activeProdNameList

std::vector<std::string> activeProdNameList
protected

array of active product names

Definition at line 156 of file L3File.h.

◆ baseRecord

int64_t* baseRecord
protected

first record index of each row (0 based)

Definition at line 149 of file L3File.h.

◆ binObj

Hdf::hdf_bin* binObj
protected

Definition at line 146 of file L3File.h.

◆ extentbin

int32_t* extentbin
protected

save the number of records in each row

Definition at line 150 of file L3File.h.

◆ numCacheRows

int numCacheRows
protected

Definition at line 148 of file L3File.h.

◆ numProds

size_t numProds
protected

Definition at line 155 of file L3File.h.

◆ outBin

L3Bin outBin
protected

accumulation bin for lookups

Definition at line 152 of file L3File.h.

◆ prodMap

size_t* prodMap
protected

index map used to map my product index into binObj's index

Definition at line 154 of file L3File.h.

◆ qualityBuffer

uint8_t* qualityBuffer
protected

buffer for the quality (2*nrows)

Definition at line 153 of file L3File.h.

◆ rowList

std::list<L3Row*> rowList
protected

Definition at line 147 of file L3File.h.

◆ shape

L3Shape* shape
protected

Definition at line 145 of file L3File.h.

◆ sumBuffer

float* sumBuffer
protected

buffer for the sums (sum, sumSq, 2*nrows, numProd)

Definition at line 151 of file L3File.h.


The documentation for this class was generated from the following files:
  • /gfs-oceanweb/web/ocssw/ocssw_src/oel_hdf4/libbin/L3File.h
  • /gfs-oceanweb/web/ocssw/ocssw_src/oel_hdf4/libbin/L3File.cpp