Commit 0c75436e8d86b6924edcf4897348dbbefa61faa7
1 parent
ea48da74
Exists in
rhitier-dev
Better check in vtot calculation
Showing
1 changed file
with
4 additions
and
2 deletions
Show diff stats
web/run.py
... | ... | @@ -939,8 +939,10 @@ def generate_csv_contents_spz(target_slug, input_slug, started_at, stopped_at): |
939 | 939 | |
940 | 940 | from math import sqrt |
941 | 941 | final_df = pd.concat(list_df, axis=1) |
942 | - # Is ther a vtot param ? else build it | |
943 | - if 'vtot' not in final_df.columns: | |
942 | + # build vtot param if doesnt exist | |
943 | + if 'vtot' not in final_df.columns \ | |
944 | + and 'vtan' in final_df.columns \ | |
945 | + and 'vrad' in final_df.columns: | |
944 | 946 | final_df['vtot'] = final_df.apply(lambda x: sqrt(x.vtan * x.vtan + x.vrad * x.vrad), axis=1) |
945 | 947 | |
946 | 948 | cols_ordered = ['vrad', 'vtan', 'vtot', 'btan', 'brad', 'temp', 'pdyn', 'dens', 'atse', 'xhee', 'yhee'] | ... | ... |