ADF icon indicating copy to clipboard operation
ADF copied to clipboard

AdfData class for streamlined I/O in plotting scripts

Open brianpm opened this issue 1 year ago • 0 comments

This PR introduces a new class called ADFData in lib/adf_dataset.py. This class is instantiated with an ADFDiag instance. It is intended to hold most of the boilerplate code that is in the plotting scripts to set paths and load data. It also abstracts the treatment of "obs" and "baseline" into something that looks more unified (at least to the plotting scripts). The upshot is that using this class can reduce the amount of code in plotting scripts. As examples, I've added zonal_mean_B.py and global_latlon_map_B.py. These are refactors of the current versions that now use ADFData, and both are quite a bit shorter in the B versions. In limited testing, I think they are producing the same output.

NOTE I see that create_climo_files.py also appears to be changed here. I don't know why. That should not be part of this PR... I did a sync with ADF so I thought I was completely up to date. I think the changes in that file were developed to help @justin-richling with an issue with the climatology years. The code looks right, but I wasn't intending it to be part of this PR. (It can be if we double check it.)

brianpm avatar Dec 01 '23 20:12 brianpm