metobs_toolkit.Dataset.get_analysis#

Dataset.get_analysis(add_gapfilled_values=False)[source]#

Create an Analysis instance from the Dataframe.

Parameters:

add_gapfilled_values (bool, optional) – If True, all filled values (from gapfill and missing observation fill), are added to the analysis records aswell. The default is False.

Returns:

The Analysis instance of the Dataset.

Return type:

metobs_toolkit.Analysis

Examples

>>> import metobs_toolkit
>>>
>>> # Import data into a Dataset
>>> dataset = metobs_toolkit.Dataset()
>>> dataset.update_settings(
...                         input_data_file=metobs_toolkit.demo_datafile,
...                         input_metadata_file=metobs_toolkit.demo_metadatafile,
...                         template_file=metobs_toolkit.demo_template,
...                         )
>>> dataset.import_data_from_file()
>>> dataset.coarsen_time_resolution(freq='1h')
>>>
>>> # Create an Analysis from the dataset
>>> analysis = dataset.get_analysis()
>>> analysis
Analysis instance containing:
     *28 stations
     *['temp', 'humidity', 'wind_speed', 'wind_direction'] observation types
     *10080 observation records
     *Coordinates are available for all stations.

     *records range: 2022-09-01 00:00:00+00:00 --> 2022-09-15 23:00:00+00:00 (total duration:  14 days 23:00:00)     *Coordinates are available for all stations.