Skip to content

Commit 71d96e1

Browse files
authored
Add final tests (#231)
* Add new readers * Add Biral SWS250 configuration files * Add new L2M configuration files * Improve sensor configurations * Improve plot_nd function * Improve tests * Ensure keeps only second accuracy in dataset time * Ensure correct time encoding * Improve L2M fitting routines * Add SWS150 sensor into optical sensors * Ensure rounding of summary table statistics * Solve some codacy issues * Ensure xarray dataset is saved with datetime[s] * Improve L0 config files tests * Improve L0 config files tests * Improve L2M logs and lognormal PSD GS fitting * Add ULiege reader * Finalize L1 tests * Update env for bottleneck
1 parent dceb2f4 commit 71d96e1

107 files changed

Lines changed: 5547 additions & 800 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ci/environment.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ dependencies:
1616
- scipy
1717
- dask[distributed]
1818
- xarray
19+
- bottleneck
20+
- flox
1921
- tectonic
2022
- matplotlib-base
2123
# Docs

ci/environment_latest.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ dependencies:
1616
- pandas
1717
- dask[distributed]
1818
- xarray
19+
- bottleneck
20+
- flox
1921
- tectonic
2022
- matplotlib-base
2123
# Docs

disdrodb/api/create_directories.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ def create_l0_directory_structure(
8585
``product = "L0A"`` will call ``run_l0a``.
8686
``product = "L0B"`` will call ``run_l0b_nc``.
8787
"""
88-
from disdrodb.configs import get_data_archive_dir, get_metadata_archive_dir
89-
9088
# Retrieve the DISDRODB Metadata Archive directory
9189
data_archive_dir = get_data_archive_dir(data_archive_dir)
9290
metadata_archive_dir = get_metadata_archive_dir(metadata_archive_dir)

disdrodb/cli/disdrodb_create_summary.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,22 @@
3939
@click_data_archive_dir_option
4040
@click_metadata_archive_dir_option
4141
@click.option("-p", "--parallel", type=bool, show_default=True, default=False, help="Read files in parallel")
42+
@click.option(
43+
"-t",
44+
"--temporal_resolution",
45+
type=str,
46+
show_default=True,
47+
default="1MIN",
48+
help="Temporal resolution of the L2E product to be used for the summary.",
49+
)
4250
def disdrodb_create_summary(
4351
# Stations options
4452
data_sources: Optional[str] = None,
4553
campaign_names: Optional[str] = None,
4654
station_names: Optional[str] = None,
4755
# Processing options:
4856
parallel=False,
57+
temporal_resolution="1MIN",
4958
# DISDRODB root directories
5059
data_archive_dir: Optional[str] = None,
5160
metadata_archive_dir: Optional[str] = None,
@@ -92,6 +101,7 @@ def disdrodb_create_summary(
92101
station_names=station_names,
93102
# Options
94103
parallel=parallel,
104+
temporal_resolution=temporal_resolution,
95105
# DISDRODB root directory
96106
data_archive_dir=data_archive_dir,
97107
metadata_archive_dir=metadata_archive_dir,

disdrodb/cli/disdrodb_create_summary_station.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,22 @@
3636
@click_station_arguments
3737
@click_data_archive_dir_option
3838
@click.option("-p", "--parallel", type=bool, show_default=True, default=False, help="Read files in parallel")
39+
@click.option(
40+
"-t",
41+
"--temporal_resolution",
42+
type=str,
43+
show_default=True,
44+
default="1MIN",
45+
help="Temporal resolution of the L2E product to be used for the summary.",
46+
)
3947
def disdrodb_create_summary_station(
4048
# Station arguments
4149
data_source: str,
4250
campaign_name: str,
4351
station_name: str,
4452
# Processing options:
4553
parallel=False,
54+
temporal_resolution="1MIN",
4655
# DISDRODB root directories
4756
data_archive_dir: Optional[str] = None,
4857
):
@@ -81,6 +90,7 @@ def disdrodb_create_summary_station(
8190
station_name=station_name,
8291
# Options
8392
parallel=parallel,
93+
temporal_resolution=temporal_resolution,
8494
# DISDRODB root directory
8595
data_archive_dir=data_archive_dir,
8696
)

disdrodb/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"time",
4242
"sample_interval",
4343
]
44-
OPTICAL_SENSORS = ["PARSIVEL", "PARSIVEL2", "LPM", "PWS100"]
44+
OPTICAL_SENSORS = ["PARSIVEL", "PARSIVEL2", "LPM", "PWS100", "SWS250"]
4545
IMPACT_SENSORS = ["RD80"]
4646

4747
PRODUCTS = ["RAW", "L0A", "L0B", "L0C", "L1", "L2E", "L2M"]

disdrodb/etc/products/L1/global.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
product_options:
2-
fall_velocity_method: "Beard1976"
2+
fall_velocity_model: "Beard1976"
33
minimum_diameter: 0
44
maximum_diameter: 10
55
minimum_velocity: 0
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
radar_enabled: True

disdrodb/etc/products/L2E/global.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
temporal_resolutions: ["1MIN", "5MIN", "10MIN", "ROLL1MIN"]
1+
temporal_resolutions: [1MIN"] # "5MIN", "10MIN", "ROLL1MIN"]
22
archive_options:
33
strategy: time_block
44
strategy_options:
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
psd_model: "GammaPSD"
2+
optimization: "GS"
3+
optimization_kwargs:
4+
target: "ND"
5+
transformation: "identity"
6+
error_order: 1

0 commit comments

Comments
 (0)