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

Spherical Harmonic GRIB #560

Closed
bblay opened this issue Jun 18, 2013 · 8 comments
Closed

Spherical Harmonic GRIB #560

bblay opened this issue Jun 18, 2013 · 8 comments

Comments

@bblay
Copy link
Contributor

bblay commented Jun 18, 2013

Iris can't read spherical harmonic GRIB files.

Requested by a user with a high urgency for use in a collaborative paper on a recent atmospheric event.

@esc24
Copy link
Member

esc24 commented Jun 18, 2013

Can you point us towards any sample data in the public domain?

@bblay
Copy link
Contributor Author

bblay commented Jun 18, 2013

Note: This template does not define a grid. We could consider:

  • something like pyspharm to convert it to a grid
  • adding spherical harmonics to the CF data model

@bblay
Copy link
Contributor Author

bblay commented Jun 18, 2013

Can you point us towards any sample data in the public domain?

SciTools/iris-test-data#11

@bblay
Copy link
Contributor Author

bblay commented Jun 18, 2013

adding spherical harmonics to the CF data model

CF might already be able to store spherical harmonic data but I suspect it would just be data arrays with no special "meaning". I think we'd need a prescribed way of defining spherical harmonic data if we were to pursue this.

@ajdawson
Copy link
Member

Spherical harmonic data naturally don't have a grid since they represent wavenumber components. Typically there might be an associated transform grid (which in the case of your example file I think is an N320 gaussian grid) which would be defined by the spectral truncation (which is T639 in your example). Transforms to other girds are of course possible, and even desirable depending upon the specific scenario.

Using pyspharm to automatically transform to a grid is an option but not without its issues:

  • It is feasible that the user may actually want spectral coefficients.
  • What grid do you transform to? This might depend on numerous factors such as the transform algorithm used in the model (e.g., did it use a regular or a guasian transform grid?).
  • pyspharm uses spherepack which uses single-precision under the hood, meaning it can't handle transforms of large spectral truncations, it might even struggle with your T639 example data.

I personally think it would be best to represent spectral data in CF, but I'm not sure exactly what would need to be done to achieve this. I guess the data would be represented as a 1D complex array, with two 1D auxiliary coordinates which give you the zonal wavenumber and degree of the spherical harmonic component that is represented by each coefficient. The user could then transform this after reading it to whatever grid they want, using pyspharm or otherwise.

@ajdawson
Copy link
Member

it might even struggle with your T639 example data

Actually it seems OK at this resolution (latitude: 640, longitude:1280) I managed to transform and plot it. I had to use legfunc='computed' to save memory when initializing a Spharmt object, but otherwise it seems OK.

@rhattersley
Copy link
Member

I personally think it would be best to represent spectral data in CF

That's my gut reaction too. And from what I've seen, the CF community are not opposed to such a thing given a demonstrable need for it. We (or perhaps preferably the user with the data) would need to put the specifics forward on the CF mailing list. A starting candidate for the encoding would probably help ignite the discussion. It mostly goes without saying, but in doing this we'd have to keep a close eye on the impact on Iris.

@bblay
Copy link
Contributor Author

bblay commented Jun 20, 2013

Many thanks for the input.

I must close this issue because:

  • It needs to be driven by the CF spec.
  • The user's goalposts have shifted(!).

@bblay bblay closed this as completed Jun 20, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants