Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
216 changes: 112 additions & 104 deletions lib/adf_dataset.py

Large diffs are not rendered by default.

541 changes: 59 additions & 482 deletions lib/adf_variable_defaults.yaml

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions scripts/analysis/amwg_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ def amwg_table(adf):
#Save the baseline to the first case's plots directory:
output_locs.append(output_locs[0])
else:
baseline_name = "Obs"
print("\t WARNING: AMWG table doesn't currently work with obs, so obs table won't be created.")
#End if

Expand Down Expand Up @@ -203,8 +204,10 @@ def amwg_table(adf):
print(f"\t - Variable '{var}' being added to table")

#Create list of time series files present for variable:
ts_filenames = f'{case_name}.*.{var}.*nc'
ts_files = sorted(input_location.glob(ts_filenames))
if case_name == baseline_name:
ts_files = adf.data.get_ref_timeseries_file(var)
else:
ts_files = adf.data.get_timeseries_file(case_name, var)

# If no files exist, try to move to next variable. --> Means we can not proceed with this variable, and it'll be problematic later.
if not ts_files:
Expand All @@ -221,9 +224,8 @@ def amwg_table(adf):
continue
#End if

#Load model variable data from file:
ds = utils.load_dataset(ts_files)
data = ds[var]
#Load model variable data array:
data = adf.data.load_da(ts_files, var, case_name, type="tseries")

#Extract units string, if available:
if hasattr(data, 'units'):
Expand Down
4 changes: 2 additions & 2 deletions scripts/plotting/adf_histogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def get_load_args(adfobj, case, variablename):
# output: variable(season, region, bin)

# "reference case" first:
ref_land = load_ref_func(*get_load_args(adfobj, adfobj.data.ref_case_label, "LANDFRAC"))
ref_land = load_ref_func(*get_load_args(adfobj, "LANDFRAC"))
for var in var_list:

ref_hist_file = plot_loc / f"{adfobj.data.ref_case_label}_{var}_{plot_name_string}.nc"
Expand All @@ -122,7 +122,7 @@ def get_load_args(adfobj, case, variablename):
vres = {}

# probably have to make sure no "lev" dim (but gets confused about other dimensions)
da = load_ref_func(*get_load_args(adfobj, adfobj.data.ref_case_label, var))
da = load_ref_func(*get_load_args(adfobj, var))
if da is None:
print(f"failed to load {var} for {adfobj.data.ref_case_label}... skip")
continue
Expand Down
2 changes: 1 addition & 1 deletion scripts/plotting/aod_latlon.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def process_model_cases(adfobj, var, obs_data):
def process_model_data(adfobj, case_name, var, obs_shape):
"""Process model data and check grid compatibility."""
if case_name == adfobj.data.ref_case_label:
ds_case = adfobj.data.load_reference_climo_da(case_name, var)
ds_case = adfobj.data.load_reference_climo_da(var)
else:
ds_case = adfobj.data.load_climo_da(case_name, var)
if ds_case is None:
Expand Down
2 changes: 1 addition & 1 deletion scripts/plotting/global_latlon_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def load_reference_data(adfobj, var):
return None
base_name = adfobj.data.ref_labels[var]

odata = adfobj.data.load_reference_regrid_da(base_name, var)
odata = adfobj.data.load_reference_regrid_da(var)
if odata is None:
print(f"\t WARNING: No reference data found for {var}")
return None
Expand Down
2 changes: 1 addition & 1 deletion scripts/plotting/polar_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def polar_map(adfobj):
print(f"\t Skipping {var} - all plots already exist")
continue

odata = adfobj.data.load_reference_regrid_da(base_name, var)
odata = adfobj.data.load_reference_regrid_da(var)
if odata is None:
print(f"\t WARNING: No reference data found for {var}")
continue
Expand Down
2 changes: 1 addition & 1 deletion scripts/plotting/zonal_mean.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def zonal_mean(adfobj):
base_name = adfobj.data.ref_labels[var]

# Gather reference variable data
odata = adfobj.data.load_reference_regrid_da(base_name, var)
odata = adfobj.data.load_reference_regrid_da(var)

#Check if regridded file exists, if not skip zonal plot for this var
if odata is None:
Expand Down