code::AwipsNetcdfEncoder Class Reference

Inheritance diagram for code::AwipsNetcdfEncoder:

code::NetcdfEncoder code::Algorithm List of all members.

Detailed Description

AwipsNetcdfEncoder will write lat-lon grids out in a format that the Awips Volume Browser will understand.

For all other products, it simply inherits the NetcdfEncoder functionality, although the file names will be similar to stuff in AWIPS.

Author:
Lakshman
Version:
Id
code_AwipsNetcdfEncoder.h,v 1.3 2009/06/02 20:17:37 lakshman Exp


Public Member Functions

virtual ~AwipsNetcdfEncoder ()
 AwipsNetcdfEncoder (const std::string &dir_name, bool gz_compress, bool use_subdirs)
 Will create an encoder that will write files into the directory specified.
virtual void process (LatLonGrid &latlon_grid)
 Write out this LatLonGrid.
void setDefaultSubType (const std::string &subtype)
 set the sub-type to be used for all products by this netcdf encoder.
void removeDefaultSubType ()
 don't use a default subtype.
bool success () const
 Was the last process() method using this object successful?
const std::string & getLastFile () const
 The last successfully opened file name (usually contains data).
void setMissingDataValue (float newValue)
 Normally, MISSING_DATA is Constants::MISSING_DATA, but you can change it to any other number using this number.
void setRangeFoldedValue (float newValue)
 Normally, RANGE_FOLDED is RANGE_FOLDED::MISSING_DATA, but you can change it to any other number using this number.
Index::Record getLastRecord () const
 Returns a record suitable for adding to an Index, for notification.
std::vector< std::string > & lastSelections ()
 Returns the selections of the last file, Modify these selections if necessary.
virtual void process (RadialSet &radialSet)
 Write out this RadialSet.
virtual void process (PolarGrid &)
 Write out this PolarGrid (written out as a RadialSet netcdf file, so that reading it back will get you a RadialSet).
virtual void process (LatLonHeightGrid &latlonht_grid)
 Write out this LatLonHeightGrid.
virtual void process (CartesianGrid2D &grid2d)
 Write out this Cartesain2D.
virtual void process (CartesianGrid3D &grid3d)
 Write out this Cartesain2D.
virtual void process (ContourData &contours)
 Write out this contour data.
virtual void process (WindFieldStruct< LatLonGrid > &llgrid)
 Write out this WindFieldStruct (WindField) data.
virtual void process (WindFieldStruct< CartesianGrid2D > &llgrid)
 Write out this WindFieldStruct (WindField) data.
virtual void process (AlgTrackStruct &)
 Default to process( BasicIcon& ) if the Algorithm subclass doesn't override this method.
virtual void process (BasicIcon &)
 Process any BasicIcon.
virtual void process (BwerIconStruct &)
 Default to process( BasicIcon& ) if the Algorithm subclass doesn't override this method.
virtual void process (DataTable &)
virtual void process (DataType &)
 Process the abstract base class DataType itself.
virtual void process (ElevationVolume &)
 Process a whole elevation volume scan.
virtual void process (IconSet &)
virtual void process (Table &)
virtual void process (HailTrendEvent &, SpaceTimeRef &)
virtual void process (DEM &)
 Process a Digital Elevation Map (DEM).
virtual void process (LtgoIconStruct &)
 Default to process( BasicIcon& ) if the Algorithm subclass doesn't override this method.
virtual void process (MesoIconStruct &)
 Default to process( BasicIcon& ) if the Algorithm subclass doesn't override this method.
virtual void process (MesoTrendEvent &, SpaceTimeRef &)
virtual void process (SingleContourData &)
virtual void process (Radial &)
 Process a single radial.
virtual void process (ScitTrendEvent &, SpaceTimeRef &)
virtual void process (TornTrendEvent &, SpaceTimeRef &)
virtual void process (FieldArrowStruct &)
 Deppreciated.
void reset ()
 If a data-type that can not be handled by the NetcdfEncoder is passed, then you will keep getting the previous datatype that did get written out, so to avoid this behavioir, call reset() before calling invoke() on the DataType.
virtual void processVolume (Volume &)
 Process a generic volume (Deal with a volume on an abstract level.

Static Public Member Functions

static void setCDMComplianceFlag (bool flag)
 Write out CDM-compliant netcdf grids? By default, false.
static bool getCDMComplianceFlag ()
static void setFAAComplianceFlag (bool flag)
 Write out FAA-compliant netcdf grids? By default, false.
static bool getFAAComplianceFlag ()
static std::string getTimeStamp (const Time &tm)
 Returns the time string format of the selections corresponding to the time passed in.

Protected Member Functions

virtual char getSeparatorBetweenDataTypeAndSubtype () const
 How should we separate the data type and the subtype?
virtual std::string getSuffix () const
virtual std::string getFormatName () const
virtual std::string getTimePartOfFileName (const code::Time &t) const
virtual char getSeparatorToTimeString () const
SmartPtr< NetcdfFilegetNetcdfFile (const Time &tm, const std::string &dataType, const std::string &subtype)
 Obtain the NetcdfFile given the arguments that go into the file name.
virtual std::string getSubtype (RadialSet &)
 By default, returns the elevation angle in degrees formatted as "00.50" for example.
virtual std::string getSubtype (PolarGrid &)
 By default, returns the elevation angle in degrees formatted as "00.50" for example.
virtual std::string getSubtype (CartesianGrid2D &)
 By default, returns the height in meters formatted as "1234.5" for example.
virtual std::string getSubtype (LatLonGrid &latlon_grid)
 By default, returns the height in meters formatted as "0234.5" for example.
virtual std::string getSubtype (LatLonHeightGrid &latlonht_grid)
 By default, returns an empty string.
virtual std::string getSubtype (CartesianGrid3D &grid3d)
 By default, returns an empty string.
virtual std::string getSubtype (WindFieldStruct< LatLonGrid > &)
 By default, returns an empty string.
virtual std::string getSubtype (WindFieldStruct< CartesianGrid2D > &)
 By default, returns an empty string.
virtual std::string getSubtype (ContourData &contours)
 by default returns an empty string
void addGlobalAttr (NetcdfFile &ncfile, const DataType &dt, const std::string &encoded_type)
void notifySuccess ()
 Stuff to do after a successful write.


Constructor & Destructor Documentation

virtual code::AwipsNetcdfEncoder::~AwipsNetcdfEncoder (  )  [inline, virtual]

code::AwipsNetcdfEncoder::AwipsNetcdfEncoder ( const std::string &  dir_name,
bool  gz_compress,
bool  use_subdirs 
)

Will create an encoder that will write files into the directory specified.

These will follow the AWIPS specifications of subdirectory and file name. Any existing files of the appropriate name will be replaced.

Parameters:
dir_name Local directory to write in.
gz_compress Whether we should compress the netcdf file.
whether the files should be organized into subdirectories.


Member Function Documentation

void code::NetcdfEncoder::addGlobalAttr ( NetcdfFile ncfile,
const DataType dt,
const std::string &  encoded_type 
) [protected, inherited]

static bool code::NetcdfEncoder::getCDMComplianceFlag (  )  [inline, static, inherited]

static bool code::NetcdfEncoder::getFAAComplianceFlag (  )  [inline, static, inherited]

virtual std::string code::AwipsNetcdfEncoder::getFormatName (  )  const [inline, protected, virtual]

Reimplemented from code::NetcdfEncoder.

const std::string& code::NetcdfEncoder::getLastFile (  )  const [inline, inherited]

The last successfully opened file name (usually contains data).

Empty if this encoder hasn't been used yet.

Index::Record code::NetcdfEncoder::getLastRecord (  )  const [inherited]

Returns a record suitable for adding to an Index, for notification.

Call this method after calling process() to write out the file.

Returns:
invalid record if the previous process() call was unsuccessful.
See also:
setNotificationLB()

SmartPtr< NetcdfFile > code::NetcdfEncoder::getNetcdfFile ( const Time tm,
const std::string &  dataType,
const std::string &  subtype 
) [protected, inherited]

Obtain the NetcdfFile given the arguments that go into the file name.

Parameters:
tm The time part of the space-time-ref for this data type
dataType The dataType specificier
subtype (optional) information such as the elevation scan that differentiates different versions of this data type that have the same nominal time. Pass in an empty string to avoid specifying a subtype.

virtual char code::AwipsNetcdfEncoder::getSeparatorBetweenDataTypeAndSubtype (  )  const [inline, protected, virtual]

How should we separate the data type and the subtype?

Reimplemented from code::NetcdfEncoder.

virtual char code::NetcdfEncoder::getSeparatorToTimeString (  )  const [inline, protected, virtual, inherited]

virtual std::string code::NetcdfEncoder::getSubtype ( ContourData contours  )  [protected, virtual, inherited]

by default returns an empty string

virtual std::string code::NetcdfEncoder::getSubtype ( WindFieldStruct< CartesianGrid2D > &   )  [protected, virtual, inherited]

By default, returns an empty string.

virtual std::string code::NetcdfEncoder::getSubtype ( WindFieldStruct< LatLonGrid > &   )  [protected, virtual, inherited]

By default, returns an empty string.

virtual std::string code::NetcdfEncoder::getSubtype ( CartesianGrid3D grid3d  )  [protected, virtual, inherited]

By default, returns an empty string.

virtual std::string code::NetcdfEncoder::getSubtype ( LatLonHeightGrid latlonht_grid  )  [protected, virtual, inherited]

By default, returns an empty string.

virtual std::string code::NetcdfEncoder::getSubtype ( LatLonGrid latlon_grid  )  [protected, virtual, inherited]

By default, returns the height in meters formatted as "0234.5" for example.

virtual std::string code::NetcdfEncoder::getSubtype ( CartesianGrid2D  )  [protected, virtual, inherited]

By default, returns the height in meters formatted as "1234.5" for example.

virtual std::string code::NetcdfEncoder::getSubtype ( PolarGrid  )  [protected, virtual, inherited]

By default, returns the elevation angle in degrees formatted as "00.50" for example.

virtual std::string code::NetcdfEncoder::getSubtype ( RadialSet  )  [protected, virtual, inherited]

By default, returns the elevation angle in degrees formatted as "00.50" for example.

virtual std::string code::AwipsNetcdfEncoder::getSuffix (  )  const [inline, protected, virtual]

Reimplemented from code::NetcdfEncoder.

virtual std::string code::AwipsNetcdfEncoder::getTimePartOfFileName ( const code::Time t  )  const [protected, virtual]

Reimplemented from code::NetcdfEncoder.

static std::string code::NetcdfEncoder::getTimeStamp ( const Time tm  )  [static, inherited]

Returns the time string format of the selections corresponding to the time passed in.

This is useful to add other records to a netcdf index.

We don't use CalendarDate::getStringForFilename because external algorithms (like dualpol) depend on this format

std::vector< std::string >& code::NetcdfEncoder::lastSelections (  )  [inline, inherited]

Returns the selections of the last file, Modify these selections if necessary.

If unmodified, these selections are:

  1. dt.getTime()
  2. dt.getTypeName()
  3. place in volume if any ( dt.getElevation() for RadialSet, dt.getHeight() for CartesianGrid2D )
where dt was the last data type processed.

void code::NetcdfEncoder::notifySuccess (  )  [protected, inherited]

Stuff to do after a successful write.

virtual void code::Algorithm::process ( FieldArrowStruct  )  [virtual, inherited]

Deppreciated.

virtual void code::Algorithm::process ( TornTrendEvent &  ,
SpaceTimeRef  
) [virtual, inherited]

virtual void code::Algorithm::process ( ScitTrendEvent &  ,
SpaceTimeRef  
) [virtual, inherited]

virtual void code::Algorithm::process ( Radial  )  [virtual, inherited]

Process a single radial.

virtual void code::Algorithm::process ( SingleContourData  )  [virtual, inherited]

virtual void code::Algorithm::process ( MesoTrendEvent &  ,
SpaceTimeRef  
) [virtual, inherited]

virtual void code::Algorithm::process ( MesoIconStruct  )  [virtual, inherited]

Default to process( BasicIcon& ) if the Algorithm subclass doesn't override this method.

virtual void code::Algorithm::process ( LtgoIconStruct  )  [virtual, inherited]

Default to process( BasicIcon& ) if the Algorithm subclass doesn't override this method.

virtual void code::Algorithm::process ( DEM  )  [virtual, inherited]

Process a Digital Elevation Map (DEM).

Default is to process as a regular LatLonGrid.

virtual void code::Algorithm::process ( HailTrendEvent &  ,
SpaceTimeRef  
) [virtual, inherited]

virtual void code::Algorithm::process ( Table &   )  [virtual, inherited]

virtual void code::Algorithm::process ( IconSet &   )  [virtual, inherited]

virtual void code::Algorithm::process ( ElevationVolume  )  [virtual, inherited]

Process a whole elevation volume scan.

Reimplemented in code::CrossSection.

virtual void code::Algorithm::process ( DataType  )  [virtual, inherited]

Process the abstract base class DataType itself.

virtual void code::Algorithm::process ( DataTable  )  [virtual, inherited]

Reimplemented in code::XMLEncoder.

virtual void code::Algorithm::process ( BwerIconStruct  )  [virtual, inherited]

Default to process( BasicIcon& ) if the Algorithm subclass doesn't override this method.

virtual void code::Algorithm::process ( BasicIcon  )  [virtual, inherited]

Process any BasicIcon.

All BasicIcons will default to this if the algorithm in question doesn't implement the particular DataType.

virtual void code::Algorithm::process ( AlgTrackStruct  )  [virtual, inherited]

Default to process( BasicIcon& ) if the Algorithm subclass doesn't override this method.

virtual void code::NetcdfEncoder::process ( WindFieldStruct< CartesianGrid2D > &  llgrid  )  [virtual, inherited]

Write out this WindFieldStruct (WindField) data.

Reimplemented from code::Algorithm.

virtual void code::NetcdfEncoder::process ( WindFieldStruct< LatLonGrid > &  llgrid  )  [virtual, inherited]

Write out this WindFieldStruct (WindField) data.

Reimplemented from code::Algorithm.

virtual void code::NetcdfEncoder::process ( ContourData contours  )  [virtual, inherited]

Write out this contour data.

Reimplemented from code::Algorithm.

virtual void code::NetcdfEncoder::process ( CartesianGrid3D grid3d  )  [virtual, inherited]

Write out this Cartesain2D.

Reimplemented from code::Algorithm.

virtual void code::NetcdfEncoder::process ( CartesianGrid2D grid2d  )  [virtual, inherited]

Write out this Cartesain2D.

Reimplemented from code::Algorithm.

virtual void code::NetcdfEncoder::process ( LatLonHeightGrid latlonht_grid  )  [virtual, inherited]

Write out this LatLonHeightGrid.

Reimplemented from code::Algorithm.

virtual void code::NetcdfEncoder::process ( PolarGrid  )  [virtual, inherited]

Write out this PolarGrid (written out as a RadialSet netcdf file, so that reading it back will get you a RadialSet).

Reimplemented from code::Algorithm.

virtual void code::NetcdfEncoder::process ( RadialSet radialSet  )  [virtual, inherited]

Write out this RadialSet.

Reimplemented from code::Algorithm.

virtual void code::AwipsNetcdfEncoder::process ( LatLonGrid latlon_grid  )  [virtual]

Write out this LatLonGrid.

Reimplemented from code::NetcdfEncoder.

virtual void code::Algorithm::processVolume ( Volume  )  [virtual, inherited]

Process a generic volume (Deal with a volume on an abstract level.

Current volumes are ElevationVolume and LatLonHeightGrid

void code::NetcdfEncoder::removeDefaultSubType (  )  [inline, inherited]

don't use a default subtype.

Instead, get a subtype using the type of the product (elevation angle for radial sets, for example). This is the default.

void code::NetcdfEncoder::reset (  )  [inline, inherited]

If a data-type that can not be handled by the NetcdfEncoder is passed, then you will keep getting the previous datatype that did get written out, so to avoid this behavioir, call reset() before calling invoke() on the DataType.

static void code::NetcdfEncoder::setCDMComplianceFlag ( bool  flag  )  [inline, static, inherited]

Write out CDM-compliant netcdf grids? By default, false.

void code::NetcdfEncoder::setDefaultSubType ( const std::string &  subtype  )  [inline, inherited]

set the sub-type to be used for all products by this netcdf encoder.

If a sub-class over-rides getSubtype, however, it also over-rides the default sub-type.

static void code::NetcdfEncoder::setFAAComplianceFlag ( bool  flag  )  [inline, static, inherited]

Write out FAA-compliant netcdf grids? By default, false.

void code::NetcdfEncoder::setMissingDataValue ( float  newValue  )  [inherited]

Normally, MISSING_DATA is Constants::MISSING_DATA, but you can change it to any other number using this number.

void code::NetcdfEncoder::setRangeFoldedValue ( float  newValue  )  [inherited]

Normally, RANGE_FOLDED is RANGE_FOLDED::MISSING_DATA, but you can change it to any other number using this number.

bool code::NetcdfEncoder::success (  )  const [inline, inherited]

Was the last process() method using this object successful?


Generated on Fri May 4 13:40:12 2012 for WDSS-IIw2 by  doxygen 1.4.7