GLIMSView Source Code Documentation

HdfEosFrmt Class Reference

#include <hdfeosfrmt.h>

Inheritance diagram for HdfEosFrmt:

Inheritance graph
[legend]

List of all members.


Detailed Description

An ImageFormat implementation providing access to the HdfEos library.

Being very difficult to make a generic implementation that's not specific to a single dataset, much of this code is specific to Aster L1A and L1B products.

History:
2006-01-09 dls - Added several new functions to pull metadata out of Aster HDF file
History:
2007-06-14 dls - Removed functions and references to Image ID. Image ID is set by the GLIMS database ingestion, not pulled from the image metadata.

Definition at line 37 of file hdfeosfrmt.h.


Public Types

enum  ScaleType { SCALE_NN = 1, SCALE_BI, SCALE_BC }
enum  DataType {
  NOT_DEFINED, INT8, UINT8, INT16,
  UINT16, INT32, UINT32, INT64,
  UINT64, FLOAT16, FLOAT32, FLOAT64
}

Public Member Functions

 ~HdfEosFrmt ()
virtual bool open (std::string fname)
 Open an HDF image and pull out associated metadata.
virtual void getLL (int iband, double &i, double &j, bool toWGS84)
virtual void getLL (int iband, double &i, double &j)
virtual void getXY (int iband, double &i, double &j)
virtual void * getBand (int iband, int x1, int y1, int w1, int h1, int w2, int h2, ScaleType=SCALE_BI) const
std::vector< BandInf > & getBandInfSet ()
unsigned int getNumBands ()
const BandInfgetBandInf (int iband)
std::string getName () const
char * scaleData (char **orig, int ow, int oh, int nw, int nh, DataType dt, ScaleType st, bool del=true) const
char * scaleData (char **orig, int ox, int oy, int ow, int oh, int fw, int fh, int nw, int nh, DataType dt, ScaleType st, bool del=true) const
template<class DType>
DType * scaleDT (DType *orig, int ox, int oy, int ow, int oh, int fw, int fh, int nw, int nh, ScaleType st) const
template<typename DType>
DType * scl_nearestneighbor (DType *orig, int ox, int oy, int ow, int oh, int fw, int fh, int nw, int nh) const
template<class DType>
DType * scl_bilinear (DType *orig, int ox, int oy, int ow, int oh, int fw, int fh, int nw, int nh) const
unsigned char * scl_bicubic (unsigned char *orig, int ow, int oh, int nw, int nh, int szd) const
ImageInfgetImageInf ()
void setCornerPnts (int iband, ImageInf &inf)

Static Public Member Functions

static std::string dtypeToString (DataType dt)
static int dtypeSize (DataType dt)
static bool isFloat (DataType dt)

Protected Types

enum  Projection { UNSUPPORTED, UTM }
 Aliases for projection names. More...

Protected Member Functions

void parseGeoFlds (int32 swid, std::string swname)
 get info from Aster HDF file
std::string getHdfGblAttr (const std::string &fname, const std::string &attrname) const
 get info from Aster HDF file
std::string getAquiDateTime (const std::string &fname) const
 Get image aquisition date/time from Aster HDF file.
std::string getProjection (const std::string &fname) const
 get projection info from Aster HDF file
std::string getOrigID (const std::string &fname) const
 get origin ID info from Aster HDF file
std::string getInstZenith (const std::string &fname) const
 get instrument zenith info from Aster HDF file
std::string getCloudPct (const std::string &fname) const
 get percentage of cloud cover info from Aster HDF file
std::string getSunAzim (const std::string &fname) const
 get sun azimuth info from Aster HDF file
std::string getSunElev (const std::string &fname) const
 get sun elevation info from Aster HDF file
std::string getImageAzim (const std::string &fname) const
 get image azimuth info from Aster HDF file
std::string getInstID (const std::string &fname) const
 get image ID info from Aster HDF file
std::string getInstAz (const std::string &fname) const
 get instrument azimuth info from Aster HDF file
void getBandMetaData () const
 get band metadata info from Aster HDF file
std::vector< std::string > splitList (char *clist, char delim)
template<class DType>
void findrange (int32 swid, std::string field, DType &lwr, DType &upr, std::vector< int32 > dims)
template<class DType>
void maxmin (DType *data, int sz, DType &lwr, DType &upr)
template<class DType>
void bilinterp (DType *map, std::vector< int32 > dims, std::vector< int32 > offset, std::vector< int32 > inc, int x, int y, double &res)
void getGeoFields (int iband)
void getIntersect (int &track, int &p1, int p2, int iband, double searchVal, bool isLon, bool horizontal=true)
void trackLineTo (int &x, int &y, int iband, double trackVal, double searchVal)
bool between (double a, double b, double c)
void xyToLL (int iband, double &x, double &y)
void xyToMeter (int iband, double &x, double &y)
void meterToLL (int iband, double &x, double &y)
void llToMeter (int iband, double &lon, double &lat)
void llToXY (int iband, double &lon, double &lat)
projPJ createProj (int iband)
void getULCorners ()

Protected Attributes

int32 mSWfid
std::vector< DataFieldmDFList
std::vector< GeoFieldmGFList
Projection mProj
std::string mFName
std::vector< BandInfmBandSet
ImageInf mImageInf

Classes

struct  DataField
 Structure to hold geographic metadata about the image. More...
struct  GeoField
 Structure to hold geographic metadata about the image. More...

Member Enumeration Documentation

enum HdfEosFrmt::Projection [protected]

Aliases for projection names.

Enumerator:
UNSUPPORTED  unsupported
UTM  Universal Transverse Mercator.

Definition at line 44 of file hdfeosfrmt.h.

enum ImageFormat::ScaleType [inherited]

Enumerator:
SCALE_NN 
SCALE_BI 
SCALE_BC 

Definition at line 39 of file imageformat.h.

enum ImageFormat::DataType [inherited]

Enumerator:
NOT_DEFINED 
INT8 
UINT8 
INT16 
UINT16 
INT32 
UINT32 
INT64 
UINT64 
FLOAT16 
FLOAT32 
FLOAT64 

Definition at line 45 of file imageformat.h.


Constructor & Destructor Documentation

HdfEosFrmt::~HdfEosFrmt (  ) 


Member Function Documentation

void HdfEosFrmt::parseGeoFlds ( int32  swid,
std::string  swname 
) [protected]

get info from Aster HDF file

Definition at line 873 of file hdfeosfrmt.cpp.

References HdfEosFrmt::GeoField::dimnames, HdfEosFrmt::GeoField::dims, HdfEosFrmt::GeoField::geomap, HdfEosFrmt::GeoField::gfldname, mGFList, splitList(), HdfEosFrmt::GeoField::swathname, and HdfEosFrmt::GeoField::type.

Referenced by open().

Here is the call graph for this function:

std::string HdfEosFrmt::getHdfGblAttr ( const std::string &  fname,
const std::string &  attrname 
) const [protected]

std::string HdfEosFrmt::getAquiDateTime ( const std::string &  fname  )  const [protected]

Get image aquisition date/time from Aster HDF file.

History:
2006-01-10 dls - Modified to not format the date-time if invalid characters are found in Aster TIMEOFDAY or CALENDARDATE metadata fields. Formatting of date-time ISO 8601 compliant.

Definition at line 978 of file hdfeosfrmt.cpp.

References ODLTree::getElem(), getHdfGblAttr(), ODLParser::getObject(), and ODLElement::getValue().

Referenced by open().

Here is the call graph for this function:

std::string HdfEosFrmt::getProjection ( const std::string &  fname  )  const [protected]

get projection info from Aster HDF file

Definition at line 1184 of file hdfeosfrmt.cpp.

References ODLTree::getElem(), getHdfGblAttr(), ODLParser::getObject(), and ODLElement::getValue().

Referenced by open().

Here is the call graph for this function:

std::string HdfEosFrmt::getOrigID ( const std::string &  fname  )  const [protected]

get origin ID info from Aster HDF file

Definition at line 1061 of file hdfeosfrmt.cpp.

References ODLTree::getElem(), getHdfGblAttr(), ODLParser::getObject(), and ODLElement::getValue().

Referenced by open().

Here is the call graph for this function:

std::string HdfEosFrmt::getInstZenith ( const std::string &  fname  )  const [protected]

get instrument zenith info from Aster HDF file

Definition at line 1083 of file hdfeosfrmt.cpp.

References ODLTree::getElem(), getHdfGblAttr(), ODLParser::getObject(), and ODLElement::getValue().

Referenced by open().

Here is the call graph for this function:

std::string HdfEosFrmt::getCloudPct ( const std::string &  fname  )  const [protected]

get percentage of cloud cover info from Aster HDF file

Definition at line 1102 of file hdfeosfrmt.cpp.

References ODLTree::getElem(), getHdfGblAttr(), ODLParser::getObject(), and ODLElement::getValue().

Referenced by open().

Here is the call graph for this function:

std::string HdfEosFrmt::getSunAzim ( const std::string &  fname  )  const [protected]

get sun azimuth info from Aster HDF file

Definition at line 1121 of file hdfeosfrmt.cpp.

References ODLTree::getElem(), getHdfGblAttr(), ODLParser::getObject(), and ODLElement::getValue().

Referenced by open().

Here is the call graph for this function:

std::string HdfEosFrmt::getSunElev ( const std::string &  fname  )  const [protected]

get sun elevation info from Aster HDF file

Definition at line 1143 of file hdfeosfrmt.cpp.

References ODLTree::getElem(), getHdfGblAttr(), ODLParser::getObject(), and ODLElement::getValue().

Referenced by open().

Here is the call graph for this function:

std::string HdfEosFrmt::getImageAzim ( const std::string &  fname  )  const [protected]

get image azimuth info from Aster HDF file

Definition at line 1165 of file hdfeosfrmt.cpp.

References ODLTree::getElem(), getHdfGblAttr(), ODLParser::getObject(), and ODLElement::getValue().

Referenced by open().

Here is the call graph for this function:

std::string HdfEosFrmt::getInstID ( const std::string &  fname  )  const [protected]

get image ID info from Aster HDF file

History:
2006-01-09 dls - Added function
History:
2007-06-14 dls - Removed function. Image ID is set by the GLIMS database ingestion, not pulled from the image metadata.
get instrument ID info from Aster HDF file
History:
2006-01-09 dls - Added function

Definition at line 1255 of file hdfeosfrmt.cpp.

References ODLTree::getElem(), getHdfGblAttr(), ODLParser::getObject(), and ODLElement::getValue().

Referenced by open().

Here is the call graph for this function:

std::string HdfEosFrmt::getInstAz ( const std::string &  fname  )  const [protected]

get instrument azimuth info from Aster HDF file

History:
2006-01-09 dls - Added function

Definition at line 1277 of file hdfeosfrmt.cpp.

References ODLTree::getElem(), getHdfGblAttr(), ODLParser::getObject(), and ODLElement::getValue().

Referenced by open().

Here is the call graph for this function:

void HdfEosFrmt::getBandMetaData (  )  const [protected]

std::vector<std::string> HdfEosFrmt::splitList ( char *  clist,
char  delim 
) [inline, protected]

Definition at line 167 of file hdfeosfrmt.h.

Referenced by open(), and parseGeoFlds().

template<class DType>
void HdfEosFrmt::findrange ( int32  swid,
std::string  field,
DType &  lwr,
DType &  upr,
std::vector< int32 >  dims 
) [inline, protected]

Definition at line 948 of file hdfeosfrmt.cpp.

References maxmin().

Referenced by open().

Here is the call graph for this function:

template<class DType>
void HdfEosFrmt::maxmin ( DType *  data,
int  sz,
DType &  lwr,
DType &  upr 
) [inline, protected]

Definition at line 189 of file hdfeosfrmt.h.

Referenced by findrange().

template<class DType>
void HdfEosFrmt::bilinterp ( DType *  map,
std::vector< int32 >  dims,
std::vector< int32 >  offset,
std::vector< int32 >  inc,
int  x,
int  y,
double &  res 
) [inline, protected]

Definition at line 1474 of file hdfeosfrmt.cpp.

Referenced by getLL().

void HdfEosFrmt::getGeoFields ( int  iband  )  [protected]

void HdfEosFrmt::getIntersect ( int &  track,
int &  p1,
int  p2,
int  iband,
double  searchVal,
bool  isLon,
bool  horizontal = true 
) [protected]

Definition at line 635 of file hdfeosfrmt.cpp.

References getLL().

Referenced by getXY().

Here is the call graph for this function:

void HdfEosFrmt::trackLineTo ( int &  x,
int &  y,
int  iband,
double  trackVal,
double  searchVal 
) [protected]

Definition at line 725 of file hdfeosfrmt.cpp.

References getLL().

Referenced by getXY().

Here is the call graph for this function:

bool HdfEosFrmt::between ( double  a,
double  b,
double  c 
) [inline, protected]

Definition at line 232 of file hdfeosfrmt.h.

Referenced by getXY().

bool HdfEosFrmt::open ( std::string  fname  )  [virtual]

Open an HDF image and pull out associated metadata.

History:
2006-01-09 dls - Altered open function to pull image metadata and fill in ImageInf structure
History:
2005-08-20 dls modified to not overwrite image acquisition date read in from project file

Implements ImageFormat.

Definition at line 21 of file hdfeosfrmt.cpp.

References HdfEosFrmt::DataField::dimnames, HdfEosFrmt::DataField::dims, HdfEosFrmt::DataField::fieldname, findrange(), getAquiDateTime(), getBandMetaData(), getCloudPct(), getGeoFields(), getImageAzim(), getInstAz(), getInstID(), getInstZenith(), getLL(), getOrigID(), getProjection(), getSunAzim(), getSunElev(), ImageFormat::getULCorners(), ImageFormat::BandInf::height, ImageFormat::INT16, ImageFormat::INT8, ImageInf::mAquiDateTime, ImageFormat::BandInf::max, ImageFormat::mBandSet, ImageInf::mCenterLat, ImageInf::mCenterLon, ImageInf::mCloudPct, mDFList, ImageFormat::mFName, ImageInf::mImageAzim, ImageFormat::mImageInf, ImageFormat::BandInf::min, ImageInf::mInstID, ImageInf::mInstrument_azimuth, ImageInf::mInstrument_zenith, ImageInf::mLocURL, ImageInf::mOrigID, ImageInf::mProjection, ImageInf::mSunAzim, ImageInf::mSunElev, mSWfid, ImageFormat::BandInf::name, ImageFormat::BandInf::ndims, ImageFormat::NOT_DEFINED, parseGeoFlds(), splitList(), HdfEosFrmt::DataField::swathname, ImageFormat::BandInf::type, HdfEosFrmt::DataField::type, ImageFormat::UINT16, ImageFormat::UINT8, and ImageFormat::BandInf::width.

Referenced by Image::openImage().

Here is the call graph for this function:

void HdfEosFrmt::getLL ( int  iband,
double &  i,
double &  j,
bool  toWGS84 
) [virtual]

virtual void HdfEosFrmt::getLL ( int  iband,
double &  i,
double &  j 
) [inline, virtual]

Implements ImageFormat.

Definition at line 256 of file hdfeosfrmt.h.

References getLL(), ImageFormat::mBandSet, and ImageFormat::xyToLL().

Here is the call graph for this function:

void HdfEosFrmt::getXY ( int  iband,
double &  i,
double &  j 
) [virtual]

void * HdfEosFrmt::getBand ( int  iband,
int  x1,
int  y1,
int  w1,
int  h1,
int  w2,
int  h2,
ScaleType  st = SCALE_BI 
) const [virtual]

Implements ImageFormat.

Definition at line 820 of file hdfeosfrmt.cpp.

References ImageFormat::dtypeSize(), ImageFormat::mBandSet, mDFList, mSWfid, and ImageFormat::scaleData().

Here is the call graph for this function:

void ImageFormat::xyToLL ( int  iband,
double &  x,
double &  y 
) [protected, inherited]

Definition at line 618 of file imageformat.cpp.

References ImageFormat::mBandSet, ImageFormat::meterToLL(), and ImageFormat::xyToMeter().

Referenced by NlapsFrmt::fillImageInf(), NlapsFrmt::getLL(), and getLL().

Here is the call graph for this function:

void ImageFormat::xyToMeter ( int  iband,
double &  x,
double &  y 
) [protected, inherited]

void ImageFormat::meterToLL ( int  iband,
double &  x,
double &  y 
) [protected, inherited]

Definition at line 533 of file imageformat.cpp.

References ImageFormat::createProj(), and ImageFormat::mBandSet.

Referenced by ImageFormat::xyToLL().

Here is the call graph for this function:

void ImageFormat::llToMeter ( int  iband,
double &  lon,
double &  lat 
) [protected, inherited]

Definition at line 550 of file imageformat.cpp.

References ImageFormat::createProj(), and ImageFormat::mBandSet.

Referenced by ImageFormat::getULCorners(), and ImageFormat::llToXY().

Here is the call graph for this function:

void ImageFormat::llToXY ( int  iband,
double &  lon,
double &  lat 
) [protected, inherited]

Definition at line 568 of file imageformat.cpp.

References ImageFormat::llToMeter(), M_PI, and ImageFormat::mBandSet.

Referenced by NlapsFrmt::getXY(), and getXY().

Here is the call graph for this function:

projPJ ImageFormat::createProj ( int  iband  )  [protected, inherited]

void ImageFormat::getULCorners (  )  [protected, inherited]

Definition at line 663 of file imageformat.cpp.

References ImageFormat::llToMeter(), ImageFormat::mBandSet, ImageFormat::BandInf::proj, ImageFormat::BandInf::ulx, and ImageFormat::BandInf::uly.

Referenced by NlapsFrmt::fillBandInf(), and open().

Here is the call graph for this function:

std::vector< ImageFormat::BandInf > & ImageFormat::getBandInfSet (  )  [inherited]

unsigned int ImageFormat::getNumBands (  )  [inline, inherited]

Definition at line 123 of file imageformat.h.

Referenced by ImageInterface::getBands(), L7A_Nlaps::getFrmt(), and L7A_Fast::getFrmt().

const ImageFormat::BandInf & ImageFormat::getBandInf ( int  iband  )  [inherited]

Definition at line 24 of file imageformat.cpp.

References ImageFormat::mBandSet.

Referenced by L7A_Geotiff::open().

std::string ImageFormat::getName (  )  const [inherited]

Definition at line 28 of file imageformat.cpp.

References ImageFormat::mFName.

Referenced by getBandMetaData(), and Image::getName().

std::string ImageFormat::dtypeToString ( ImageFormat::DataType  dt  )  [static, inherited]

int ImageFormat::dtypeSize ( ImageFormat::DataType  dt  )  [static, inherited]

bool ImageFormat::isFloat ( ImageFormat::DataType  dt  )  [static, inherited]

char * ImageFormat::scaleData ( char **  orig,
int  ow,
int  oh,
int  nw,
int  nh,
DataType  dt,
ScaleType  st,
bool  del = true 
) const [inherited]

Definition at line 198 of file imageformat.cpp.

Referenced by NlapsFrmt::getBand(), getBand(), and InMemFormat::getMemRect().

char * ImageFormat::scaleData ( char **  orig,
int  ox,
int  oy,
int  ow,
int  oh,
int  fw,
int  fh,
int  nw,
int  nh,
DataType  dt,
ScaleType  st,
bool  del = true 
) const [inherited]

template<class DType>
DType * ImageFormat::scaleDT ( DType *  orig,
int  ox,
int  oy,
int  ow,
int  oh,
int  fw,
int  fh,
int  nw,
int  nh,
ScaleType  st 
) const [inline, inherited]

template<typename DType>
DType * ImageFormat::scl_nearestneighbor ( DType *  orig,
int  ox,
int  oy,
int  ow,
int  oh,
int  fw,
int  fh,
int  nw,
int  nh 
) const [inline, inherited]

Definition at line 354 of file imageformat.cpp.

Referenced by ImageFormat::scaleData().

template<class DType>
DType * ImageFormat::scl_bilinear ( DType *  orig,
int  ox,
int  oy,
int  ow,
int  oh,
int  fw,
int  fh,
int  nw,
int  nh 
) const [inline, inherited]

Definition at line 399 of file imageformat.cpp.

Referenced by ImageFormat::scaleData().

unsigned char * ImageFormat::scl_bicubic ( unsigned char *  orig,
int  ow,
int  oh,
int  nw,
int  nh,
int  szd 
) const [inherited]

Definition at line 454 of file imageformat.cpp.

ImageInf& ImageFormat::getImageInf (  )  [inline, inherited]

Definition at line 197 of file imageformat.h.

void ImageFormat::setCornerPnts ( int  iband,
ImageInf inf 
) [inherited]

Definition at line 463 of file imageformat.cpp.

References ImageFormat::getLL(), ImageFormat::mBandSet, ImageInf::mP1, ImageInf::mP2, ImageInf::mP3, ImageInf::mP4, Node::x, Node::y, and Node::z.

Here is the call graph for this function:


Member Data Documentation

int32 HdfEosFrmt::mSWfid [protected]

Definition at line 39 of file hdfeosfrmt.h.

Referenced by getBand(), getGeoFields(), open(), and ~HdfEosFrmt().

std::vector<DataField> HdfEosFrmt::mDFList [protected]

Definition at line 78 of file hdfeosfrmt.h.

Referenced by getBand(), getGeoFields(), getLL(), getXY(), and open().

std::vector<GeoField> HdfEosFrmt::mGFList [protected]

Definition at line 79 of file hdfeosfrmt.h.

Referenced by getGeoFields(), parseGeoFlds(), and ~HdfEosFrmt().

Definition at line 80 of file hdfeosfrmt.h.

std::string ImageFormat::mFName [protected, inherited]

std::vector<BandInf> ImageFormat::mBandSet [protected, inherited]

ImageInf ImageFormat::mImageInf [protected, inherited]


The documentation for this class was generated from the following files:

Home | Search | Disclaimers & Privacy | Contact Us
GLIMSView Maintainer: dsoltesz@usgs.gov