Skip to content

Commit

Permalink
Add MissingInputData exception
Browse files Browse the repository at this point in the history
  • Loading branch information
tukiains committed Aug 14, 2023
1 parent b95bf94 commit 4e9e32e
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions mwrpy/level2/write_lev2_nc.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
Fill_Value_Int = -99


class MissingInputData(Exception):
pass


def lev2_to_nc(
data_type: str,
lev1_file: str,
Expand Down Expand Up @@ -164,9 +168,10 @@ def get_products(
0
] # type: ignore
if len(index) == 0:
raise RuntimeError(
["No suitable data found for processing for data type: " + data_type]
raise MissingInputData(
f"No suitable data found for processing for data type: {data_type}"
)

coeff["retrieval_elevation_angles"] = str(
np.sort(np.unique(ele_retrieval(elevation_angle[index], coeff)))
)
Expand Down Expand Up @@ -266,8 +271,8 @@ def get_products(
0
] # type: ignore
if len(index) == 0:
raise RuntimeError(
["No suitable data found for processing for data type: " + data_type]
raise MissingInputData(
f"No suitable data found for processing for data type: {data_type}"
)
coeff["retrieval_elevation_angles"] = str(
np.sort(np.unique(ele_retrieval(elevation_angle[index], coeff)))
Expand Down Expand Up @@ -376,8 +381,8 @@ def get_products(
)

if len(ibl) == 0:
raise RuntimeError(
["No suitable data found for processing for data type: " + data_type]
raise MissingInputData(
f"No suitable data found for processing for data type: {data_type}"
)

index = ibl[:, -1] # type: ignore
Expand Down

0 comments on commit 4e9e32e

Please sign in to comment.