HWRF  trunk@4391
Public Member Functions | Properties | List of all members
hwrf.regrib.GRIBSubsetter Class Reference

A GRIBBase that subsets GRIB files, keeping only certain parameters. More...

Detailed Description

A GRIBBase that subsets GRIB files, keeping only certain parameters.

Definition at line 1366 of file regrib.py.

Inheritance diagram for hwrf.regrib.GRIBSubsetter:
hwrf.regrib.GRIBBase hwrf.regrib.GRIBSubsetterFetcher

Public Member Functions

def __init__
 GRIBSubsetter constructor. More...
 
def is_ready (self, args, kwargs)
 Returns True. More...
 
def input_valid (self, kwargs)
 Returns True. More...
 
def make (self, args, kwargs)
 Returns self. More...
 
def getsubsetname (self)
 Returns a name of this subset for use in filenames. More...
 
def getgrib1sub (self)
 Returns an iterator that takes as its only argument an array of lines of wgrib -s output. More...
 
def getgrib2sub (self)
 This is a placeholder for future GRIB2 subsetting support. More...
 
- Public Member Functions inherited from hwrf.regrib.GRIBBase
def is_ready (self, args, kwargs)
 Returns True if this object and its subobjects are all ready for a call to make, and False otherwise. More...
 
def input_valid (self, kwargs)
 Returns True if the specified kwargs are valid and False otherwise. More...
 
def make (self, regrib, kwargs)
 Runs the action this object should perform and returns another GRIBBase object. More...
 

Properties

 subsetname
 Read-only property: the name of the subset. More...
 
 grib1sub
 Read-only property: a callable object that chooses the fields to keep and their order. More...
 
 grib2sub
 Unused: the grib2 subsetter. More...
 

Constructor & Destructor Documentation

def hwrf.regrib.GRIBSubsetter.__init__ (   self,
  subsetname,
  grib1sub = None,
  grib2sub = None 
)

GRIBSubsetter constructor.

Creates a GRIBSubsetter with a given name, a callable object grib1sub that will be sent to produtil.gribop.grib1subset, and an unused grib2sub that will be used for GRIB2 subsetting one day.

Parameters
grib1subCallable object that iterates over wgrib -s output and yields only fields that should be kept, potentially in a new order.
grib2subUnsupported: GRIB2 subsetter.
subsetnameThe subsetname is mandatory and will be used to generate temporary filenames.

Definition at line 1368 of file regrib.py.

Member Function Documentation

def hwrf.regrib.GRIBSubsetter.getgrib1sub (   self)

Returns an iterator that takes as its only argument an array of lines of wgrib -s output.

Definition at line 1402 of file regrib.py.

def hwrf.regrib.GRIBSubsetter.getgrib2sub (   self)

This is a placeholder for future GRIB2 subsetting support.

Definition at line 1406 of file regrib.py.

def hwrf.regrib.GRIBSubsetter.getsubsetname (   self)

Returns a name of this subset for use in filenames.

Definition at line 1399 of file regrib.py.

def hwrf.regrib.GRIBSubsetter.input_valid (   self,
  kwargs 
)

Returns True.

The subsetter's product (itself) does not vary with the kwargs, so any input is valid.

Parameters
kwargsIgnored, but used by subclasses.

Definition at line 1390 of file regrib.py.

def hwrf.regrib.GRIBSubsetter.is_ready (   self,
  args,
  kwargs 
)

Returns True.

The subsetter is its own product, so it is always "ready."

Parameters
args,kwargsIgnored, but used by subclasses.

Definition at line 1385 of file regrib.py.

def hwrf.regrib.GRIBSubsetter.make (   self,
  args,
  kwargs 
)

Returns self.

The subsetter is its own product.

Parameters
args,kwargsIgnored, but used by subclasses.

Definition at line 1395 of file regrib.py.

Property Documentation

hwrf.regrib.GRIBSubsetter.grib1sub
static
Initial value:
1 = property(getgrib1sub,None,None,
2  )

Read-only property: a callable object that chooses the fields to keep and their order.

Definition at line 1420 of file regrib.py.

hwrf.regrib.GRIBSubsetter.grib2sub
static
Initial value:
1 = property(getgrib2sub,None,None,
2  )

Unused: the grib2 subsetter.

Definition at line 1426 of file regrib.py.

hwrf.regrib.GRIBSubsetter.subsetname
static
Initial value:
1 = property(getsubsetname,None,None,
2  )

Read-only property: the name of the subset.

Definition at line 1413 of file regrib.py.


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