-
Notifications
You must be signed in to change notification settings - Fork 2
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
'TransientCurveGrid' object has no attribute 'getWeights' #23
Comments
I'm not even sure cdutil.averager can handle irregular grids. @doutriaux1 ? It's probably better to use the |
@doutriaux1 can you help @yyplanton with this question. |
@gleckler1 @durack1 Any comment welcome. Maybe |
@yyplanton GFDL did not use CMOR in CMIP5. While they were able to mimic it very well, we have run across subtle discrepancies. Can you show us your CDAT code, i.e., what is in your function CDUTILaverager? |
@yyplanton @jypeter You are right JY, use MV.multiply(areacello, tos) ... cdutil does not yet work on native grids |
@yyplanton cdutil.averager only works with rectinlinear grids, not oceanic grids. There's no plans to immediately adapt it, although it's a good idea. But you would need to somehow provide weights. @dnadeau4 could we use esmf to generate the weights? globalGrid = cdms2.createGlobalMeanGrid(cdms2.createGaussianGrid(128))
mean = data.regrid(globalGrid) |
Ok, thanks for the answers. |
I'm surprised that it works with a TransientCurveGrid! @doutriaux1 @dnadeau4 does I have just remembered an old related question: in the case when |
@yyplanton I am surprised it works for curvilinear grid, can you send me the line you use. I suspect what you're actually doing is a straight average of the cell, not an area weighted average. |
It is interesting to see that CNRM-CM5 is working with `cdutil.averager'. For curiosity, I simply visualized
VCS plot (CDAT 3.0 beta version): @doutriaux1 Why VCS plot show zonal band of missing values? Other question would be, (sorry not related to this issue though) does CDAT 3.0 use boxfill with discrete color as default? |
@yyplanton not sure how Code:
Error:
Axes checking
|
@lee1043 the orca grid has redundant points on the edges that could cause the zonal band. See how I had to massage the data in CDAT/cdat#1465 (comment), in order to plot orca data |
Any update for this? @yyplanton and @lee1043 is revisiting this issue with |
@yyplanton @lee1043 thanks for pushing on this, there are a couple of open bugs that are hitting similar issues with ocean grids, so when this issue is closed these will also likely be closed: And just for completeness a couple of closed issues: |
@durack1 thanks for the information. I will keep on eyes on those issues as well. |
Marking issue as stale, since there has been no activity in 30 days. Unless the issue is updated or the 'stale' tag is removed, this issue will be closed in 7 days. |
This is another grid issue, just like CDAT/genutil#32, CDAT/genutil#6 and CDAT/genutil#5, there are likely more examples, such as CDAT/cdat#1833, #23 etc etc |
Marking issue as stale, since there has been no activity in 30 days. Unless the issue is updated or the 'stale' tag is removed, this issue will be closed in 7 days. |
Hi,
I am trying to use the cdutil.averager function on cmip5 datasets.
Out of 43 models tested, 6 (BBC and GFDL models) return the same error when averaging oceanic variables (like 'tos')
I am using Transient Variables (MV2s) so weights must be generated:
Traceback (most recent call last):
File "test.py", line 15, in
d_ave_xy = CDUTILaverager(tos, axis='xy')
File "/usr/local/uvcdat/2.4.0/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/genutil/averager.py", line 1078, in averager
filled_wtoptions = __check_weightoptions(V, axis, weights)
File "/usr/local/uvcdat/2.4.0/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/genutil/averager.py", line 359, in __check_weightoptions
weightoptions = area_weights(x,axisoptions)
File "/usr/local/uvcdat/2.4.0/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/genutil/averager.py", line 159, in area_weights
latwts, lonwts = dsgr.getWeights()
AttributeError: 'TransientCurveGrid' object has no attribute 'getWeights'
Here is the grid:
I do not have the same problem when using other TransientCurveGrid models like CNRM-CM5
Models returning errors:
bcc-csm1-1-m, bcc-csm1-1, GFDL-CM2p1, GFDL-CM3, GFDL-ESM2G, GFDL-ESM2M
A common point between these models is that they use GFDL’s Modular Ocean Model (MOM) or Generalized Ocean Layer Dynamics (GOLD) (only GFDL-ESM2G).
Is there a problem with GFDL's ocean models? Is this error known?
Thanks
Yann
The text was updated successfully, but these errors were encountered: