From 0c75436e8d86b6924edcf4897348dbbefa61faa7 Mon Sep 17 00:00:00 2001 From: Richard Hitier Date: Fri, 27 Oct 2023 16:00:49 +0200 Subject: [PATCH] Better check in vtot calculation --- web/run.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/run.py b/web/run.py index dbb512b..9fe4325 100755 --- a/web/run.py +++ b/web/run.py @@ -939,8 +939,10 @@ def generate_csv_contents_spz(target_slug, input_slug, started_at, stopped_at): from math import sqrt final_df = pd.concat(list_df, axis=1) - # Is ther a vtot param ? else build it - if 'vtot' not in final_df.columns: + # build vtot param if doesnt exist + if 'vtot' not in final_df.columns \ + and 'vtan' in final_df.columns \ + and 'vrad' in final_df.columns: final_df['vtot'] = final_df.apply(lambda x: sqrt(x.vtan * x.vtan + x.vrad * x.vrad), axis=1) cols_ordered = ['vrad', 'vtan', 'vtot', 'btan', 'brad', 'temp', 'pdyn', 'dens', 'atse', 'xhee', 'yhee'] -- libgit2 0.21.2