Skip to content

Commit

Permalink
Improve mwrpy
Browse files Browse the repository at this point in the history
  • Loading branch information
tukiains committed Dec 4, 2023
1 parent a18dae4 commit 9f91874
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/data_processing/subcmds/process_cloudnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,10 @@ def _get_input_files_for_voodoo(self) -> list[str]:
def process_level2(self, uuid: Uuid, product: str) -> tuple[Uuid, str]:
if product == "mwr-single":
cat_file = "mwr-l1c"
module_name = "mwr_single"
module_name = "mwr_tools"
elif product == "mwr-multi":
cat_file = "mwr-l1c"
module_name = "mwr_multi"
module_name = "mwr_tools"
elif product == "classification-voodoo":
cat_file = "categorize-voodoo"
module_name = "classification"
Expand All @@ -260,7 +260,8 @@ def process_level2(self, uuid: Uuid, product: str) -> tuple[Uuid, str]:
raise MiscError(f"Missing required input file: {cat_file}")
self._check_source_status(product, meta_record)
module = importlib.import_module(f"cloudnetpy.products.{module_name}")
fun = getattr(module, f"generate_{module_name}")
prod = product.replace("-", "_")
fun = getattr(module, f"generate_{prod}")
uuid.product = fun(categorize_file, self.temp_file.name, uuid=uuid.volatile)
identifier = utils.get_product_identifier(product)
return uuid, identifier
Expand Down
19 changes: 17 additions & 2 deletions src/data_processing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,24 @@ def get_fields_for_plot(cloudnet_file_type: str) -> tuple[list, int]:
"tb_13",
]
case "mwr-single":
fields = ["lwp", "iwv", "temperature", "absolute_humidity"]
fields = [
"lwp",
"iwv",
"temperature",
"absolute_humidity",
"relative_humidity",
"potential_temperature",
"equivalent_potential_temperature",
]
max_alt = 6
case "mwr-multi":
fields = ["temperature", "potential_temperature"]
fields = [
"temperature",
"relative_humidity",
"potential_temperature",
"equivalent_potential_temperature",
]
max_alt = 6
case "radar":
fields = [
"Zh",
Expand Down

0 comments on commit 9f91874

Please sign in to comment.