diff --git a/e3sm_diags/derivations/formulas.py b/e3sm_diags/derivations/formulas.py index e1621f965..78db38f99 100644 --- a/e3sm_diags/derivations/formulas.py +++ b/e3sm_diags/derivations/formulas.py @@ -175,6 +175,9 @@ def qflx_convert_to_lhflx_approxi(var: xr.DataArray): new_var = var * 2.5e6 new_var.name = "LHFLX" + new_var.attrs["units"] = "W/m2" + new_var.attrs["long_name"] = "Surface latent heat flux" + return new_var diff --git a/e3sm_diags/driver/tc_analysis_driver.py b/e3sm_diags/driver/tc_analysis_driver.py index d696796fd..5658db7d3 100644 --- a/e3sm_diags/driver/tc_analysis_driver.py +++ b/e3sm_diags/driver/tc_analysis_driver.py @@ -195,6 +195,9 @@ def generate_tc_metrics_from_te_stitch_file(te_stitch_file: str) -> Dict[str, An end_ind = line_ind[-1] lines = lines_orig[0:end_ind] + if not lines: + raise ValueError(f"The file {te_stitch_file} is empty.") + # Calculate number of storms and max length num_storms, max_len = _calc_num_storms_and_max_len(lines) # Parse variables from TE stitch file