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

NAME

Geomag::Kyoto::Dst - Obtain and parse Kyoto WDC near real time DST values

SYNOPSIS

  use Geomag::Kyoto::Dst;
  blah blah blah

DESCRIPTION

A module to parse the near real time Dst measurements made available by the Kyoto World Data Center for Geomagnetism.

METHODS

new()

 $dst = Geomag::Kyoto::Dst->new();

Obtain this month's and last month's Dst values from the default url.

 $dst = Geomag::Kyoto::Dst->new(file => $filename);

Parse the values directly from $filename.

 $dst = Geomag::Kyoto::Dst->new(file => [@filenames]);

Parse the values from a collection of files.

 $dst = Geomag::Kyoto::Dst->new(url => $url);

Obtain the values from the page at $url.

 $dst = Geomag::Kyoto::Dst->new(base => $base, files => [@files]);

Obtain the values from a collection of files over the web at $base.

Returns a new Geomag::Kyoto::Dst object, or dies if errors occur (eg. file not found).

get_array()

Returns all predictions as a 2d array:

 my $aref = $dst->get_array();
 
 $time    = $aref->[0][0]
 $dst_val = $aref->[0][1]

Values will be sorted by time, with the earliest entry first. Time will be in epoch seconds. Optionally specify a start and/or end time to limit the range of values returned:

 $aref = $dst->get_array(start => $start_time, end => $end_time);

with the times in epoch seconds.

get_hash()

 my $href = $dst->get_hash();

 while (my($time, $val) = each %$href) {
    ...
 }

Returns all values as a hash.

Optionally specify either a start or end time with:

 $href = $dst->get_hash(start => $start_time, end => $end_time);

May return a reference to an internal copy of the data, so make a copy before directly modifying any of the values.

DEFAULT URL

The default base url for obtaining near real time Dst values is:

 http://swdcdb.kugi.kyoto-u.ac.jp/dstdir/dst1/q/

The default files fetched are:

 Dstqthism.html
 Dstqlastm.html

AUTHOR

Alex Gough, alex@earth.li.

COPYRIGHT AND LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.