-
Notifications
You must be signed in to change notification settings - Fork 53
Adds SSS model vs obs capability #55
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
Conversation
@milenaveneziani In testing this PR, there was an issue using the Aquarius data in the project space on edison. Could you check permissions on that file? |
@vanroekel and @milenaveneziani, this branch will need to be updated to use variable and stream maps like in #52. Depending on how you want to handle the merges, we would either want to update this branch after #52 gets merged or merge this branch and then update #52 to handle these additions. Let me know which it will be. |
@xylar and @milenaveneziani , given that this PR is a fairly quick change, I would say to merge #52 and then I'll update here. |
good catch @vanroekel: I now fixed the permissions for the Aquarius data file. |
@vanroekel, I am happy to review this once it is rebased following completion of other PRs if that is helpful. |
@vanroekel and @pwolfram, note that there will be conflicts and additional development required, so it's not going to be a simple rebase. There are 2 options, and I'm fine with either:
Why don't we see how it goes with 1 and I'll bail you out if it doesn't go well. |
@xylar and @vanroekel, I'm happy to contribute here too so that we can spread the work / knowledge around if that is helpful. |
@vanroekel, why would you close this PR and open up a new one? It sounds like the purpose of this PR should be the same so I don't think this is necessary but I could be missing something. |
Okay. I imagined the code being so different as to require a new PR, but I see what you are saying about the actual purpose of the PR being the same so keeping it. Thanks for the clarification. |
@pwolfram @xylar @milenaveneziani should I attempt the rebase for this PR after #52 is merged or wait for others as well? |
@vanroekel, my understanding is that #48 needs merged, then #52. This code will obviously need functionality in both merges, so my intuition is to wait for now but @xylar and @milenaveneziani should correct me if I'm wrong. |
@vanroekel, you have a few options:
I'm generally impatient and want to get as much done as possible so I'd personally choose 1. That doesn't really mean it's the smarter option, though. There should be no other PRs you need to wait for after #52 before updating this PR. No surprises in the works. |
@vanroekel, #48 and #52 have now been merged so we can directly move forward with this PR following a rebase. |
Thanks @pwolfram, working on this now. |
@xylar and @pwolfram in working on the update here, I have a question. I see that
should change to
In order to follow the changes in #52. Could I ask the advantage of one over the other? |
@vanroekel, please see https://pyformat.info/. Note, we need this for #43 |
@vanroekel, my understanding is that the https://docs.python.org/3.1/library/string.html#format-examples |
This adds a comparison of model data against Aquarius monthly output (2011 - 2014).
7ae2eda
to
998b5ca
Compare
@xylar and @pwolfram thanks for the excellent explanations. It certainly seems like the new .format is much more extensible in addition to the python 3 compliance. @pwolfram and @milenaveneziani , this branch should be ready to review again. I've tested against alpha8 and beta0. Annual SSS from alpha8 is Annual SSS from beta0 (same time periods) The config.analysis script I used for the tests is at /global/homes/l/lvroekel/config.analysis_SSS_edisontest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vanroekel, thanks for the clean PR. I have a few very minor comments to clean it up further but overall the code looks good.
The biggest comment is that it would be good, if possible, to somehow reproduce the xarray / dask error so that we can submit an issue and get that weird bug fixed. However, this obviously isn't a high-priority.
cmapModelObs = RdYlBu_r | ||
# colormap for differences | ||
#cmapDiff = RdBu_r | ||
cmapDiff = coolwarm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vanroekel, do we really need all the commented lines above? The same is true below too...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My recommendation would be to keep this file as clean as possible by only having comments as absolutely necessary to help avoid confusion in the long term.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pwolfram and @vanroekel, I agree that I don't love having these commented out options in the default config file. Ideally comments should be for clarification rather than alternative options, and instead we would have alternative config files or scripts for modifying config files or something along those lines for changing color maps, etc.
But I also know that this convention has been used for other modelvsobs entries so it's probably not something to address in this specific case but rather to clean up more broadly later on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me.
|
||
# The following line converts from DASK to numpy to supress an odd | ||
# warning that doesn't influence the figure output | ||
ds_tslice.SSS.values |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventually we will be able to remove this line, most likely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to submit an xarray / dask bug report if we could get a simple xarray or dask - only reproducible manifestation of this error if possible. However, this may be time consuming and not worth it, at least in the short-term.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pwolfram not sure if this is helpful information, but I can also suppress this warning if I open the SSS observations with xr.open_dataset instead of xr.open_mfdataset. It's curious that the multiple file version of open throws a warning for SSS, but not for SST or MLD.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is some type of dask-xarray integration error. Getting to the bottom of it will potentially be tricky. I'd say pass on this for now.
@@ -20,7 +20,7 @@ | |||
oceanVariableMap['avgLayerTemperature'] = \ | |||
['time_avg_avgValueWithinOceanLayerRegion_avgLayerTemperature', | |||
'time_avg_avgValueWithinOceanLayerRegion_avgLayerTemperature_1', | |||
'timeMonthly_avg_avgValueWithinOceanLayerRegion_avgLayerTemperature'] | |||
'timeMonthly_avg_avgValueWithinOceanLayerRegion_avgLayerTemperature'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto for me too!
@vanroekel, looks good to me. As you probably noticed, it's a little weird that we're mapping variables Anyway, I think this should be addressed with a separate PR that also fixes what I did for |
@milenaveneziani, this is ready to merge as far as I'm concerned. |
This adds a comparison to Aquarius monthly observations. This has been tested against beta0 in the updateTimeseries branch. This is a clean PR against develop. I retested against an alpha8 run and things appear to be working. My config.analysis for testing on edison is at /global/homes/l/lvroekel/config.analysis_SSS_edisontest