Main Page   Alphabetical List   Compound List   File List   Compound Members   File Members  

GRIB_TIME Class Reference

Interface to time description as stored in GRIB version 1 files. More...

#include <GRIB.h>

List of all members.

Public Methods

 GRIB_TIME ()
 Constructor.

void Decode (unsigned char *pds)
 Decode time from pds. Not to be used.

unsigned char * Encode ()
 Encode time to 13 characters. Not to be used.

void set (int year, int month, int day, int hour, int minute, t_enum_GRIB_TIMEUNIT tu, t_enum_GRIB_TIMERANGE tr, int time1, int time2, int nave, int nmiss)
 Set time. Complete interface.

void set_referencetime (int year, int month, int day, int hour, int minute)
 Set reference time.

void set_analysis ()
 Set analysis at reference time.

void set_forecast_hour (int hforecast)
 Set forecast at reference time + hforecast hours.

std::string Reftime ()
 Obtain reference time.

std::string Reftime2000 ()
 Obtain reference time as "2000-01-01 00:00:00 UTC".

std::string TimeString ()
 Obtain current time as a full descriptive string.

std::string ValidTime ()
 Obtain current time as "2000-01-01 00:00:00 UTC". Note this is menaingful only for analysis and forecasts.

time_t ForecastSeconds ()
 Obtain forecast seconds from reference time.

time_t ForecastSeconds2000 ()
 Obtain forecast seconds from 2000-01-01 00:00:00 UTC.


Public Attributes

t_enum_GRIB_TIMEUNIT timeunit
 Used timeunit.

t_enum_GRIB_TIMERANGE timerange
 Used timerange.

std::string reftime
 reference reference time string

std::string timestring
 reference time string

int year
 Local storage for year.

int month
 Local storage for month.

int day
 Local storage for day.

int hour
 Local storage for hour.

int minute
 Local storage for minute.

int p1
 Local sorage for encoded time.

int p2
 Local sorage for encoded time.

int p1p2
 Local sorage for encoded time.

int naveraged
 Local sorage for encoded time.

int nmissing
 Local sorage for encoded time.


Friends

std::ostream & operator<< (std::ostream &os, GRIB_TIME &t)
 overloaded output to stream operator


Detailed Description

Interface to time description as stored in GRIB version 1 files.

All string times are encoded as in

                    YYYY-MM-DD hh:mm:ss TZD
                     /            |        \
             ISO8601 date   ISO8601 time  time zone designator (UTC)
    

Definition at line 342 of file GRIB.h.


Constructor & Destructor Documentation

GRIB_TIME::GRIB_TIME  
 

Constructor.

Definition at line 43 of file GRIB.cpp.

References day, GRIB_TIMERANGE_UNKNOWN, GRIB_TIMEUNIT_UNKNOWN, hour, minute, month, naveraged, nmissing, p1, p1p2, p2, reftime, timerange, timestring, timeunit, and year.


Member Function Documentation

void GRIB_TIME::Decode unsigned char *    pds
 

Decode time from pds. Not to be used.

Parameters:
pds:  The encoded pds

Definition at line 220 of file GRIB.cpp.

References day, hour, minute, month, naveraged, nmissing, p1, p1p2, p2, PDS_Day, PDS_ForecastTimeUnit, PDS_Hour, PDS_Minute, PDS_Month, PDS_NumAve, PDS_NumMissing, PDS_P1, PDS_P1P2, PDS_P2, PDS_TimeRange, PDS_Year4, timerange, timeunit, and year.

Referenced by GRIB_MESSAGE::Decode().

unsigned char * GRIB_TIME::Encode  
 

Encode time to 13 characters. Not to be used.

Definition at line 242 of file GRIB.cpp.

References day, hour, minute, month, naveraged, nmissing, p1, p2, timerange, timeunit, and year.

Referenced by GRIB_MESSAGE::Encode().

time_t GRIB_TIME::ForecastSeconds  
 

Obtain forecast seconds from reference time.

Definition at line 433 of file GRIB.cpp.

References GRIB_TIMERANGE_ANALYSIS_AT_REFTIME, GRIB_TIMERANGE_AVERAGE_IN_REFTIME_MINUS_P1_REFTIME_MINUS_P2, GRIB_TIMERANGE_VALID_AT_REFTIME_PLUS_P1P2, GRIB_TIMEUNIT_DAY, GRIB_TIMEUNIT_HOUR, GRIB_TIMEUNIT_HOURS12, GRIB_TIMEUNIT_HOURS3, GRIB_TIMEUNIT_HOURS6, GRIB_TIMEUNIT_MINUTE, GRIB_TIMEUNIT_MONTH, GRIB_TIMEUNIT_SECOND, p1, p1p2, p2, timerange, and timeunit.

Referenced by ForecastSeconds2000(), and ValidTime().

time_t GRIB_TIME::ForecastSeconds2000  
 

Obtain forecast seconds from 2000-01-01 00:00:00 UTC.

Definition at line 475 of file GRIB.cpp.

References day, ForecastSeconds(), hour, minute, month, and year.

std::string GRIB_TIME::Reftime  
 

Obtain reference time.

Definition at line 465 of file GRIB.cpp.

References reftime.

std::string GRIB_TIME::Reftime2000  
 

Obtain reference time as "2000-01-01 00:00:00 UTC".

Definition at line 468 of file GRIB.cpp.

void GRIB_TIME::set int    year,
int    month,
int    day,
int    hour,
int    minute,
t_enum_GRIB_TIMEUNIT    tu,
t_enum_GRIB_TIMERANGE    tr,
int    time1,
int    time2,
int    nave,
int    nmiss
 

Set time. Complete interface.

Parameters:
year:  year 4 digit
month:  month 0-12
day:  day 1-31
hour:  hour 0-23
minute:  minute 0-59
tu:  time unit as in t_enum_GRIB_TIMEUNIT
tr:  time range as in t_enum_GRIB_TIMERANGE
time1:  first time (time from reference or interval start)
time2:  interval end (set 0 if not interval)
nave:  number of averaged/accumulated
nmiss:  number of missing in average/accumulation

Definition at line 261 of file GRIB.cpp.

References day, hour, minute, month, set_referencetime(), and year.

void GRIB_TIME::set_analysis  
 

Set analysis at reference time.

Definition at line 270 of file GRIB.cpp.

References GRIB_TIMERANGE_ANALYSIS_AT_REFTIME, GRIB_TIMEUNIT_HOUR, naveraged, nmissing, p1, p1p2, p2, timerange, and timeunit.

void GRIB_TIME::set_forecast_hour int    hforecast
 

Set forecast at reference time + hforecast hours.

Parameters:
hforecast:  number of hours of forecast from reference time

Definition at line 278 of file GRIB.cpp.

References GRIB_TIMERANGE_FORECAST_AT_REFTIME_PLUS_P1, GRIB_TIMERANGE_VALID_AT_REFTIME_PLUS_P1P2, GRIB_TIMEUNIT_HOUR, naveraged, nmissing, p1, p1p2, p2, timerange, and timeunit.

void GRIB_TIME::set_referencetime int    year,
int    month,
int    day,
int    hour,
int    minute
 

Set reference time.

Parameters:
year:  year 4 digit
month:  month 0-12
day:  day 1-31
hour:  hour 0-23
minute:  minute 0-59

Definition at line 301 of file GRIB.cpp.

References day, hour, minute, month, and year.

Referenced by set().

std::string GRIB_TIME::TimeString  
 

Obtain current time as a full descriptive string.

Definition at line 466 of file GRIB.cpp.

References timestring.

std::string GRIB_TIME::ValidTime  
 

Obtain current time as "2000-01-01 00:00:00 UTC". Note this is menaingful only for analysis and forecasts.

Definition at line 493 of file GRIB.cpp.

References day, ForecastSeconds(), hour, minute, month, and year.


Friends And Related Function Documentation

std::ostream& operator<< std::ostream &    os,
GRIB_TIME &    t
[friend]
 

overloaded output to stream operator

Definition at line 516 of file GRIB.cpp.


Member Data Documentation

int GRIB_TIME::day
 

Local storage for day.

Definition at line 424 of file GRIB.h.

Referenced by Decode(), Encode(), ForecastSeconds2000(), GRIB_TIME(), set(), set_referencetime(), GRIB_MESSAGE::set_time(), and ValidTime().

int GRIB_TIME::hour
 

Local storage for hour.

Definition at line 426 of file GRIB.h.

Referenced by Decode(), Encode(), ForecastSeconds2000(), GRIB_TIME(), set(), set_referencetime(), GRIB_MESSAGE::set_time(), and ValidTime().

int GRIB_TIME::minute
 

Local storage for minute.

Definition at line 428 of file GRIB.h.

Referenced by Decode(), Encode(), ForecastSeconds2000(), GRIB_TIME(), set(), set_referencetime(), GRIB_MESSAGE::set_time(), and ValidTime().

int GRIB_TIME::month
 

Local storage for month.

Definition at line 422 of file GRIB.h.

Referenced by Decode(), Encode(), ForecastSeconds2000(), GRIB_TIME(), set(), set_referencetime(), GRIB_MESSAGE::set_time(), and ValidTime().

int GRIB_TIME::naveraged
 

Local sorage for encoded time.

Definition at line 436 of file GRIB.h.

Referenced by Decode(), Encode(), GRIB_TIME(), set_analysis(), set_forecast_hour(), and GRIB_MESSAGE::set_time().

int GRIB_TIME::nmissing
 

Local sorage for encoded time.

Definition at line 436 of file GRIB.h.

Referenced by Decode(), Encode(), GRIB_TIME(), set_analysis(), set_forecast_hour(), and GRIB_MESSAGE::set_time().

int GRIB_TIME::p1
 

Local sorage for encoded time.

Definition at line 430 of file GRIB.h.

Referenced by Decode(), Encode(), ForecastSeconds(), GRIB_TIME(), set_analysis(), set_forecast_hour(), and GRIB_MESSAGE::set_time().

int GRIB_TIME::p1p2
 

Local sorage for encoded time.

Definition at line 434 of file GRIB.h.

Referenced by Decode(), ForecastSeconds(), GRIB_TIME(), set_analysis(), set_forecast_hour(), and GRIB_MESSAGE::set_time().

int GRIB_TIME::p2
 

Local sorage for encoded time.

Definition at line 432 of file GRIB.h.

Referenced by Decode(), Encode(), ForecastSeconds(), GRIB_TIME(), set_analysis(), set_forecast_hour(), and GRIB_MESSAGE::set_time().

std::string GRIB_TIME::reftime
 

reference reference time string

Definition at line 414 of file GRIB.h.

Referenced by GRIB_TIME(), Reftime(), and GRIB_MESSAGE::set_time().

t_enum_GRIB_TIMERANGE GRIB_TIME::timerange
 

Used timerange.

Definition at line 408 of file GRIB.h.

Referenced by Decode(), Encode(), ForecastSeconds(), GRIB_TIME(), set_analysis(), set_forecast_hour(), and GRIB_MESSAGE::set_time().

std::string GRIB_TIME::timestring
 

reference time string

Definition at line 417 of file GRIB.h.

Referenced by GRIB_TIME(), operator<<(), GRIB_MESSAGE::set_time(), and TimeString().

t_enum_GRIB_TIMEUNIT GRIB_TIME::timeunit
 

Used timeunit.

Definition at line 405 of file GRIB.h.

Referenced by Decode(), GRIB_MESSAGE::Encode(), Encode(), ForecastSeconds(), GRIB_TIME(), set_analysis(), set_forecast_hour(), and GRIB_MESSAGE::set_time().

int GRIB_TIME::year
 

Local storage for year.

Definition at line 420 of file GRIB.h.

Referenced by Decode(), Encode(), ForecastSeconds2000(), GRIB_TIME(), set(), set_referencetime(), GRIB_MESSAGE::set_time(), and ValidTime().


The documentation for this class was generated from the following files:
Generated on Fri Sep 10 09:52:08 2004 for GRIBLIB by doxygen1.2.18