disdrodb.data_transfer package#
Submodules#
disdrodb.data_transfer.download_data module#
Routines to download data from the DISDRODB Decentralized Data Archive.
- disdrodb.data_transfer.download_data.click_download_archive_options(function: object)[source]#
Click command line options for DISDRODB archive download.
- Parameters
function (object) – Function.
- disdrodb.data_transfer.download_data.click_download_options(function: object)[source]#
Click command line options for DISDRODB download.
- Parameters
function (object) – Function.
- disdrodb.data_transfer.download_data.download_archive(data_sources: Optional[Union[str, list[str]]] = None, campaign_names: Optional[Union[str, list[str]]] = None, station_names: Optional[Union[str, list[str]]] = None, force: bool = False, base_dir: Optional[str] = None)[source]#
Download DISDRODB stations with the
disdrodb_data_url
in the metadata.- Parameters
data_sources (str or list of str, optional) – Data source name (eg : EPFL). If not provided (
None
), all data sources will be downloaded. The default isdata_source=None
.campaign_names (str or list of str, optional) – Campaign name (eg : EPFL_ROOF_2012). If not provided (
None
), all campaigns will be downloaded. The default iscampaign_name=None
.station_names (str or list of str, optional) – Station name. If not provided (
None
), all stations will be downloaded. The default isstation_name=None
.force (bool, optional) – If
True
, overwrite the already existing raw data file. The default isFalse
.base_dir (str (optional)) – Base directory of DISDRODB. Format:
<...>/DISDRODB
. IfNone
(the default), the disdrodb config variablebase_dir
is used.
- disdrodb.data_transfer.download_data.download_station(data_source: str, campaign_name: str, station_name: str, force: bool = False, base_dir: Optional[str] = None) None [source]#
Download data of a single DISDRODB station from the DISDRODB remote repository.
- Parameters
data_source (str) – The name of the institution (for campaigns spanning multiple countries) or the name of the country (for campaigns or sensor networks within a single country). Must be provided in UPPER CASE.
campaign_name (str) – The name of the campaign. Must be provided in UPPER CASE.
station_name (str) – The name of the station.
base_dir (str (optional)) – The base directory of DISDRODB, expected in the format
<...>/DISDRODB
. If not specified, the path specified in the DISDRODB active configuration will be used.force (bool, optional) – If
True
, overwrite the already existing raw data file. The default isFalse
.base_dir – Base directory of DISDRODB. Format:
<...>/DISDRODB
. IfNone
(the default), the disdrodb config variablebase_dir
is used.
disdrodb.data_transfer.upload_data module#
Routines to upload data to the DISDRODB Decentralized Data Archive.
- disdrodb.data_transfer.upload_data.click_upload_archive_options(function: object)[source]#
Click command line options for DISDRODB archive upload.
- Parameters
function (object) – Function.
- disdrodb.data_transfer.upload_data.click_upload_options(function: object)[source]#
Click command arguments for DISDRODB data upload.
- disdrodb.data_transfer.upload_data.upload_archive(platform: Optional[str] = None, force: bool = False, base_dir: Optional[str] = None, **kwargs) None [source]#
Find all stations containing local data and upload them to a remote repository.
- Parameters
platform (str, optional) – Name of the remote platform. The default platform is
"sandbox.zenodo"
(for testing purposes). Switch to"zenodo"
for final data dissemination.force (bool, optional) – If
True
, upload even if data already exists on another remote location. The default isforce=False
.base_dir (str (optional)) – Base directory of DISDRODB. Format:
<...>/DISDRODB
. IfNone
(the default), thebase_dir
path specified in the DISDRODB active configuration will be used.data_sources (str or list of str, optional) – Data source name (eg: EPFL). If not provided (
None
), all data sources will be uploaded. The default isdata_source=None
.campaign_names (str or list of str, optional) – Campaign name (eg: EPFL_ROOF_2012). If not provided (
None
), all campaigns will be uploaded. The default iscampaign_name=None
.station_names (str or list of str, optional) – Station name. If not provided (
None
), all stations will be uploaded. The default isstation_name=None
.
- disdrodb.data_transfer.upload_data.upload_station(data_source: str, campaign_name: str, station_name: str, platform: Optional[str] = 'sandbox.zenodo', force: bool = False, base_dir: Optional[str] = None) None [source]#
Upload data from a single DISDRODB station on a remote repository.
This function also automatically update the disdrodb_data url in the metadata file.
- Parameters
data_source (str) – The name of the institution (for campaigns spanning multiple countries) or the name of the country (for campaigns or sensor networks within a single country). Must be provided in UPPER CASE.
campaign_name (str) – The name of the campaign. Must be provided in UPPER CASE.
station_name (str) – The name of the station.
base_dir (str, optional) – The base directory of DISDRODB, expected in the format
<...>/DISDRODB
. IfNone
(the default), thebase_dir
path specified in the DISDRODB active configuration will be used.platform (str, optional) – Name of the remote data storage platform. The default platform is
"sandbox.zenodo"
(for testing purposes). Switch to"zenodo"
for final data dissemination.force (bool, optional) – If
True
, upload the data and overwrite thedisdrodb_data_url
. The default isforce=False
.
disdrodb.data_transfer.zenodo module#
DISDRODB Zenodo utility.
- disdrodb.data_transfer.zenodo.upload_station_to_zenodo(metadata_filepath: str, sandbox: bool = True) str [source]#
Zip station data, upload data to Zenodo and update the metadata disdrodb_data_url.
- Parameters
metadata_filepath (str) – Metadata file path.
sandbox (bool) – If
True
, upload to Zenodo Sandbox (for testing purposes). IfFalse
, upload to Zenodo.
Module contents#
Routines to download and upload data to the DISDRODB Decentralized Data Archive.