diff --git a/README.md b/README.md index 04d27367..05aac09c 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ or set up the (temporary) environment variable `DISDRODB_BASE_DIR` in your termi To download all data stored into the DISDRODB Decentralized Data Archive, you just have to run the following command: ```bash - download_disdrodb_archive + disdrodb_download_archive ``` #### 💫 Transform the raw data to standardized netCDF files. @@ -83,7 +83,7 @@ If you want to convert all stations raw data into standardized netCDF4 files, ru ```bash - run_disdrodb_l0 + disdrodb_run_l0 ``` diff --git a/disdrodb/l0/l0_processing.py b/disdrodb/l0/l0_processing.py index f1811797..16984f7e 100644 --- a/disdrodb/l0/l0_processing.py +++ b/disdrodb/l0/l0_processing.py @@ -773,7 +773,7 @@ def run_disdrodb_l0a_station( # Define command cmd = " ".join( [ - "run_disdrodb_l0a_station", + "disdrodb_run_l0a_station", # Station arguments data_source, campaign_name, @@ -812,7 +812,7 @@ def run_disdrodb_l0b_station( # Define command cmd = " ".join( [ - "run_disdrodb_l0b_station", + "disdrodb_run_l0b_station", # Station arguments data_source, campaign_name, diff --git a/disdrodb/l0/l0b_nc_concat.py b/disdrodb/l0/l0b_nc_concat.py index bebd333e..e1f584a3 100644 --- a/disdrodb/l0/l0b_nc_concat.py +++ b/disdrodb/l0/l0b_nc_concat.py @@ -120,7 +120,7 @@ def run_disdrodb_l0b_concat_station( """ cmd = " ".join( [ - "run_disdrodb_l0b_concat_station", + "disdrodb_run_l0b_concat_station", data_source, campaign_name, station_name, diff --git a/disdrodb/l0/scripts/run_disdrodb_l0a.py b/disdrodb/l0/scripts/run_disdrodb_l0a.py index 8654ff94..ea9bd408 100644 --- a/disdrodb/l0/scripts/run_disdrodb_l0a.py +++ b/disdrodb/l0/scripts/run_disdrodb_l0a.py @@ -91,9 +91,9 @@ def run_disdrodb_l0a( from disdrodb.l0.l0_processing import run_disdrodb_l0a # Parse data_sources, campaign_names and station arguments - print(data_sources) - print(campaign_names) - print(station_names) + # print(data_sources) + # print(campaign_names) + # print(station_names) data_sources = parse_arg_to_list(data_sources) campaign_names = parse_arg_to_list(campaign_names) diff --git a/disdrodb/l0/scripts/run_disdrodb_l0a_station.py b/disdrodb/l0/scripts/run_disdrodb_l0a_station.py index 97b6663b..60aa4858 100644 --- a/disdrodb/l0/scripts/run_disdrodb_l0a_station.py +++ b/disdrodb/l0/scripts/run_disdrodb_l0a_station.py @@ -87,6 +87,7 @@ def run_disdrodb_l0a_station( from dask.distributed import Client, LocalCluster from disdrodb.api.io import get_disdrodb_path + from disdrodb.configs import get_base_dir from disdrodb.l0.l0_reader import get_station_reader_function # -------------------------------------------------------------------------. @@ -108,6 +109,7 @@ def run_disdrodb_l0a_station( Client(cluster) # -------------------------------------------------------------------------. # Get reader + base_dir = get_base_dir(base_dir) reader = get_station_reader_function( base_dir=base_dir, data_source=data_source, diff --git a/disdrodb/l0/scripts/run_disdrodb_l0b_concat_station.py b/disdrodb/l0/scripts/run_disdrodb_l0b_concat_station.py index f102a4fc..be61531e 100644 --- a/disdrodb/l0/scripts/run_disdrodb_l0b_concat_station.py +++ b/disdrodb/l0/scripts/run_disdrodb_l0b_concat_station.py @@ -67,9 +67,11 @@ def run_disdrodb_l0b_concat_station( If not specified, uses path specified in the DISDRODB active configuration. \n """ from disdrodb.api.io import get_disdrodb_path + from disdrodb.configs import get_base_dir from disdrodb.l0.l0b_nc_concat import _concatenate_netcdf_files # Retrieve processed_dir + base_dir = get_base_dir(base_dir) processed_dir = get_disdrodb_path( base_dir=base_dir, product_level="L0B", diff --git a/disdrodb/l0/scripts/run_disdrodb_l0b_station.py b/disdrodb/l0/scripts/run_disdrodb_l0b_station.py index e22782a8..2f25cf84 100644 --- a/disdrodb/l0/scripts/run_disdrodb_l0b_station.py +++ b/disdrodb/l0/scripts/run_disdrodb_l0b_station.py @@ -86,6 +86,7 @@ def run_disdrodb_l0b_station( from dask.distributed import Client, LocalCluster from disdrodb.api.io import get_disdrodb_path + from disdrodb.configs import get_base_dir from disdrodb.l0.l0_processing import run_l0b # -------------------------------------------------------------------------. @@ -108,6 +109,7 @@ def run_disdrodb_l0b_station( # -------------------------------------------------------------------------. # Define processed dir + base_dir = get_base_dir(base_dir) processed_dir = get_disdrodb_path( base_dir=base_dir, product_level="L0B", diff --git a/disdrodb/metadata/scripts/disdrodb_check_metadata_archive.py b/disdrodb/metadata/scripts/check_metadata_archive.py similarity index 100% rename from disdrodb/metadata/scripts/disdrodb_check_metadata_archive.py rename to disdrodb/metadata/scripts/check_metadata_archive.py diff --git a/docs/source/contribute_data.rst b/docs/source/contribute_data.rst index b142eadb..de8940d0 100644 --- a/docs/source/contribute_data.rst +++ b/docs/source/contribute_data.rst @@ -132,7 +132,7 @@ To do so, run the following command: .. code:: bash export DISDRODB_BASE_DIR=" --campaign_names + disdrodb_run_l0 --data_sources --campaign_names ::note If the correctness of the reader has already been tested, you can add the ``--debugging_mode True`` parameter to just run the processing diff --git a/docs/source/data_download.rst b/docs/source/data_download.rst index 9d62387c..6f6a2513 100644 --- a/docs/source/data_download.rst +++ b/docs/source/data_download.rst @@ -66,7 +66,7 @@ To download all data stored into the DISDRODB Decentralized Data Archive, you ju .. code:: bash - download_disdrodb_archive --data_sources --campaign_names --station_names --force true + disdrodb_download_archive --data_sources --campaign_names --station_names --force true The ``data_sources``, ``campaign_names`` and ``station_names`` parameters are optional and are meant to restrict the download processing to a specific data source, campaign, or station. diff --git a/docs/source/l0_processing.rst b/docs/source/l0_processing.rst index 5937256a..c0480ecb 100644 --- a/docs/source/l0_processing.rst +++ b/docs/source/l0_processing.rst @@ -14,16 +14,16 @@ There are two ways of process a station using DISDRODB. .. code-block:: - run_disdrodb_l0_station [parameters] + disdrodb_run_l0_station [parameters] Example : .. code-block:: - run_disdrodb_l0_station EPFL_2008 10 --l0a_processing True --l0b_processing True --force True --verbose True --parallel False + disdrodb_run_l0_station EPFL_2008 10 --l0a_processing True --l0b_processing True --force True --verbose True --parallel False - Type ``run_disdrodb_l0_station --help`` in the terminal to get more information on the possible parameters. + Type ``disdrodb_run_l0_station --help`` in the terminal to get more information on the possible parameters. 2. By calling a python function @@ -98,21 +98,21 @@ For example, if only ``--campaign_names`` are specified, DISDRODB will process o .. code-block:: - run_disdrodb_l0 --data_sources --campaign_names --station_names [parameters] + disdrodb_run_l0 --data_sources --campaign_names --station_names [parameters] Example : .. code-block:: bash - run_disdrodb_l0 --campaign_names EPFL_2008 --l0a_processing True --l0b_processing True --parallel False + disdrodb_run_l0 --campaign_names EPFL_2008 --l0a_processing True --l0b_processing True --parallel False To specify multiple campaigns you can do the follow .. code-block:: bash - run_disdrodb_l0 --campaign_names 'EPFL_2008 LOCARNO_2018' --l0a_processing True --l0b_processing True --parallel False + disdrodb_run_l0 --campaign_names 'EPFL_2008 LOCARNO_2018' --l0a_processing True --l0b_processing True --parallel False - Type ``run_disdrodb_l0 --help`` in the terminal to get more information on the possible parameters. + Type ``disdrodb_run_l0 --help`` in the terminal to get more information on the possible parameters. 2. By calling a python function diff --git a/docs/source/readers.rst b/docs/source/readers.rst index fa396d07..ffd894df 100644 --- a/docs/source/readers.rst +++ b/docs/source/readers.rst @@ -486,27 +486,27 @@ To run the processing of a single station, you can run: .. code-block:: bash - run_disdrodb_l0_station [parameters] + disdrodb_run_l0_station [parameters] For example, to process the data of station 10 of the EPFL_2008 campaign, you would run: .. code-block:: bash - run_disdrodb_l0_station EPFL EPFL_2008 10 --force True --verbose True --parallel False + disdrodb_run_l0_station EPFL EPFL_2008 10 --force True --verbose True --parallel False If no problems arise, try to run the processing for all stations within a campaign, with: .. code-block:: bash - run_disdrodb_l0 --data_sources --campaign_names [parameters] + disdrodb_run_l0 --data_sources --campaign_names [parameters] For example, to process all stations of the EPFL_2008 campaign, you would run: .. code-block:: bash - run_disdrodb_l0 --data_sources EPFL --campaign_names EPFL_2008 --force True --verbose True --parallel False + disdrodb_run_l0 --data_sources EPFL --campaign_names EPFL_2008 --force True --verbose True --parallel False .. note:: diff --git a/docs/source/software_structure.rst b/docs/source/software_structure.rst index f2537da6..7e065bbe 100644 --- a/docs/source/software_structure.rst +++ b/docs/source/software_structure.rst @@ -10,7 +10,14 @@ The current software structure is described below: | ├── 📜 checks.py | ├── 📜 info.py | ├── 📜 io.py -| ├── 📜 metadata.py +| ├── 📁 metadata +| ├── 📁 scripts +| ├── 📜 check_metadata_archive.py +| ├── 📜 check_metadata.py +| ├── 📜 info.py +| ├── 📜 io.py +| ├── 📜 manipulation.py +| ├── 📜 standards.py | ├── 📁 data_transfer | ├── 📜 download_data.py | ├── 📜 upload_data.py @@ -33,7 +40,6 @@ The current software structure is described below: | ├── 📜 run_disdrodb_l0b_concat.py | ├── 📜 run_disdrodb_l0b_concat_station.py | ├── 📜 check_configs.py -| ├── 📜 check_metadata.py | ├── 📜 check_standards.py | ├── 📜 io.py | ├── 📜 issue.py diff --git a/pyproject.toml b/pyproject.toml index ba927c49..6f2ebd69 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,22 +59,22 @@ packages = ["disdrodb"] [project.scripts] # L0A -run_disdrodb_l0a_station="disdrodb.l0.scripts.run_disdrodb_l0a_station:run_disdrodb_l0a_station" -run_disdrodb_l0a="disdrodb.l0.scripts.run_disdrodb_l0a:run_disdrodb_l0a" +disdrodb_run_l0a_station="disdrodb.l0.scripts.run_disdrodb_l0a_station:run_disdrodb_l0a_station" +disdrodb_run_l0a="disdrodb.l0.scripts.run_disdrodb_l0a:run_disdrodb_l0a" # L0B -run_disdrodb_l0b_station="disdrodb.l0.scripts.run_disdrodb_l0b_station:run_disdrodb_l0b_station" -run_disdrodb_l0_station="disdrodb.l0.scripts.run_disdrodb_l0_station:run_disdrodb_l0_station" +disdrodb_run_l0b_station="disdrodb.l0.scripts.run_disdrodb_l0b_station:run_disdrodb_l0b_station" +disdrodb_run_l0_station="disdrodb.l0.scripts.run_disdrodb_l0_station:run_disdrodb_l0_station" # L0B concatenation -run_disdrodb_l0b_concat_station="disdrodb.l0.scripts.run_disdrodb_l0b_concat_station:run_disdrodb_l0b_concat_station" -run_disdrodb_l0b_concat="disdrodb.l0.scripts.run_disdrodb_l0b_concat:run_disdrodb_l0b_concat" +disdrodb_run_l0b_concat_station="disdrodb.l0.scripts.run_disdrodb_l0b_concat_station:run_disdrodb_l0b_concat_station" +disdrodb_run_l0b_concat="disdrodb.l0.scripts.run_disdrodb_l0b_concat:run_disdrodb_l0b_concat" # L0 -run_disdrodb_l0b="disdrodb.l0.scripts.run_disdrodb_l0b:run_disdrodb_l0b" -run_disdrodb_l0="disdrodb.l0.scripts.run_disdrodb_l0:run_disdrodb_l0" +disdrodb_run_l0b="disdrodb.l0.scripts.run_disdrodb_l0b:run_disdrodb_l0b" +disdrodb_run_l0="disdrodb.l0.scripts.run_disdrodb_l0:run_disdrodb_l0" # Data transfer -download_disdrodb_archive="disdrodb.data_transfer.scripts.download_disdrodb_archive:download_disdrodb_archive" -upload_disdrodb_archive="disdrodb.data_transfer.scripts.upload_disdrodb_archive:upload_disdrodb_archive" +disdrodb_download_archive="disdrodb.data_transfer.scripts.download_disdrodb_archive:download_disdrodb_archive" +disdrodb_upload_archive="disdrodb.data_transfer.scripts.upload_disdrodb_archive:upload_disdrodb_archive" # Metadata archive -disdrodb_check_metadata_archive="disdrodb.metadata.scripts.disdrodb_check_metadata_archive:disdrodb_check_metadata_archive" +disdrodb_check_metadata_archive="disdrodb.metadata.scripts.check_metadata_archive:check_metadata_archive" [tool.ruff] select = ["F", diff --git a/tutorials/reader_preparation.ipynb b/tutorials/reader_preparation.ipynb index 21ad4444..df774124 100644 --- a/tutorials/reader_preparation.ipynb +++ b/tutorials/reader_preparation.ipynb @@ -2593,13 +2593,13 @@ "To run the processing of a single station, just run: \n", " \n", "```\n", - "run_disdrodb_l0_station -l0b True -f True -v True -d False\n", + "disdrodb_run_l0_station -l0b True -f True -v True -d False\n", "```\n", "\n", "To run the processing on all stations of a given campaign, just run: \n", " \n", "```\n", - "run_disdrodb_l0 --data_sources --campaign_names -f True -v True -d False\n", + "disdrodb_run_l0 --data_sources --campaign_names -f True -v True -d False\n", "```\n", "\n", "Have a look [here](https://disdrodb.readthedocs.io/en/latest/readers.html#running-a-reader) for a full documentation on how to run specific DISDRODB L0 processing. \n",