Skip to content

Commit 0c14be9

Browse files
authored
Enforce time end interval (#248)
* Update resampler for time being measurement interval end * Update time block creation for time being end of measurement interval
1 parent c7f6169 commit 0c14be9

24 files changed

Lines changed: 708 additions & 111 deletions

File tree

disdrodb/api/path.py

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,13 @@ def define_filename(
705705
"""
706706
from disdrodb.api.checks import check_product, check_product_kwargs, check_temporal_resolution
707707

708+
# Retrieve temporal resolution
709+
if product == "L0C":
710+
temporal_resolution = product_kwargs.pop("temporal_resolution", "XXX")
711+
else:
712+
temporal_resolution = product_kwargs.get("temporal_resolution", "")
713+
714+
# Check product
708715
product = check_product(product)
709716
product_kwargs = check_product_kwargs(product, product_kwargs)
710717

@@ -715,9 +722,8 @@ def define_filename(
715722
# Define product name
716723
product_name = f"{product}"
717724

718-
# L0C ... sample interval known only per-file
719-
if product in ["L1", "L2E", "L2M"]:
720-
temporal_resolution = product_kwargs.get("temporal_resolution")
725+
# Temporal resolution required from L0C onwards
726+
if product in ["L0C", "L1", "L2E", "L2M"]:
721727
check_temporal_resolution(temporal_resolution)
722728
product_name = f"{product}.{temporal_resolution}"
723729
if product in ["L2M"]:
@@ -810,10 +816,19 @@ def define_l0c_filename(ds, campaign_name: str, station_name: str, sample_interv
810816
"""Define L0C file name."""
811817
temporal_resolution = define_temporal_resolution(sample_interval, rolling=False)
812818
starting_time, ending_time = get_file_start_end_time(ds)
813-
starting_time = starting_time.strftime("%Y%m%d%H%M%S")
814-
ending_time = ending_time.strftime("%Y%m%d%H%M%S")
815-
version = ARCHIVE_VERSION
816-
filename = f"L0C.{temporal_resolution}.{campaign_name}.{station_name}.s{starting_time}.e{ending_time}.{version}.nc"
819+
filename = define_filename(
820+
product="L0C",
821+
campaign_name=campaign_name,
822+
station_name=station_name,
823+
# Filename options
824+
start_time=starting_time,
825+
end_time=ending_time,
826+
add_version=True,
827+
add_time_period=True,
828+
add_extension=True,
829+
# Product options
830+
temporal_resolution=temporal_resolution,
831+
)
817832
return filename
818833

819834

disdrodb/etc/products/L2E/LPM/global.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ product_options:
2222
below_velocity_tolerance: 3
2323
maintain_drops_smaller_than: 1
2424
maintain_drops_slower_than: 2.5
25-
maintain_smallest_drops: True
25+
maintain_smallest_drops: False
2626
remove_splashing_drops: True
2727
radar_enabled: False
2828
radar_options:

disdrodb/etc/products/L2E/LPM_V0/global.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ product_options:
2222
below_velocity_tolerance: 3
2323
maintain_drops_smaller_than: 1
2424
maintain_drops_slower_than: 2.5
25-
maintain_smallest_drops: True
25+
maintain_smallest_drops: False
2626
remove_splashing_drops: True
2727
radar_enabled: False
2828
radar_options:

disdrodb/etc/products/L2E/ODM470/global.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ product_options:
2222
below_velocity_tolerance: 3
2323
maintain_drops_smaller_than: 1
2424
maintain_drops_slower_than: 2.5
25-
maintain_smallest_drops: True
25+
maintain_smallest_drops: False
2626
remove_splashing_drops: True
2727
radar_enabled: False
2828
radar_options:

disdrodb/etc/products/L2E/PARSIVEL/global.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ product_options:
2222
below_velocity_tolerance: 3
2323
maintain_drops_smaller_than: 1
2424
maintain_drops_slower_than: 2.5
25-
maintain_smallest_drops: True
25+
maintain_smallest_drops: False
2626
remove_splashing_drops: True
2727
radar_enabled: False
2828
radar_options:

disdrodb/etc/products/L2E/PARSIVEL2/global.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ product_options:
2222
below_velocity_tolerance: 3
2323
maintain_drops_smaller_than: 1
2424
maintain_drops_slower_than: 2.5
25-
maintain_smallest_drops: True
25+
maintain_smallest_drops: False
2626
remove_splashing_drops: True
2727
radar_enabled: False
2828
radar_options:

disdrodb/etc/products/L2E/PWS100/global.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ product_options:
2222
below_velocity_tolerance: 3
2323
maintain_drops_smaller_than: 1
2424
maintain_drops_slower_than: 2.5
25-
maintain_smallest_drops: True
25+
maintain_smallest_drops: False
2626
remove_splashing_drops: True
2727
radar_enabled: False
2828
radar_options:

disdrodb/etc/products/L2E/RD80/1MIN.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ product_options:
1515
below_velocity_tolerance: 3
1616
maintain_drops_smaller_than: 1
1717
maintain_drops_slower_than: 2.5
18-
maintain_smallest_drops: True
18+
maintain_smallest_drops: False
1919
remove_splashing_drops: True

disdrodb/etc/products/L2E/SWS250/1MIN.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ product_options:
1515
below_velocity_tolerance: 3
1616
maintain_drops_smaller_than: 1
1717
maintain_drops_slower_than: 2.5
18-
maintain_smallest_drops: True
18+
maintain_smallest_drops: False
1919
remove_splashing_drops: True

disdrodb/etc/products/L2E/global.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ product_options:
2222
below_velocity_tolerance: 3
2323
maintain_drops_smaller_than: 1
2424
maintain_drops_slower_than: 2.5
25-
maintain_smallest_drops: True
25+
maintain_smallest_drops: False
2626
remove_splashing_drops: True
2727
radar_enabled: False
2828
radar_options:

0 commit comments

Comments
 (0)