From 296036941611d037c908b2febbbf2df01e8f6f0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Longchamp?= <97044425+regislon@users.noreply.github.com> Date: Mon, 8 May 2023 17:54:08 +0200 Subject: [PATCH] refactor() : update doc (#184) --- disdrodb/l0/io.py | 13 +++- disdrodb/l0/issue.py | 40 ++++++++++- disdrodb/l0/l0_processing.py | 2 + docs/source/api/disdrodb.l0.rst | 8 +++ docs/source/metadata.rst | 29 ++++---- docs/source/overview.rst | 119 -------------------------------- docs/source/readers.rst | 10 +-- 7 files changed, 80 insertions(+), 141 deletions(-) diff --git a/disdrodb/l0/io.py b/disdrodb/l0/io.py index a2a45d26..162f5591 100644 --- a/disdrodb/l0/io.py +++ b/disdrodb/l0/io.py @@ -946,7 +946,18 @@ def _check_pre_existing_station_data(campaign_dir, product_level, station_name, def check_processed_dir(processed_dir): - # Check input, format and validity of the directory path + """Check input, format and validity of the directory path + + Parameters + ---------- + processed_dir : str + Path of the processed directory + + Returns + ------- + str + Path of the processed directory + """ processed_dir = _check_is_processed_dir(processed_dir) return processed_dir diff --git a/disdrodb/l0/issue.py b/disdrodb/l0/issue.py index b8bf4bca..345f7b9f 100644 --- a/disdrodb/l0/issue.py +++ b/disdrodb/l0/issue.py @@ -33,17 +33,53 @@ def is_numpy_array_string(arr): - """Check if the numpy array contains strings.""" + """Check if the numpy array contains strings + + Parameters + ---------- + arr : numpy array + Numpy array to check. + """ + dtype = arr.dtype.type return dtype == np.str_ or dtype == np.unicode_ def is_numpy_array_datetime(arr): + """Check if the numpy array contains datetime64 + + Parameters + ---------- + arr : numpy array + Numpy array to check. + + Returns + ------- + numpy array + Numpy array checked. + """ return arr.dtype.type == np.datetime64 def _check_timestep_datetime_accuracy(timesteps, unit="s"): - """Check the accuracy of the numpy datetime array.""" + """Check the accuracy of the numpy datetime array. + + Parameters + ---------- + timesteps : numpy array + Numpy array to check. + unit : str, optional + Unit, by default "s" + + Returns + ------- + numpy array + Numpy array checked. + + Raises + ------ + ValueError + """ if not timesteps.dtype == f" | Name of the sensor (e.g. OTT_Parsivel, OTT_Parsivel2, Thies_LPM, RD_80) | -+-------+------------------------------------+--------------------------------------------------------------------------------------------------------------+ -| 📜 | *.yml | YAML files defining sensorCharacteristics (e.g. diameter and velocity bins) | -+-------+------------------------------------+--------------------------------------------------------------------------------------------------------------+ -| 📁 | manuals | Folder for the Official disdrometers documentation | -+-------+------------------------------------+--------------------------------------------------------------------------------------------------------------+ -| 📜 | *.pdf | Official disdrometers documentation | -+-------+------------------------------------+--------------------------------------------------------------------------------------------------------------+ -| 📁 | readers | Folder that contains all the readers functions | -+-------+------------------------------------+--------------------------------------------------------------------------------------------------------------+ -| 📁 | | e.g. GPM, ARM, EPFL, ... | -+-------+------------------------------------+--------------------------------------------------------------------------------------------------------------+ -| 📜 | .py | Readers to transform raw data into DISDRODB L0 products | -+-------+------------------------------------+--------------------------------------------------------------------------------------------------------------+ -| 📁 | scripts | Contains a set of python scripts to beCalled from the terminal to launch the L0 processing | -+-------+------------------------------------+--------------------------------------------------------------------------------------------------------------+ -| 📜 | run_disdrodb_l0_station.py | Script launching the L0 processing for a specific station | -+-------+------------------------------------+--------------------------------------------------------------------------------------------------------------+ -| 📜 | run_disdrodb_l0 | Script launching the L0 processing for specific portion of the DISDRODB archive | -+-------+------------------------------------+--------------------------------------------------------------------------------------------------------------+ -| 📜 | run_disdrodb_l0a.py | Script to run the L0A processing of DISDRODB stations | -+-------+------------------------------------+--------------------------------------------------------------------------------------------------------------+ -| 📜 | run_disdrodb_l0a_station.py | Script to run the L0A processing of a specific DISDRODB station from the terminal | -+-------+------------------------------------+--------------------------------------------------------------------------------------------------------------+ -| 📜 | run_disdrodb_l0b.py | Script to run the L0B processing of DISDRODB stations | -+-------+------------------------------------+--------------------------------------------------------------------------------------------------------------+ -| 📜 | run_disdrodb_l0b_station.py | Script to run the L0B processing of a specific DISDRODB station from the terminal | -+-------+------------------------------------+--------------------------------------------------------------------------------------------------------------+ -| 📜 | run_disdrodb_l0b_concat.py | Script to run the L0BConcatenation of available DISDRODB stations | -+-------+------------------------------------+--------------------------------------------------------------------------------------------------------------+ -| 📜 | run_disdrodb_l0b_concat_station.py | Script toConcatenate all L0B files of a specific DISDRODB station into a single netCDF | -+-------+------------------------------------+--------------------------------------------------------------------------------------------------------------+ -| 📁 | l1 | Code not yet implemented. It willContain software to homogenize and qualityCheck DISDRODB L0 products | -+-------+------------------------------------+--------------------------------------------------------------------------------------------------------------+ -| 📁 | l2 | Code not yet implemented. It willContain software to produce DISDRODB L2 products (i.e. DSD parameters, ...) | -+-------+------------------------------------+--------------------------------------------------------------------------------------------------------------+ -| 📁 | tests | Folder containing the tests (readers and unit tests) | -+-------+------------------------------------+--------------------------------------------------------------------------------------------------------------+ -| 📁 | utils | Folder to gather small, reusable functions orClasses | -+-------+------------------------------------+--------------------------------------------------------------------------------------------------------------+ -| 📜 | logger.py | Logger functions | -+-------+------------------------------------+--------------------------------------------------------------------------------------------------------------+ -| 📜 | scripts.py | Utility functions to run python scripts into the terminal | -+-------+------------------------------------+--------------------------------------------------------------------------------------------------------------+ -| 📜 | netcdf.py | Utility function toCheck and merge/concat multiple netCDF4 files | -+-------+------------------------------------+--------------------------------------------------------------------------------------------------------------+ - - - -Description of the other folders -================================================ - -Some other folder are included in the DISDRODB repository. Here is a short description of their content: - -* data : sample data to test the DISDRODB L0 l0_processing -* docs : documentation of the DISDRODB L0 processing -* tutorials : Jupyter notebooks to illustrate the DISDRODB L0 processing diff --git a/docs/source/readers.rst b/docs/source/readers.rst index 54a9d5b2..1e2a1e0b 100644 --- a/docs/source/readers.rst +++ b/docs/source/readers.rst @@ -80,18 +80,18 @@ A reader is a function defined by the following input arguments: * ``raw_dir`` : str - The directory path where all the raw data of a specific campaign/network are stored. - * The path must have the following structure: `<...>/DISDRODB/Raw//`. + * The path must have the following structure: ``<...>/DISDRODB/Raw///data//` - * `/metadata/.yml` + * ``/data//`` + * ``/metadata/.yml`` * ``processed_dir`` : str - The desired directory path where to save the DISDRODB L0A and L0B products. - * The path should have the following structure: `<...>/DISDRODB/Processed//` + * The path should have the following structure: ``<...>/DISDRODB/Processed//`` * The must match with the one specified in the raw_dir path. - * For reader testing purposes, you can define i.e. `/tmp/DISDRODB/Processed//` + * For reader testing purposes, you can define i.e. ``/tmp/DISDRODB/Processed//`` * ``station_name`` : str - Name of the station to be processed.