Ham::Resources::Propagation

The Ham::Resources::Propagation module provides a simple and easy to use interface to obtain and explain data from N0NBH’s solar resource website that’s useful for Radio Amateur applications.

This module provides not only the same values from the website but it makes a categorization based on a simplified scale.

Also, this module offers you an interpretation of some values, like solar flux or electron flux.

This module don’t use a static data structure to create the data object, if not, when it creates the hash with the XML data using the names of the labels to create their own structure. This means that if the original XML is modified by a new value, the resulting object displays the new value without changing the internal structure of the module.

The original data structure has 3 groups of information:

  • Solar data
  • HF propagation (High Frecuency)
  • VHF propagation (Very High Frecuency)

But this module adds a new group, called ‘extended’, interpreting some values, like:

  • Band openings
  • Electron alert
  • Radio blackouts
  • Solar radiation

This module require XML::Reader to obtain a hash from the original XML website resource. So you can call not only all data but a specific group of data or an specific item too.

For create the new object you must use:

   my $propagation = Ham::Resources::Propagation->new();

This method have 2 arguments, not required:

  • timeout: an integer of seconds to wait for the timeout of the web site (default = 10)
  • description: an string ‘numeric’, return only numeric data, ‘text’ returns values with text index (Default value is ‘text’)
   my $propagation = Ham::Resources::Propagation->new('description','text'); # numeric or text
   die $propagation->error_message if $propagation->is_error;

This module has five methods, three for data and two for errors:

  • get(): gets a single item of solar data
  • get_groups: gets an array of existing groups of data
  • all_item_names: get an array reference of all solar and propagation data items available from the object
  • is_error(): test for an error if one was returned from the call to the resource site
  • error_message: if there was an error message when trying to call the resource site, this is it

Ham::Resources::Propagation is simple to use:

   # returns the A-Index value from the Solar group
   $propagation->{solar}->{aindex}; 

   # returns the A-Index value without need to add the group   
   $propagation->get(aindex); 

   # returns all data that this group.
   $propagation->get(vhf); 

There are 4 groups to call: solar, hf, vhf and extended.

You can use the all_item_names method for obtain a list of all item names of data and to pass to get method, for example:

        foreach (@{$propagation->all_item_names}) 
        {
                  print "$_ = ".$propagation->get($_)."\n";
        }

For example, you can obtain an output list with all items of the XML, like this:

12-10m_day
12-10m_night
17-15m_day
17-15m_night
30-20m_day
30-20m_night
80-40m_day
80-40m_night
SN
aindex
aurora
bandopenings
electonflux
electronalert
europe E-Skip 
europe_4m E-Skip 
europe_6m E-Skip 
fof2
geomagfield
heliumline
kindex
kindexnt
latdegree
magneticfield
normalization
north_america E-Skip 
northern_hemi vhf-aurora 
protonflux
radioblackout
signalnoise
solarflux
solarradiation
solarwind
sunspots
updated
xray

That list can use for obtain a single value, for example, if you need the number of Sunspots:

   $propagation->get(sunspots)

   > sunspots: 108

You can also call for a complete group of data, like this:

my $groups = qr/solar|hf|vhf|extended/i;
...
if ($data =~ $groups)
{
	foreach (sort keys %{$propagation->{$data}})
	{
		print $_.": ".$propagation->{$data}->{$_}."\n";
	}
}

For example, if you would like HF propagation prediction:

> perl Ham-Resources-Propagation-test.pl hf
12-10m_day: Fair
12-10m_night: Poor
17-15m_day: Good
17-15m_night: Good
30-20m_day: Good
30-20m_night: Good
80-40m_day: Fair

A complete output example:

bandopenings =  Moderate. Fair to good conditions all bands up through 10m.
electronalert =  Alert. Partial HF blackout in polar regions.
radioblackout =  Normal. No or small flare. No or very minor impact to HF signals.
solarradiation =  Moderate. 25 storms per cycle. Small effects on HF in polar regions.
12-10m_day = Fair
12-10m_night = Poor
17-15m_day = Good
17-15m_night = Good
30-20m_day = Good
30-20m_night = Good
80-40m_day = Fair
80-40m_night = Good
SN = 70-105
aindex = (9) unsettled
aurora = 4
electonflux = (2.64e+03) Alert
fof2 = 3.00
geomagfield = VR QUIET
heliumline = 375.8
kindex = (1) quiet
kindexnt = No Report
latdegree = 63.9
magneticfield = 5.7
normalization = 1.02
protonflux = (2.44e+03) Moderate
signalnoise = S0-S1
solarflux = (140) Moderate
solarwind = No Rpt
sunspots = 108
updated = 24 Jan 2012 0942 GMT
xray = (B6.9) Normal
europe E-Skip  = Band Closed
europe_4m E-Skip  = Band Closed
europe_6m E-Skip  = Band Closed
north_america E-Skip  = Band Closed
northern_hemi vhf-aurora  = Band Closed

ACKNOWLEDGEMENTS
This module gets its data from N0NBH’s Propagation Resource Page at http://www.hamqsl.com.
Thanks to Paul L Herrman N0NBH!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: