NCAR / ADF

A unified collection of python scripts used to generate standard plots from CAM outputs.
Creative Commons Attribution 4.0 International
36 stars 30 forks source link

Fix different vertical level conflict when plotting Tape Recorder #318

Closed justin-richling closed 4 months ago

justin-richling commented 4 months ago

As @cecilehannay pointed out in #301, in the Tape Recorder plot, if the test cases have different vertical levels the plots get messed up. This fix will remove this code

#Check to see if any cases were successful
if runname_LT:
    runname_LT=xr.DataArray(runname_LT, dims='run', coords=[np.arange(0,len(runname_LT),1)], name='run')
    alldat_concat_LT = xr.concat(alldat, dim=runname_LT)

because the xr.concat datasets is what is causing the problems. They will combine the levels of all cases into the new lev dim, ie case1 has 70 levels and case2 has 93 levels, the final xr.concat(alldat, dim=runname_LT) will cause the 'lev' dim to be 163.

Also clean up code for readability, and change data read in (plus CESM time fix) to new data class method.

Closes #301