1

Has anyone here used MetPy with rotated latitude longitude coordinates? Is it possible? What I am trying to accomplish is to make vertical cross sections of my data. I opened my netCDF file with xr.open_dataset:

Dimensions:       (bnds: 2, level: 80, level1: 81, rlat: 127, rlon: 162, srlat: 127, srlon: 161, time: 48)
Coordinates:
  * time          (time) datetime64[ns] 2019-03-07T08:00:00 ... 2019-03-07T19:45:00
    lon           (rlat, rlon) float32 ...
    lat           (rlat, rlon) float32 ...
    slonu         (rlat, srlon) float32 ...
    slatu         (rlat, srlon) float32 ...
    slonv         (srlat, rlon) float32 ...
    slatv         (srlat, rlon) float32 ...
  * rlon          (rlon) float64 -1.385 -1.375 -1.365 ... 0.205 0.215 0.225
  * rlat          (rlat) float64 -0.995 -0.985 -0.975 ... 0.245 0.255 0.265
  * srlon         (srlon) float64 -1.38 -1.37 -1.36 -1.35 ... 0.19 0.2 0.21 0.22
  * srlat         (srlat) float64 -1.0 -0.99 -0.98 -0.97 ... 0.23 0.24 0.25 0.26
Dimensions without coordinates: bnds, level, level1
Data variables:
    time_bnds     (time, bnds) datetime64[ns] ...
    rotated_pole  int32 ...
    vcoord        (level1) float32 ...
    TOT_PREC      (time, rlat, rlon) float32 ...
    TOT_PR        (time, rlat, rlon) float32 ...
    SNOW_GSP      (time, rlat, rlon) float32 ...
    PRS_GSP       (time, rlat, rlon) float32 ...
    GRAU_GSP      (time, rlat, rlon) float32 ...
    PRG_GSP       (time, rlat, rlon) float32 ...
    PRR_GSP       (time, rlat, rlon) float32 ...
    RELHUM        (time, level, rlat, rlon) float32 ...
    U             (time, level, rlat, srlon) float32 ...
    V             (time, level, srlat, rlon) float32 ...
    W             (time, level1, rlat, rlon) float32 ...
...

When I parse then dataset then I get the following error: KeyError: 'perspective_point_height'. For some reason there is no altitude or level in the Coordinates and I imagine that the parse function then can't find any height coordinate? How can I add the vertical levels to the Coordinates?

I have also used a dataset where the altitude is specified in the Coordinates, but then when I try to do a cross_section then I get the following: ValueError: Unhandled projection: rotated_latitude_longitude. Is there a way that MetPy could work with rotated pole coordinates?

Zane
  • 23
  • 1
  • 5
  • I think we need more information on what you're trying to accomplish with MetPy to understand where the problem might be. – DopplerShift Nov 07 '19 at 18:18

1 Answers1

0

The error with perspective_point_height is because (I'm assuming) the data declare the projection as geostationary, but it doesn't have that attribute...which seems odd.

With the Unhandled projection error, that's just because MetPy hasn't had that projection added as one it understands and can convert to CartoPy.

In both cases, it seems like there are ways that MetPy can better handle this, can you open a bug over on MetPy's Issue Tracker? Depending on what exactly is going on in the data, there likely will be some workarounds we can point you to.

DopplerShift
  • 5,472
  • 1
  • 21
  • 20