Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix different vertical level conflict when plotting Tape Recorder #318

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

justin-richling
Copy link
Collaborator

@justin-richling justin-richling commented Jul 18, 2024

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

Remove this code because if the cases have different number of vertical levels, then the concat datasets will cause problems (they will combine the levels into the new lev dim).

```python
#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')
```

Also clean up code for readability, and change data read in (plus CESM time fix) to new data class method.
@justin-richling justin-richling changed the title Fix different vert level conflict when plotting Fix different vert level conflict when plotting Tape Recorder Jul 18, 2024
@justin-richling justin-richling changed the title Fix different vert level conflict when plotting Tape Recorder Fix different vertical level conflict when plotting Tape Recorder Jul 18, 2024
@justin-richling justin-richling merged commit b0e1c4c into NCAR:main Jul 18, 2024
7 checks passed
@justin-richling justin-richling deleted the tape-recorder-bug-fix branch July 19, 2024 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When comparing runs with different vertical grid: tape recorder plot is buggy
1 participant