Loading...
Searching...
No Matches
Public Member Functions | List of all members
CmdSelectQuantity Class Reference

Tool for selecting data for next command(s), based on paths, quantities and elevations. More...

Inheritance diagram for CmdSelectQuantity:
Inheritance graph
[legend]
Collaboration diagram for CmdSelectQuantity:
Collaboration graph
[legend]

Public Member Functions

void exec () const override
 Run the command with current parameter values.
 
- Public Member Functions inherited from SimpleCommand< std::string >
 SimpleCommand (const std::string &name, const std::string &description, const std::string &key="value", const std::string &initValue=std::string(), const std::string &unit="")
 Constructor.
 
 SimpleCommand (const std::string &name, const std::string &description, const std::string &key, std::initializer_list< S > l, const std::string &unit="")
 Constuctor designer for SimpleCommand<Unituple<> > .
 
 SimpleCommand (const SimpleCommand &cmd)
 Copy constructor.
 
- Public Member Functions inherited from BasicCommand
 BasicCommand (const std::string &name, const std::string &description)
 Constructor.
 
 BasicCommand (const BasicCommand &cmd)
 Copy constructor.
 
- Public Member Functions inherited from BeanCommand< BeanLike >
 BeanCommand (const std::string &name, const std::string &description)
 Constructor.
 
 BeanCommand (const BeanCommand &cmd)
 Copy constructor.
 
 BeanCommand (BeanLike &b)
 Constructor wrapping an existing bean.
 
virtual const bean_t & getBean () const
 Returns the wrapped bean.
 
virtual bean_t & getBean ()
 Returns the wrapped bean.
 
const std::string & getName () const final
 Returns the command name.
 
const std::string & getDescription () const final
 Returns the command description.
 
virtual const drain::ReferenceMap & getParameters () const
 Returns the command parameters.
 
- Public Member Functions inherited from Command
 Command (const Command &cmd)
 Copy constructor.
 
virtual void setParameters (const std::string &args) final
 
template<class T >
void setParameters (const T &args)
 Sets parameters from argument.
 
template<class T >
void setParameter (const std::string &key, const T &value)
 Set a value to a single parameter.
 
bool hasParameters () const
 Returns true if this command has parameters.
 
virtual void run (const std::string &params="") final
 Description of result, comparable to a return type of a function. ?
 
virtual void update ()
 Optional method for preparing command to execution.
 
Command & addSection (int i)
 Marks this command as belonging to section i.
 
const std::string & getLastParameters () const
 Returns the parameters from the last execution.
 
virtual void getRelatedCommands (std::ostream &ostr=std::cout) const
 Writes related command names to stream.
 
void linkRelated (const std::string &cmdKey) const
 Add related command(s), to appear in help after "See-also:" phrase.
 
virtual void parametersToStream (std::ostream &ostr, const std::string &indent=" ") const
 By default, the "true", technical parameters.
 
virtual void parameterKeysToStream (std::ostream &ostr) const
 Writes parameter keys to stream.
 
void parameterKeysToStream (std::ostream &ostr, const std::list< std::string > &list, char sep=',') const
 Writes parameter keys to stream.
 
- Public Member Functions inherited from Contextual
 Contextual ()
 Sets internal contextPtr to NULL.
 
 Contextual (const Contextual &src)
 Copies base context (even null) of the source. Notice that the actual instance may be of derived class.
 
 Contextual (Context &ctx)
 Copies internal contextPtr.
 
template<class C >
void setContext ()
 Sets internal contextPtr to the static source.
 
void setExternalContext (Context &ctx)
 Sets internal contextPtr to outside target.
 
bool contextIsSet () const
 True, if contextPtr has been set.
 
template<class T = Context>
T & getContext () const
 If context has been set, returns it through a cast to base class Context.
 

Additional Inherited Members

- Public Types inherited from BeanCommand< BeanLike >
typedef BeanLike bean_t
 The bean type.
 
- Public Types inherited from Command
typedef int cmd_section_type
 
- Static Public Member Functions inherited from Contextual
template<class T >
static Cloner< Context, T > & getCloner ()
 Returns the object cloner.
 
- Public Attributes inherited from SimpleCommand< std::string >
std::string value
 
- Public Attributes inherited from BeanCommand< BeanLike >
BeanLike bean
 The wrapped bean instance.
 
- Public Attributes inherited from Command
cmd_section_type section = 1
 Section bitmask; zero means hidden from help.
 
- Static Public Attributes inherited from Command
static const SprinterLayout cmdArgLayout = {",", "?", "=", ""}
 Layout flag for command argument handling.
 
- Protected Member Functions inherited from BeanCommand< BeanLike >
virtual drain::ReferenceMap & getParameters () final
 
- Protected Attributes inherited from Command
std::set< std::string > relatedCommands
 Set of related command keys shown in help.
 
std::string lastParameters
 String record of the last argument(s) passed.
 
- Protected Attributes inherited from Contextual
Context * contextPtr
 Pointer to the current context; nullptr if not set.
 

Detailed Description

Tool for selecting data for next command(s), based on paths, quantities and elevations.

Most commands apply implicit input data selection criteria, typically involving data paths, quantities and/or elevation angles.

Like in general in Rack, the parameters of --select are positional (ordered), meaning that they can be issued as a comma-separated string without explicit names (keywords), as long as they are given in order. The parameters are:

The selection functionality is best explained with examples.

# For a Pseudo CAPPI product, change default input selection
rack volume.h5 --select 'quantity=^TH$,elangle=1.5:10,count=3' --pCappi 1500 -o pCappi-TH-1500m.h5
# For image output, select DBZH
rack volume.h5 --select elangle=1.5,quantity=DBZH -o volume-DBZH.png
# For image output, select VRAD of the lowest dual-PRF scan
rack volume.h5 --select quantity=VRAD:VRADH,order=ELANGLE:MIN,prf=DOUBLE -o volume-VRAD.png
# For image output, select ZDR of the highest single-PRF scan
rack volume.h5 --select quantity=ZDR,count=1,order=ELANGLE:MAX,prf=SINGLE -o volume-ZDR.png
# For single-image output, select DBZH of the lowest scan (from 90 6.5 2.4 1.8 1.2 0.59)
rack volume.h5 --select quantity=DBZH,order=ELANGLE:MIN -o volume-DBZH2.png
# For single-image output, select dBZ - preferably total dBZ - of the highest scan (from 90 6.5 2.4 1.8 1.2 0.59)
rack volume.h5 --select quantity=TH:TV:T:DBZH:DBZ,order=ELANGLE:MAX -o volume-DBZH3.png
A map of radar data, indexed by quantity code (DBZH, VRAD, etc).
Definition Data.h:1293
Definition AltitudeOp.cpp:42

Note that escaping special characters like '|' is often required on command line.

Often, the first data array matching the criteria are used.

One can explicitly change the criteria with --select (-s) command . For example, in data conversions one may wish to focus on certain quantity – like DBZH or VRAD – not all the data.

The selection command can be applied the most commands processing data. In computing meteorological products (Product generation) an compositing, it affects the following product only. In case of anomaly detectors (Anomaly Detection and Removal (AnDRe)), it applies to all subsequent operators.

Note that some processing commands may not support explicit data selection. Set selection criteria strictly to one quantity . Selecting quantities only is frequently needed, so there is a dedicated command --selectQuantity (-Q ) which accepts comma-separated simple patterns (with * and ?) instead of regular expressions. For example, -Q DBZH*,QIND is equal to --select quantity='^(DBZH.*|QIND)$' .

Member Function Documentation

◆ exec()

void exec ( ) const
inlineoverridevirtual

Run the command with current parameter values.

Reimplemented from Command.


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