Skip to content

Commit

Permalink
Update notification for starting plot types
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-richling committed Jan 31, 2025
1 parent 3d26b79 commit da62dba
Show file tree
Hide file tree
Showing 18 changed files with 43 additions and 19 deletions.
3 changes: 2 additions & 1 deletion lib/adf_diag.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,8 @@ def create_time_series(self, baseline=False):
"""

#Notify user that script has started:
print("\n Calculating CAM time series...")
msg = "\n Calculating CAM time series..."
print(f"{msg}\n{'-' * len(msg)}")

global call_ncrcat

Expand Down
2 changes: 1 addition & 1 deletion lib/adf_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ def __init__(self, config_file, debug=False):
#Go ahead and make the diag plot location if it doesn't exist already
diag_location = Path(plot_loc)
if not diag_location.is_dir():
print(f"\t INFO: Diagnostic Plot Location: {diag_location} not found, making new directory")
print(f"\n\tINFO: Diagnostic Plot Location: {diag_location} not found, making new directory")
diag_location.mkdir(parents=True)
#End for

Expand Down
3 changes: 2 additions & 1 deletion scripts/analysis/aerosol_gas_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ def aerosol_gas_tables(adfobj):


#Notify user that script has started:
print("\n Calculating chemistry/aerosol budget tables...")
msg = "\n Calculating chemistry/aerosol budget tables..."
print(f"{msg}\n{'-' * len(msg)}")

# Inputs
#-------
Expand Down
10 changes: 7 additions & 3 deletions scripts/analysis/amwg_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ def amwg_table(adf):

# and then in time it is DJF JJA ANN

#Notify user that script has started:
msg = "\n Calculating AMWG variable tables..."
print(f"{msg}\n{'-' * len(msg)}")

# within each domain and season
# the result is just a table of
# VARIABLE-NAME, RUN VALUE, OBS VALUE, RUN-OBS, RMSE
Expand Down Expand Up @@ -140,7 +144,7 @@ def amwg_table(adf):
#Save the baseline to the first case's plots directory:
output_locs.append(output_locs[0])
else:
print("AMWG table doesn't currently work with obs, so obs table won't be created.")
print("\t WARNING: AMWG table doesn't currently work with obs, so obs table won't be created.")
#End if

#-----------------------------------------
Expand All @@ -164,7 +168,7 @@ def amwg_table(adf):
adf.debug_log(f"DEBUG: location of files is {str(input_location)}")

#Notify user that script has started:
print(f"\n Calculating AMWG variable table for '{case_name}'...")
print(f"\n Creating table for '{case_name}'...")

#Create output file name:
output_csv_file = output_location / f"amwg_table_{case_name}.csv"
Expand Down Expand Up @@ -197,7 +201,7 @@ def amwg_table(adf):

#TEMPORARY: For now, make sure only one file exists:
if len(ts_files) != 1:
errmsg = " WARNING: Currently the AMWG table script can only handle one time series file per variable."
errmsg = "\t WARNING: Currently the AMWG table script can only handle one time series file per variable."
errmsg += f" Multiple files were found for the variable '{var}', so it will be skipped."
print(errmsg)
continue
Expand Down
3 changes: 2 additions & 1 deletion scripts/averaging/create_climo_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ def create_climo_files(adf, clobber=False, search=None):
from adf_base import AdfError

#Notify user that script has started:
print("\n Calculating CAM climatologies...")
msg = "\n Calculating CAM climatologies..."
print(f"{msg}\n{'-' * len(msg)}")

# Set up multiprocessing pool to parallelize writing climo files.
number_of_cpu = adf.num_procs # Get number of available processors from the ADF
Expand Down
3 changes: 2 additions & 1 deletion scripts/plotting/cam_taylor_diagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ def my_formatwarning(msg, *args, **kwargs):
def cam_taylor_diagram(adfobj):

#Notify user that script has started:
print("\n Generating Taylor Diagrams...")
msg = "\n Generating Taylor Diagrams..."
print(f"{msg}\n{'-' * len(msg)}")

# Taylor diagrams currently don't work for model to obs comparison
# If compare_obs is set to True, then skip this script:
Expand Down
3 changes: 2 additions & 1 deletion scripts/plotting/global_latlon_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ def global_latlon_map(adfobj):
"""

#Notify user that script has started:
print("\n Generating lat/lon maps...")
msg = "\n Generating lat/lon maps..."
print(f"{msg}\n{'-' * len(msg)}")

#
# Use ADF api to get all necessary information
Expand Down
3 changes: 2 additions & 1 deletion scripts/plotting/global_latlon_vect_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def global_latlon_vect_map(adfobj):
# - make plot

#Notify user that script has started:
print("\n Generating lat/lon vector maps...")
msg = "\n Generating lat/lon vector maps..."
print(f"{msg}\n{'-' * len(msg)}")

#
# Use ADF api to get all necessary information
Expand Down
3 changes: 2 additions & 1 deletion scripts/plotting/global_mean_timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ def global_mean_timeseries(adfobj):
"""

#Notify user that script has started:
print("\n Generating global mean time series plots...")
msg = "\n Generating global mean time series plots..."
print(f"{msg}\n{'-' * len(msg)}")

# Gather ADF configurations
plot_loc = get_plot_loc(adfobj)
Expand Down
3 changes: 2 additions & 1 deletion scripts/plotting/meridional_mean.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def meridional_mean(adfobj):
"""

#Notify user that script has started:
print("\n Generating meridional mean plots...")
msg = "\n Generating meridional mean plots..."
print(f"{msg}\n{'-' * len(msg)}")

#Extract needed quantities from ADF object:
#-----------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions scripts/plotting/ozone_diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ def my_formatwarning(msg, *args, **kwargs):

warnings.formatwarning = my_formatwarning

#Notify user that script has started:
msg = "\n Generating ozone plots..."
print(f"{msg}\n{'-' * len(msg)}")

#-----------------------------------------------------------------------------------------
#Lookup pertinent region info
#-----------------------------------------------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion scripts/plotting/polar_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ def polar_map(adfobj):
[based on global_latlon_map.py]
"""
#Notify user that script has started:
print("\n Generating polar maps...")
msg = "\n Generating polar maps..."
print(f"{msg}\n{'-' * len(msg)}")

#
# Use ADF api to get all necessary information
Expand Down
3 changes: 2 additions & 1 deletion scripts/plotting/qbo.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ def qbo(adfobj):
"""
#Notify user that script has started:
print("\n Generating qbo plots...")
msg = "\n Generating qbo plots..."
print(f"{msg}\n{'-' * len(msg)}")

#Extract relevant info from the ADF:
case_names = adfobj.get_cam_info('cam_case_name', required=True)
Expand Down
3 changes: 2 additions & 1 deletion scripts/plotting/regional_map_multicase.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ def regional_map_multicase(adfobj):
"""

# Notify user that script has started:
print("\n Generating regional contour plots ...")
msg = "\n Generating regional contour plots ..."
print(f"{msg}\n{'-' * len(msg)}")

# We need to know:
# - Variable to plot
Expand Down
3 changes: 2 additions & 1 deletion scripts/plotting/tape_recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ def tape_recorder(adfobj):
since a defualt set of obs are already being compared against in the tape recorder.
"""
#Notify user that script has started:
print("\n Generating tape recorder plots...")
msg = "\n Generating tape recorder plots..."
print(f"{msg}\n{'-' * len(msg)}")

#Special ADF variable which contains the output paths for plots:
plot_location = adfobj.plot_location
Expand Down
3 changes: 2 additions & 1 deletion scripts/plotting/tem.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ def tem(adf):
"""

#Notify user that script has started:
print("\n Generating TEM plots...")
msg = "\n Generating TEM plots..."
print(f"{msg}\n{'-' * len(msg)}")

#Special ADF variable which contains the output paths for
#all generated plots and tables for each case:
Expand Down
4 changes: 3 additions & 1 deletion scripts/plotting/zonal_mean.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ def zonal_mean(adfobj):
method to infer what the user wants.
"""

print("\n Generating zonal mean plots...")
#Notify user that script has started:
msg = "\n Generating zonal mean plots..."
print(f"{msg}\n{'-' * len(msg)}")

var_list = adfobj.diag_var_list

Expand Down
3 changes: 2 additions & 1 deletion scripts/regridding/regrid_and_vert_interp.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def regrid_and_vert_interp(adf):
# - regrid one to the other (probably should be a choice)

#Notify user that script has started:
print("\n Regridding CAM climatologies...")
msg = "\n Regridding CAM climatologies..."
print(f"{msg}\n{'-' * len(msg)}")

#Extract needed quantities from ADF object:
#-----------------------------------------
Expand Down

0 comments on commit da62dba

Please sign in to comment.