RAVE
Lib.rave Namespace Reference

Classes

class  RAVE
 

Functions

 addDataset (self, prefix='image', set=1, typecode='B', xsize=None, ysize=None, initval=None, **args)
 
 typecode (self, set=1)
 
 get (self, path)
 
 set (self, path, value)
 
 delete (self, path)
 
 getattribute (self, path, key)
 
 putattribute (self, path, value, typ)
 
 setattribute (self, path, key, value)
 
 eval (self, path=None)
 
 open (self, filename)
 
 read_metadata (self, filename)
 
 read_dataset (self, index=1)
 
 read_datasets (self, indices=None)
 
 set_fcp (self, userblock=0, sizes=(4, 4), sym_k=(1, 1), istore_k=1, meta_block_size=0)
 
 save (self, filename)
 
 asXML (self, filename=None)
 
 pureXML (self, filename, encoding=ENCODING)
 
 ql (self, index=0, pal=None)
 
 MakeExtentFromCorners (self)
 
 MakeCornersFromExtent (self)
 
 MakeCornersFromArea (self, areaid=None)
 
 transform (self, areaid, method=rave_transform.NEAREST, radius=None)
 
 open (filename=None)
 
 get_metadata (filename=None)
 
 get_metadataXML (filename=None)
 
 get_metadataRAVE (filename=None)
 

Variables

 radarid = i
 
 areaid = i
 
 sets = i
 
 typecode = i
 
 nodata = float(i)
 
 a = area.area(areaid)
 
 p = pcs.pcs(a.pcs)
 
str prefix = 'image'
 
 r = radar.radar(radarid)
 
 xsize
 
 ysize
 
dict data
 
 info = Element("h5rad", version=H5RAD_VERSION)
 
 _h5nodes = rave_IO.open(filename)
 
 _fcp = _pyhl.filecreationproperty()
 

Detailed Description

rave.py

Contains initialization functions for RAVE and fundamental class definitions,
along with methods for general product generation.

Function Documentation

◆ addDataset()

Lib.rave.addDataset ( self,
prefix = 'image',
set = 1,
typecode = 'B',
xsize = None,
ysize = None,
initval = None,
** args )
Adds a complete dataset to the object.
A new dataset Group is added to INFO and a new array is added to .data.

Arguments:

Returns: nothing, the new dataset is added to self.

◆ asXML()

Lib.rave.asXML ( self,
filename = None )
Outputs a metadata representation of a RAVE object to XML
with line breaks, either to file or to stdout.

Arguments:

Returns:

◆ delete()

Lib.rave.delete ( self,
path )
Deletes the infoset element specified by "path".

Arguments:
string path: The element to delete, given in the infoset format, ie.
             "/path/name".

Returns: Nothing if successful, otherwise a ValueError exception if
         the data type is invalid or the payload is illegal.

◆ eval()

Lib.rave.eval ( self,
path = None )
This is just a mapping to the same method in rave_info.INFO
Evaluates the attribute given by "path" and returns it as its proper
type.

Arguments:
  string path: the attribute's path. If this path doesn't exist in this
               INFO object, then an AttributeError exception is raised.

Returns: a Python int, float, string, or sequence, depending on
         the contents of the given attribute.

◆ get()

Lib.rave.get ( self,
path )
Get the contents of an infoset element. This method can be used to
get scalar attributes as well as dataset data.

Arguments:
  string path: the element to find. This is given in the infoset
               format "/path/name".

Returns: The value of the element, or None if the attribute is
         unavailable.

◆ get_metadata()

Lib.rave.get_metadata ( filename = None)
Same as the open() function, but only reads metadata.
Returns only INFO.
Much faster and more convenient for managing metadata.
This function calls rave_IO.get_metadata().

Arguments:
  string filename: file string

Returns: an INFO object

◆ get_metadataRAVE()

Lib.rave.get_metadataRAVE ( filename = None)
Like get_metadata(), but returns a RAVE object containing the metadata
and a complete list of _h5nodes.
Suitable for reading metadata first and then deciding later which datasets
to read.
This function calls rave_IO.get_metadataRAVE().

Arguments:
  string filename: file string

Returns: a RAVE object

◆ get_metadataXML()

Lib.rave.get_metadataXML ( filename = None)
Like get_metadata(), but returns the metadata as a single XML string.
Suitable for formatting metadata prior to communicating through a socket.
This function calls rave_IO.MetadataAsXML().

Arguments:
  string filename: file string

Returns: a Python string containing a pure XML representation of metadata.

◆ getattribute()

Lib.rave.getattribute ( self,
path,
key )
Gets the value of 'key' from Element 'path'.
Same as self.info.find(path).get(key)

Arguments:
  string path: the attribute's path
  string key: the attribute's key to query

Returns: the item of the key describing attribute 'path'

◆ MakeCornersFromExtent()

Lib.rave.MakeCornersFromExtent ( self)
Derives /where/LL_lon, LL_lat, UR_lon, and UR_right attributes
from /how/extent and /where/projdef

◆ MakeExtentFromCorners()

Lib.rave.MakeExtentFromCorners ( self)
Derives the four-tuple area extent for a given 2-D Cartesian
image. These four floats are expressed in surface (UCS) coordinates
according to the PROJ.4 library, and represent, in order, the
lower-left longitude, lower-left latitude, upper-right longitude,
and upper-right latitude coordinates. Specifically, these are the
lower-left corners of these pixels, ie. NOT the outer corner of the
upper-right pixel!

The /where/LL_lon, LL_lat, UR_lon, and UR_right attributes must
exist.

◆ open() [1/2]

Lib.rave.open ( filename = None)
Opens a file and returns its content as a RAVE object.
Files must be in a recognized format, and file content must be organized
according to a known information model.

Arguments:

Returns:

◆ open() [2/2]

Lib.rave.open ( self,
filename )
Opens a RAVE object from file.

Arguments:

Returns:

◆ pureXML()

Lib.rave.pureXML ( self,
filename,
encoding = ENCODING )
Outputs a metadata representation of a RAVE object to XML
without line breaks, either to file or to stdout.

Arguments:

Returns:

◆ putattribute()

Lib.rave.putattribute ( self,
path,
value,
typ )
This is just a mapping to the same method in rave_info.INFO
Changes the content of attribute "path" to contain "value" of type
"typ".

Arguments:
  string path: the attribute's path. If this path doesn't exist in this
               INFO object, then an AttributeError exception is raised.
  value: the thing to put, can be string, int, float, list, or tuple.
  string typ: option to explicitely specify the type attribute. Can be
              any of "string", "int", "float", or "sequence".

Returns: nothing. The attribute's value is simply replaced.

◆ ql()

Lib.rave.ql ( self,
index = 0,
pal = None )
QuickLook visualization of a dataset given by its index.

◆ read_dataset()

Lib.rave.read_dataset ( self,
index = 1 )
Reads dataset with the given index into the existing RAVE object.

Arguments:
  int index: the index of the dataset to read

Returns: nothing, the dataset is read into self.

◆ read_datasets()

Lib.rave.read_datasets ( self,
indices = None )
Reads datasets into self.

Arguments:
  list indices: optional list of indices of datasets to read.

Returns: nothing, the datasets are all read into self.

◆ read_metadata()

Lib.rave.read_metadata ( self,
filename )
Reads metadata from file and returns it in a properly-formatted RAVE
object.

Arguments:
  string filename: file string

Returns: a RAVE object with empty .data

◆ save()

Lib.rave.save ( self,
filename )
Writes the RAVE object to file.

Arguments:

Returns:

◆ set()

Lib.rave.set ( self,
path,
value )
Creates and sets the value of a new infoset element. 

Arguments:
  string path: This is given in the infoset format, ie. "/path/name".
               If the payload already exists, it will be modified with
               the new value. If not, it will be created. Groups are
               created automatically.

  value: The value to set. This must be an int, float, string, list
         of strings, or a numpy array.

Returns: Nothing if successful, a ValueError exception if the data
         type is invalid or the payload is illegal.

◆ set_fcp()

Lib.rave.set_fcp ( self,
userblock = 0,
sizes = (4,4),
sym_k = (1,1),
istore_k = 1,
meta_block_size = 0 )
Optimizes default HDF5 file-creation properties when writing new files.

Arguments:
  int userblock:
  tuple of two ints sizes:
  tuple of two ints sym_k:
  int istore_k:
  int meta_block_size:

Returns: nothing, a _pyhl.filecreationproperty() is initialized
         to self._fcp

◆ setattribute()

Lib.rave.setattribute ( self,
path,
key,
value )
Sets the Element (at 'path') attribute 'key' to 'value'.
Same as self.info.find(path).set(key, value)

Arguments:
    string path: path to Element
    string key: key of Element's attribute
    string value: item to be the value of this Element's attribute
    
Returns: nothing, the Element's attribute is set.

◆ transform()

Lib.rave.transform ( self,
areaid,
method = rave_transform.NEAREST,
radius = None )
Simple wrapper to rave_transform.transform() for
cartesian-to-cartesian transformation.

◆ typecode()

Lib.rave.typecode ( self,
set = 1 )
Returns the typecode of the dataset given by "set".

Argument:
  int set: the dataset

Returns: the tyecode string returned by array.typecode()