NAME

load_seasonality_history - Load historical weather data into Seasonality's database.

VERSION

This document describes load_seasonality_history version 0.0.6.

USAGE

load_seasonality_history file... [options]

OPTIONS

Note: the set of options will change in future versions; do not count upon the current interface.

--clean

Clean up incoming data, treating invalid values as not being present. At present, this only handles the numeric columns (e.g. not the date).

Data that is considered invalid includes values that don't look like numbers and values that are outside the range allowed for the column, e.g. a humidity greater than 100%.

Non-integer values for integer columns will be rounded, rounding up when the fractional portion is greater than or equal to 0.5.

--temperature-units [=] <units>

The units that the input temperatures are in. Must be one of f, fahrenheit, c, celsius.

--pressure-units [=] <units>

The units that the input pressures are in. Must be one of iHg, inches_Hg, inches_of_mercury, millibars, hectopascals.

--wind-speed-units [=] <units>

The units that the input wind speeds are in. Must be one of mph, miles_per_hour, knots.

--database [=] <file>

Use a database other than Seasonality's default, ~/Library/Application Support/Seasonality/weather.db.

--no-shutdown

If Seasonality is running, don't shut it down before processing.

--shutdown-wait [=] <seconds>

The number of seconds to wait for Seasonality to shut down. Defaults to 5.

--no-backup

Don't back up the database before loading the data.

Regardless of the value of this option, the database will not be backed up if Seasonality is running during the actual load of the data.

--no-restart

If Seasonality was running, and it was shut down, don't run it again after the data is loaded.

--force-start

Run Seasonality after the data is loaded, even if it wasn't previously running. This option overrides the --no-restart option.

-{q|-quiet}

Suppress all output.

--no-growl

Even if the Mac::Growl module is installed, don't use it.

--version
--usage
--help
--man

Print the usual program information

REQUIRED ARGUMENTS

<file>...

One or more files to load. Each file must be in CSV format.

DESCRIPTION

Seasonality is MacOS X weather application, available at http://gauchosoft.com/Software/Seasonality/. This program provides a means of getting data into Seasonality's database from data sources that it cannot handle itself.

Data

Data is expected in CSV format. Presently, the values for each data point must be in the following order:

· Location identifier, up to 32 characters. For custom locations, avoid using four character identifiers in order to avoid interfering with Seasonality's standard ICAO airport codes.
· UTC/GMT observation time, consisting of year, month, day, hour, and minute in YYYYMMDDHHMM format. Seconds are not permitted.
· Wind direction, in integer degrees, 0 to 360, or -1 for variable winds.
· Wind speed in integer knots.
· Gust speed in integer knots.
· Visibility in miles.
· Temperature in degrees Celsius.
· Dew point in degrees Celsius.
· Pressure in integer hectopascals.
· Relative humidity in integer percent.

All values are mandatory. If a measurement is missing, use Seasonality's marker value of -1000.

No data other than the above is allowed into the file, not even column headers.

You can update existing data for a given location and observation time; load_seasonality_history will overwrite any preexisting data. In particular, this means that, if you have multiple lines in a file for the same location and time, the last one wins.

Paranoia

At present, by default, load_seasonality_history will force Seasonality to shut down, if it is running, and will create a backup copy of the database before adding the data. If Seasonality was running at the start, it will be relaunched at the end.

In the future, after this program has proved itself reliable, these defaults will be reversed.

DEPENDENCIES

DBD::SQLite2 Exception::Class Getopt::Euclid Mac::Apps::Launch Mac::Apps::Seasonality::Constants Mac::Processes Readonly Regexp::Common Text::CSV_XS version

Seasonality v1.3 or v1.4.

DIAGNOSTICS

TODO

CONFIGURATION AND ENVIRONMENT

load_seasonality_history requires that it is running against a database in the format used by Seasonality versions 1.3 and 1.4.

The actual Seasonality application must be locatable by Mac::Apps::Launch.

INCOMPATIBILITIES

None reported.

BUGS AND LIMITATIONS

· The interface to this program is not frozen yet.
· Columns are required to be in a fixed order.
· Files with column headers or other ignorable data aren't dealt with.
· Files are restricted to CSV format.
· There's no proper handling of errors. Problems just cause Perl to fall over.
· The DIAGNOSTICS section above is not filled in.
· Conversion between dew point and relative humidity is not handled.
· The observation date format isn't flexible.
· Will not run with databases for Seasonality versions earlier than 1.3.

Please report any bugs or feature requests to bug-mac-apps-seasonality-loadicaohistory@rt.cpan.org, or through the web interface at http://rt.cpan.org.

AUTHOR

Elliot Shank <perl@galumph.com>

LICENSE AND COPYRIGHT

Copyright ©2006-2007, Elliot Shank <perl@galumph.com>. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.

DISCLAIMER OF WARRANTY

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.