Class RainDataParser
In: RainDataParser.rb
Parent: Object

Synopsis

Parse rainfall events from hourly rain data files from the NCDC, and provide useful general and event-based statistics.

Usage

Create a new RainDataParser object:

  rdp = RainDataParser.new("NCDC_rain_data_file.txt")

Parse the file for events based on your IETD list:

  rdp.parse(ietd_array, winter_strip_bool, header_row_bool)

Where:

  • ietd_array = a list of the IETD‘s to use
  • winter_strip_bool = true if ignoring the winter months.
  • header_row_bool = true if the NCDC header rows are present in the file. (Hint: use false if you pulled only select rows out of a raw file)

ex:

  rdp.parse([2], true, true) # Parse with IETD = 2, strip the winter months, strip the header rows

or:

  rdp.parse([2, 4, 6], false, false) # Parse with IETD's 2, 4 & 6, no winter stripping, and no header rows exist

Print a table of statistics:

  rdp.table()

See the Rdoc documentation for more information.

Author

Travis Lee Branham, Undergraduate, Computer Science Dept., The University of the District of Columbia

Advisor: Pradeep K. Behera, Ph.D, P.E., Associate Professor, Civil Engineering Dept., The University of the District of Columbia

Copyright

Copyright (c) 2007 by Travis Lee Branham Licensed under the same terms as Ruby.

Change Log

Version 0.1.0 Date: August 14, 2007

  • Original release.

Version 0.1.1 Date: August 14, 2007

  • Minor bug fixes.

Version 0.2.0 Date: August 20, 2007

  • Added histogram plotting function.

Methods

debug   graph_hist   new   parse   stats   strip_winter_months   table  

Attributes

input_file  [R] 
winter_strip  [R] 

Public Class methods

Public Instance methods

debug: Print some useful statistics. Input: EventContainer object, verbose flag: boolean. Default: false.

[Validate]