Questions tagged [python-iris]

Iris seeks to provide a powerful, easy to use, and community-driven Python library for analysing and visualising meteorological and oceanographic data sets. NOTE: This is not the tag to use if your question relates to the common Iris dataset (often relating to machine learning). This tag is for the tool found at https://github.com/scitools/iris

With Iris you can:

  • Use a single API to work on your data, irrespective of its original format.
  • Read and write (CF-)netCDF, GRIB, and PP files.
  • Easily produce graphs and maps via integration with matplotlib and cartopy.

Visit https://scitools-iris.readthedocs.io/en/latest/ for the latest documentation.

74 questions
13
votes
1 answer

Create Iris Cube from a fileobject or netCDF4 dataset

Is there a way to create (open/load) an Iris Cube using a fileobject (binary stream), or alternatively, from a netCDF4 dataset object? Specifically, I have a file served over a URL, but not by an OpenDAP server; iris.load_cube() & friends fail on…
9769953
  • 10,344
  • 3
  • 26
  • 37
5
votes
2 answers

Python: using polygons to create a mask on a given 2d grid

I have some polygons (Canadian provinces), read in with GeoPandas, and want to use these to create a mask to apply to gridded data on a 2-d latitude-longitude grid (read from a netcdf file using iris). An end goal would be to only have data for a…
Ian Ashpole
  • 325
  • 3
  • 16
5
votes
1 answer

Plotting wind vectors on vertical cross-section with matplotlib

I've searched high and low but cannot find another answer to this question. I'm trying to visualise output from the Met Office's Unified Model over the Antarctic Peninsula. At the moment, I have a longitudinal cross section, with potential…
Shakka
  • 51
  • 1
  • 4
3
votes
2 answers

Error: Command '['dot', '-V']' returned non-zero exit status -5 When using Iris

After I installed the package Iris with conda install -c scitools iris, Whether using Ipython console or Jupyter notebook, the iris was always failed to import. The error subroutine shows like: …
Han Zhengzu
  • 3,694
  • 7
  • 44
  • 94
2
votes
0 answers

Iris - iris.pandas error: 'real_datetime' object has no attribute 'nanosecond'

When using: iris.pandas.as_series() or iris.pandas.as_dataframe() to convert a 1d cube to pandas series or dataframe, I am suddenly getting the following error: 'real_datetime' object has no attribute 'nanosecond' Here is a minimal reproducible…
Disting
  • 43
  • 1
  • 6
2
votes
1 answer

Constraint Mismatch Error

I am running the following code to create a simple line graph: import matplotlib.pyplot as plt import iris import iris.coord_categorisation as iriscc import iris.plot as iplt import iris.quickplot as qplt import iris.analysis.cartography import…
ErikaAWT
  • 67
  • 2
  • 14
2
votes
1 answer

Is it possible to create an iris constraint based on cell_methods?

This just came up, I have an answer but I wanted to share it here... "Is it possible to create an iris constraint based on cell_methods?" I have a datafile which loads producing many cubes. I would like to extract only those containing ensemble…
pp-mo
  • 468
  • 2
  • 8
2
votes
2 answers

Computing an index (heat index) in Iris from mismatched units?

I'm new to the Iris library and need to compute a heat index, which is a multivariate non-linear function of temperature and relative humidity that goes something like $HI = temp +rh + temp*rh + temp^2 *rh + rh^2*temp $ . Here, temp has units of…
Anna S.
  • 153
  • 2
  • 7
2
votes
1 answer

Mask cube with features

I want to plot data from a global cube, but only for a list of countries. So I select a subcube according to the countries' "bounding box". So far so good. What I'm looking for is an easy way to mask out all points of a cube which do not fall in…
andreas-h
  • 10,679
  • 18
  • 60
  • 78
2
votes
3 answers

python Iris in linux

I just started using Iris, (and also Mac OS), and installed other modules using pip install module_name over the terminal. I did the same for Iris, but when I try to use: import iris.plot as iplt an error came up: ImportError: No…
Fir Nor
  • 163
  • 2
  • 13
2
votes
1 answer

Can you change iris cube projections in cartopy

I really like the idea that cartopy can automatically plot in different map projections. However, I couldn't figure out how to do with the Iris cubes. As its a sister project, I expected that I might be able to. Is it possible to do something like…
nrob
  • 861
  • 1
  • 8
  • 22
1
vote
1 answer

How to convert auxiliary coordinates to dimension coordinates in a cube in iris?

I am pretty new to using NetCDF Jules output files. I am trying to write a routine to create multiple plots visualising the output from my simulations. After reading in the cubes I have the following format: filename =…
1
vote
1 answer

Udunits2 installation in python

I am working on some climate data simulations for which I need conservative remapping algorithm. This algorithm is available in cf-python library. But cf python requires udunits2 package as one of its dependencies. On searching a lot, I found that…
Urja
  • 23
  • 5
1
vote
1 answer

Regridding from one irregular lat lon grid to another irregular lat lon grid

I have two sets of satellite data. For both sets, I have the pixel geometry (latitude and longitude of each corner of the pixel). I would like to regrid one set to the other. Thus, my goal is area-weighted regridding from an irregular grid to…
Nick
  • 11
  • 1
1
vote
0 answers

how to create a lambda layer for iris and its dependencies?

I want to process netCDF files inside an AWS lambda function and I need to use iris. My plan is to create a lambda layer that has iris and it's dependencies installed. I am able to create a layer but its always complaining for a missing package when…
Nisman
  • 1,271
  • 2
  • 26
  • 56
1
2 3 4 5