NAME
Weather::GHCN::App::Fetch - Fetch station and weather data from the NOAA GHCN repository
VERSION
version v0.0.011
SYNOPSIS
use Weather::GHCN::App::Fetch;
Weather::GHCN::App::Fetch->run( \@ARGV );
See ghcn_fetch -help for details.
SUBROUTINES
run ( \@ARGV, stdin => 0 )
Invoke this subroutine, passing in a reference to @ARGV, in order to fetch NOAA GHCN station data or daily weather data.
See ghnc_fetch.pl -help for details.
Stations are filtered by various options, such as -country and -location. But Fetch->run can also receive a list of station id's via a pipe or a file. To enable this feature, set the stdin parameter to 1 (true).
When calling Fetch->run inside a test script, it's usually best to leave this option disabled as some test harnesses may fool the algorithm used to detect stdin from a file or pipe. This can be done by omitting the stdin => <bool> parameter, or setting it to false.
get_user_options ( $optfile=undef )
Fetch.pm uses get_user_options() to either get user options via Tk::GetOptions -- if it is installed -- or via Getopt::Long.
get_user_options_no_tk ( $optfile=undef )
This function obtains user options from @ARGV by calling Getopt::Long GetOptions using a list of option definitions obtained by calling Weather::GHCN::Options-get_getopt_list()>. The options (and their values) are extracted from @ARGV and put in a hash, a reference to which is then returned.
This function is called when the GUI is not being used. The $optfile argument, if provided, is assumed to be a file saved from a GUI invocation and will be eval'd and used as the options list.
get_user_options_tk ( $optfile=undef )
This function returns a reference to a hash of user options obtained by calling Tk::Getopt. This may launch a GUI dialog to collect the options.
The optional $optfile argument specifies a filename which Tk::GetOptions can use to store or load options.
AUTHOR
Gary Puckering (jgpuckering@rogers.com)
LICENSE AND COPYRIGHT
Copyright 2022, Gary Puckering