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
0
votes
1 answer

How to write projection info into netcdf file use xarray?

I need to use xarray to write the projection information into the netcdf file so that Iris can directly obtain the projection information when reading it. We know that there are many projection s in cartopy, such as equal latitude and longitude…
Li Ziming
  • 385
  • 2
  • 5
  • 17
0
votes
2 answers

"AttributeError: 'str' object has no attribute 'coord' - climate modelling and coding problem

so I am having some problems with my code at the minute. I am following https://github.com/ErikaWarnatzsch/Malawi-Future-Climate-Modelling-Assessment/edit/master/Histogram_TasMAX.py model to be able to build a Histogram for future RCP scenarios (4.5…
0
votes
1 answer

Why isn't my histogram showing on Jupyter notebook?

So I'm relatively new to coding and have recently taken the monstrous task of building a few climate models for my MSc thesis. Using this code I have adapted it and it now shows no error messages except now it doesn't show any figure as an output.…
0
votes
1 answer

regridding fails in iris due to coordinate system disagreement

I want to simply regrid one dataset's lat-lon values onto another and it fails with a coordinate mismatch error. Does anyone have any tips for fixing this? I've put the code and the cube descriptions at the end. Thanks! >>> esm_height =…
jonnyhtw
  • 61
  • 8
0
votes
1 answer

how to convert projection x and y coordinate in netcdf iris cube to lat lon

see question above, just want to get lat/lon for Google maps from Iris cube... cube.coord_system() LambertAzimuthalEqualArea(latitude_of_projection_origin=54.9, longitude_of_projection_origin=-2.5, false_easting=0.0, false_northing=0.0,…
mishkin
  • 5,932
  • 8
  • 45
  • 64
0
votes
1 answer

How to plot a vertical section of the atmosphere along with the topography using the Iris module?

I have a netcdf with wind speed at model levels. On the same netcdf I have the altitude of each model level. I converted netcdf to a cube, so the altitude of each level became an auxiliary coordinate. I would like to plot a cross section (longitude…
0
votes
1 answer

Why is reading from a NumPY array so slow for a CDF file

I have a simple netCDF file which has a cube of data i.e LAT, LONG ,TIME as 3 dimension and it stores Temperature. It's stored in the form of Masked Array in NumPy . Below code extracts it as CSV format. But its very slow for processing 20 MB file,…
Dave
  • 962
  • 5
  • 19
  • 44
0
votes
1 answer

Python-iris performing very slowly in reading netcdf datasets

I recently switched from netcdf4 to iris for reading netcdf files in Python (I'm using Python 2.7). On many sides this has improved my code, but I'm having some performance problems on some datasets. Reading some files (not all of them) used to take…
fedef
  • 41
  • 4
0
votes
1 answer

Failed to install scitools-iris using pip: ImportError No module named target_pkg (in pyke)

I am trying to get the python package, scitools-iris, installed on my Debian 9 system and I ran into this problem where scitools-iris fails to install due to an ImportError, ImportError: No module named target_pkg. I am using python 2.7 and all…
RogUE
  • 321
  • 2
  • 16
0
votes
2 answers

Convert netCDF into CSV using python

I am new to Python and trying to parse the netCDF file into .CSV in columanar format, so I can load that data into RDBMS for other reporting purpose. Please refer the details below. Sanpshot of my netCDF file: dimensions: time = UNLIMITED ; // (36…
user2986108
  • 95
  • 1
  • 2
  • 7
0
votes
1 answer

use iris efficiently to combine iris.analysis&aggregated while outputing time of occurence

I am using python/iris to get annual extreme values from daily data. I use aggregated_by('season_year', iris.analysis.MIN) to get the extreme values, but I need to also know when in each year they occur. I have written the code below, but this is…
sabine
  • 31
  • 2
0
votes
1 answer

Extracting a 3D derived coord to its own cube

I have loaded some data on a hybrid-p grid with iris which looks like this: specific_humidity / (1) (atmosphere_hybrid_sigma_pressure_coordinate: 48; latitude: 160; longitude: 320) Dimension coordinates: …
0
votes
1 answer

Convert calendar using iris

How can I convert a calendar with Iris? For example, converting a 'gregorian' calendar to '365_day'? At the moment, I am doing original_tcoord = cube_in.coords()[tcoord_idx] tmp_time = cf_units.num2date( original_tcoord.points, …
zeb
  • 3
  • 2
0
votes
3 answers

Plotting Elevation in Python

I'm trying to create a map of Malawi with altitude shown. Something like this, but of Malawi of course: I have downloaded some elevation data from here: http://research.jisao.washington.edu/data_sets/elevation/ This is a print of that data after I…
ErikaAWT
  • 67
  • 2
  • 14
0
votes
1 answer

Python Matplotlib creating a custom colour scale

I have created a map of precipitation levels in a region based on precipitation data from NetCDF files. I would like to add a custom scale such that if precipitation is less than 800mm it would be one colour, 800-1000mm another, etc. Similar to the…
ErikaAWT
  • 67
  • 2
  • 14