Basic functions for controlling netCDF CF standard time axis

class pyhomogenize.basics(fmt='%Y-%m-%dT%H:%M:%S', calendar='standard', frequency='D')[source]

Class for controlling netCDF CF standard time axis.

The basics contains some basics functions.

Parameters
  • fmt (str, default: ‘%Y-%m-%dT%H:%M:%S’) – Time format for converting strings into cftime.datetime object

  • calendar (str, default: ‘standard’) – Calendar type for the datetimes.

__init__(fmt='%Y-%m-%dT%H:%M:%S', calendar='standard', frequency='D')[source]

Methods

basics.str_to_date(str[, fmt, mode, calendar])

Converts string to cftime.datetime object

basics.date_to_str(date[, fmt])

Converts cftime.datetime or datetime.datetime object to string

basics.is_month_start(cftime_range)

Check whether each element of CFTimeIndex is first day of the month

basics.is_month_end(cftime_range)

Check whether each element of CFTimeIndex is last day of the month

basics.date_range(start, end[, frequency, ...])

Build CFTimeIndex

basics.date_range_to_frequency_limits([...])

Get bounds of CFTimeIndex which satisfy user-given conditions.

Attributes

basics.fmt(fmt)

Time format for converting strings into cftime.datetime object.

basics.calendar(calendar)

Calendar type for the datetimes.

basics.frequency(frequency)

Frequency strings or list of strings can have multiples.