cdm_reader_mapper.metmetpy.datetime package¶
Internal metmetpy datetime information package.
Subpackages¶
Submodules¶
cdm_reader_mapper.metmetpy.datetime.correction_functions module¶
Internal metmetpy correction functions.
Created on Tue Jun 25 09:07:05 2019
@author: iregon
- cdm_reader_mapper.metmetpy.datetime.correction_functions.dck_201_icoads(data)[source]¶
Adjust ICOADS date/time fields for dataset DCK 201.
If year <= 1899 and hour == 0, shift the datetime back by one day.
- Parameters:
data (
pd.DataFrame) – Input DataFrame containing ICOADS date columns (YR, MO, DY, HR), using multi-index or string column names as defined in properties.- Return type:
- Returns:
pd.DataFrame– DataFrame with adjusted ICOADS date/time fields.
cdm_reader_mapper.metmetpy.datetime.model_datetimes module¶
Internal metmetpy modelo datetime package.
Created on Wed Jul 10 09:18:41 2019
Defines the datetime field extraction or generation for data models.
Reference names of different metadata fields used in the metmetpy modules and its location column|(section,column) in a data model are registered in ../properties.py in metadata_datamodels.
@author: iregon
- cdm_reader_mapper.metmetpy.datetime.model_datetimes.datetime_decimalhour_to_hm(decimal_hours)[source]¶
Convert a decimal-hour value (e.g., 12.5) to (hours, minutes).
- cdm_reader_mapper.metmetpy.datetime.model_datetimes.from_datetime(data, model='icoads')[source]¶
Dispatch conversion from datetime according to model.
- cdm_reader_mapper.metmetpy.datetime.model_datetimes.icoads(data, conversion)[source]¶
Convert ICOADS date/time fields between DataFrame representation and pandas datetime Series.
- Parameters:
data (
DataFrameorSeries) – For conversion=”to_datetime”: a DataFrame containing the ICOADS date fields YR, MO, DY, HR (can be strings or tuple column names). For conversion=”from_datetime”: a Series of datetime64 values.conversion (
{"to_datetime", "from_datetime"}) – Direction of conversion.
- Return type:
- Returns:
SeriesorDataFrame– Converted date values.