The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Weather::GHCN::Measures - provide a list of meteorological metrics to be obtained from GHCN daily data

VERSION

version v0.0.011

SYNOPSIS

  use Weather::GHCN::Measures;

  my $opt_href => {
    location => 'New York',
    country => 'US',
  };

  my $mobj = Weather::GHCN::Measures->new( $opt_href );

  say join ' ', $mobj->measures->@*;

  if ( 'TMAX' =~ $mobj->re ) {
      say 'TMAX is available';
  }

DESCRIPTION

The Weather::GHCN::Measures module provides a class that is used to encapsulate the set of meteorological measures that the GHCN module consumer wants to obtain from NOAA GHCN data. By default, the object returned by instantiating this class will include TMAX (maximum daily temperature) and TMIN (minimum daily temperature) as required metrics. It will also include Tavg, which is derived by averaging TMAX and TMIN.

To include other metrics, notably TAVG (which is computed by the weather station instrumentation), and precipitation metrics (PRCP, SNOW and SNWD) see the new() method documentation.

The module is primarily for use by module Weather::GHCN::StationTable.

METHODS

new( [$opt_href] )

Create a new Measures object.

Other GHCN modules will use the measures determined by instantiating this object to get those data measurements from the GHCN daily data.

The optional argument passed to new() is expected to be a reference to a hash which contains kw/value pairs such as would be gathered by the consumer of GHCN modules when it calls Getopt::Long with an options list that includes:

    qw( tavg precip anomalies )

If the key 'tavg' is present and has a true value, then the TAVG measure is included.

If the key 'precip' is present and has a true value, then the PRCP, SNOW and SNWD (Snow Days) measures are included.

If the key 'anomalies' is found and has a true values, then additional columns are added in order to provide a place for temperature anomalies to be report.

FIELD ACCESSORS

measures

Returns a list of the measures applicable to the options provided in the constructor.

re

Returns a regular expression object that can be used to validate measure names by pattern matching. Any measure name matching this re is valid for the options given in the object constructor.

new( $opt_href )

Creates a new Measures object, using the options in the argument, which must be a Weather::GHCN::Options object.

DOES

Defined by Object::Pad. Included for POD::Coverage.

META

Defined by Object::Pad. Included for POD::Coverage.

AUTHOR

Gary Puckering (jgpuckering@rogers.com)

LICENSE AND COPYRIGHT

Copyright 2022, Gary Puckering