[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[python #JLP-746251]: Day 3 of AMS Python Short Course Follow-up



Greetings!

I'm not familiar with pp files, so I'm not sure if there is any code for 
directly reading them with xarray.

I would expect the IRIS->XArray translation to work with `parse_cf()`, 
*provided* that this results in appropriate netCDF Climate and Forecasting (CF) 
metadata defining the grid projection being present in the XArray dataset. If 
that metadata is not present, you can assign it to the dataset using 
`.metpy.assign_crs()` instead of calling `parse_cf()`. For more information, 
see the MetPy Xarray Tutorial:

  
https://unidata.github.io/MetPy/latest/tutorials/xarray_tutorial.html#coordinates-and-coordinate-reference-systems

Hope this helps,

Ryan

> Hi both,
> 
> I have a (maybe silly) question, which follows on from the concepts we've
> covered in the classes so far. Thanks again for putting on such a great
> workshop!
> 
> I work a lot with Met Office Unified Model data (mostly pp format,
> sometimes nc), so naturally use Iris and the cube notation. Now that I've
> seen the incredible range of MetPy functionality in the past week, I'd like
> to tap into that more generally.
> 
> I guess the question can be split in two:
> 
> - Is it possible to read pp files directly in using xarray and then
> process using MetPy, skipping my current Iris-based structure?
> - In trying to work out an answer to the first question, I managed to
> convert data from an Iris cube into an xarray DataArray
> (xarray.DataArray.from_iris), but I've not been able to succesfully use
> metpy.parse_cf() to get the data in the right format to create plots
> (working from this example:
> https://unidata.github.io/MetPy/latest/examples/cross_section.html). Are
> there some additional steps required when initially working with pp files?
> Would these issues be solved by converting to nc before inputting?

Ticket Details
===================
Ticket ID: JLP-746251
Department: Support Python
Priority: Low
Status: Closed
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata 
inquiry tracking system and then made publicly available through the web.  If 
you do not want to have your interactions made available in this way, you must 
let us know in each email you send to us.