climag.modvege_read_files#

Functions for reading input parameters and time series data

Some code has been adapted from: https://code.europa.eu/agri4cast/modvege

climag.modvege_read_files.download_data(url, data_dir, file_name, known_hash=None)#

Download data and store it in the specified directory using Pooch.

Parameters#

urlstr

URL from which the data will be downloaded

data_dirstr

Directory to store the downloaded data

file_namestr

Name of the downloaded data file with its extension (not full path)

known_hashstr

SHA256 hash of downloaded file

Notes#

This only downloads data if necessary, i.e. if the data file does not already exist in the directory.

climag.modvege_read_files.read_params(filename)#

Read the input parameters (constants) file.

Parameters#

filenamestr

Path to the parameter input file

Returns#

dict[str, float]

A dictionary of the input parameters

climag.modvege_read_files.read_timeseries(filename)#

Read the time series input data

Parameters#

filenamestr

Path to the input time series data file

Returns#

tuple[pandas.DataFrame, int]

A dataframe of the input time series data; Length of the data (total number of days)