Skip to content

Commit

Permalink
addressing code review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
brianpm committed Jan 8, 2024
1 parent 3a6e4f4 commit 2fb7924
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/adf_diag.py
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ def derive_variables(self, vars_to_derive=None, ts_dir=None, overwrite=None):
print(
f"[{__name__}] Warning: PRECT file was found and overwrite is False. Will use existing file."
)
return None
continue
# append PRECC to the file containing PRECL
os.system(f"ncks -A -v PRECC {constit_files[0]} {constit_files[1]}")
# create new file with the sum of PRECC and PRECL
Expand Down Expand Up @@ -1073,10 +1073,10 @@ def derive_variables(self, vars_to_derive=None, ts_dir=None, overwrite=None):
print(
f"[{__name__}] Warning: RESTOM file was found and overwrite is False. Will use existing file."
)
return None
continue
# append FSNT to the file containing FLNT
os.system(f"ncks -A -v FLNT {constit_files[0]} {constit_files[1]}")
# create new file with the sum of FLNT and FSNT
# create new file with the difference of FLNT and FSNT
os.system(
f"ncap2 -s 'RESTOM=(FSNT-FLNT)' {constit_files[1]} {derived_file}"
)
2 changes: 1 addition & 1 deletion lib/adf_variable_defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ QRS:
#+++++++++++++++++
RESTOM:
colormap: "RdBu_r"
contour_levels_range: [-10, 10, 0.5]
contour_levels_range: [-100, 100, 5]
diff_colormap: "seismic"
diff_contour_range: [-10, 10, 0.5]
scale_factor: 1
Expand Down
2 changes: 0 additions & 2 deletions scripts/analysis/amwg_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,7 @@ def amwg_table(adf):
#----------------------------
if 'RESTOM' in var_list:
table_df = pd.read_csv(output_csv_file)
idx = table_df.index[table_df['variable'] == 'RESTOM'].tolist()[0]
table_df = pd.concat([table_df[table_df['variable'] == 'RESTOM'], table_df]).reset_index(drop = True)
table_df = table_df.drop([idx+1]).reset_index(drop=True)
table_df = table_df.drop_duplicates()
table_df.to_csv(output_csv_file, header=cols, index=False)
#End if
Expand Down

0 comments on commit 2fb7924

Please sign in to comment.