Skip to content

Commit

Permalink
Per #2769, update to tc_diag_driver version 0.11.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnHalleyGotway committed Dec 15, 2023
1 parent 79654f0 commit 1a9dac9
Show file tree
Hide file tree
Showing 9 changed files with 493 additions and 261 deletions.
8 changes: 5 additions & 3 deletions scripts/python/tc_diag/config/post_resample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,23 +100,25 @@ pressure_independent_computation_specs:
callable: *div_vort_func
output_vars: [850DVRG, 850VORT]
kwargs: {u_name: *u_vert_name, v_name: *v_vert_name, level_hPa: 850, radius_km: *div_vort_max_km}
units: [/S, /S]
div_vort_200:
callable: *div_vort_func
output_vars: [200DVRG, 200VORT]
kwargs: {u_name: *u_vert_name, v_name: *v_vert_name, level_hPa: 200, radius_km: *div_vort_max_km}
units: [/S, /S]


shear:
batch_order: 1
callable: tc_diag_driver.met_diag_vars.shear
output_vars: [SHR_MAG, SHR_HDG]
kwargs: {u_name: u, v_name: v, bottom_hPa: 850, top_hPa: 200}
kwargs: {u_name: U, v_name: V, bottom_hPa: 850, top_hPa: 200}
unit_converters: [tc_diag_driver.met_post_process.mps_to_kt, pass]
units: [KT, DEG]
TGRD:
batch_order: 1
callable: tc_diag_driver.met_diag_vars.temperature_gradient
kwargs: {u_name: u, v_name: v, bottom_hPa: 850, top_hPa: 700}
kwargs: {u_name: U, v_name: V, bottom_hPa: 850, top_hPa: 700}
units: "10^7C/M"

sounding_computation_specs:
Expand Down Expand Up @@ -161,4 +163,4 @@ comment_format: |
* 850VORT, 200DVRG averaged from {div_vort_min}-{div_vort_max} km around storm center [x10^7 /s, x10^7 /s] *
* 850TANG averaged from {rad_tan_min}-{rad_tan_max} km around storm center [x10 m/s] *
* T, R, Z, P averaged from {therm_min}-{therm_max} km around storm center [x10 C, %, dm, mb] *
* TPW averaged from {tpw_min}-{tpw_max} km around storm center [mm] *
* TPW averaged from {tpw_min}-{tpw_max} km around storm center [mm] *
8 changes: 5 additions & 3 deletions scripts/python/tc_diag/config/post_resample_nest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,23 +100,25 @@ pressure_independent_computation_specs:
callable: *div_vort_func
output_vars: [850DVRG, 850VORT]
kwargs: {u_name: *u_vert_name, v_name: *v_vert_name, level_hPa: 850, radius_km: *div_vort_max_km}
units: [/S, /S]
div_vort_200:
callable: *div_vort_func
output_vars: [200DVRG, 200VORT]
kwargs: {u_name: *u_vert_name, v_name: *v_vert_name, level_hPa: 200, radius_km: *div_vort_max_km}
units: [/S, /S]


shear:
batch_order: 1
callable: tc_diag_driver.met_diag_vars.shear
output_vars: [SHR_MAG, SHR_HDG]
kwargs: {u_name: u, v_name: v, bottom_hPa: 850, top_hPa: 200}
kwargs: {u_name: U, v_name: V, bottom_hPa: 850, top_hPa: 200}
unit_converters: [tc_diag_driver.met_post_process.mps_to_kt, pass]
units: [KT, DEG]
TGRD:
batch_order: 1
callable: tc_diag_driver.met_diag_vars.temperature_gradient
kwargs: {u_name: u, v_name: v, bottom_hPa: 850, top_hPa: 700}
kwargs: {u_name: U, v_name: V, bottom_hPa: 850, top_hPa: 700}
units: "10^7C/M"

sounding_computation_specs:
Expand Down Expand Up @@ -161,4 +163,4 @@ comment_format: |
* 850VORT, 200DVRG averaged from {div_vort_min}-{div_vort_max} km around storm center [x10^7 /s, x10^7 /s] *
* 850TANG averaged from {rad_tan_min}-{rad_tan_max} km around storm center [x10 m/s] *
* T, R, Z, P averaged from {therm_min}-{therm_max} km around storm center [x10 C, %, dm, mb] *
* TPW averaged from {tpw_min}-{tpw_max} km around storm center [mm] *
* TPW averaged from {tpw_min}-{tpw_max} km around storm center [mm] *
2 changes: 1 addition & 1 deletion scripts/python/tc_diag/tc_diag_driver/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.9.0"
__version__ = "0.11.0"
15 changes: 15 additions & 0 deletions scripts/python/tc_diag/tc_diag_driver/computation_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,21 @@ def get_result_names(computations: List[DiagComputation]) -> List[str]:
return names


def get_all_result_units(
pressure_indedpendent: List[DiagComputation], sounding: List[DiagComputation]
) -> Tuple[List[str], List[str]]:
pi_var_units = get_result_units(pressure_indedpendent)
snd_var_units = get_result_units(sounding)
return pi_var_units, snd_var_units


def get_result_units(computations: List[DiagComputation]) -> List[str]:
units = []
for c in computations:
units.extend(c.units)
return units


def get_computation_batches(
pressure_indedpendent: List[DiagComputation], sounding: List[DiagComputation]
) -> List[ComputationBatch]:
Expand Down
Loading

0 comments on commit 1a9dac9

Please sign in to comment.