Skip to content

Commit

Permalink
Add config file for BGC scripts, prevent -inf when taking log10, savi…
Browse files Browse the repository at this point in the history
…ng regional figures in main figures dir
  • Loading branch information
Utheri Wagura authored and Utheri Wagura committed Nov 14, 2024
1 parent 412bbb2 commit 6e9882b
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 3 deletions.
2 changes: 1 addition & 1 deletion diagnostics/biogeochemistry/NWA12/chl_eval_regional.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def plot_chl_regional(pp_root, label, config, dev):
cbar.set_ticks([0.25, 0.5, 1, 2, 4, 8])
cbar.set_ticklabels([0.25, 0.5, 1, 2, 4, 8])
logger.info("Saving figure")
save_figure('regional_chl', label=label)
save_figure('regional_chl', label=label, output_dir = "../figures")


if __name__ == '__main__':
Expand Down
4 changes: 2 additions & 2 deletions diagnostics/biogeochemistry/chl_eval.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Compare model surface chla with data from occci-v6.0.
How to use:
python chl_eval.py -p /archive/acr/fre/NWA/2023_04/NWA12_COBALT_2023_04_kpo4-coastatten-physics/gfdl.ncrc5-intel22-prod -c ../physics/config.yaml
python chl_eval.py -p /archive/acr/fre/NWA/2023_04/NWA12_COBALT_2023_04_kpo4-coastatten-physics/gfdl.ncrc5-intel22-prod -c config.yaml
"""

import cartopy.crs as ccrs
Expand Down Expand Up @@ -52,7 +52,7 @@ def plot_chl(pp_root, label, config, dev):
# Flip to right side up.
# satellite = satellite.isel(lat=slice(None, None, -1))
log_model = np.log10(np.maximum(model_climo, 1e-14))
log_sat = np.log10(satellite)
log_sat = np.log10(np.maximum(satellite,1e-14))
logger.info("SATELITE: %s",satellite)
logger.info("Successfully opened model grid and calculated climotology")

Expand Down
35 changes: 35 additions & 0 deletions diagnostics/biogeochemistry/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# ------------- Dataset Locations and Variables ---------------
model_grid: '../data/geography/ocean_static.nc'

# ------------ Domain and General Plotting Details --------------

# Xlim/ylim to plot
x:
min: -99
max: -35

y:
min: 4
max: 59

# Projection ( current options are either NorthPolarStereo or PlateCarree )
projection_grid: 'PlateCarree'
projection_data: 'PlateCarree'

# Location of skill score annotations in plot
text_x: -98.5
text_y: 54

# Space between skill score text
text_xint: 4 # This is unused if col=1, so it is only included for completeness
text_yint: 4
plot_lat: False

# --------------- Script specific settings -----------------
# ---- chl_eval settings
chl_satellite: '/work/acr/occci-v6.0/oc-cci_chl_19970901_20191130_climo.nc'
chl_start: '1997-09-01'
chl_end: '2019-11-30'
chl_ticks: [-4, -2, -1, -0.5, -0.1, 0, 0.1, 0.5, 1, 2, 4]
chl_ticks_labels: ['-4', '-2', '-0.5', '0', '0.5', '2', '4']
chl_cbar_ticks: [0.25, 0.5, 1, 2, 4, 8]

0 comments on commit 6e9882b

Please sign in to comment.