Skip to main content

Questions tagged [xarray]

xarray is a Python module for working with N-dimensional arrays

1 vote
1 answer
1k views

Add lat and lon to DataArray read in by rioxarray

I downloaded a GeoTIFF from here: https://www.nass.usda.gov/Research_and_Science/Crop_Progress_Gridded_Layers/index.php (file also available: https://drive.google.com/file/d/1XcfEw-...
Rafael's user avatar
  • 125
1 vote
1 answer
422 views

Changes to GDAL NetCDF driver between 3.2 and 3.4

I am preparing data in python using xarray and rioxarray, then exporting to NetCDF. On one machine with micha@RMS:Kinneret$ gdalinfo --version GDAL 3.2.2, released 2021/03/05 the extent of the ...
Micha's user avatar
  • 15.7k
4 votes
0 answers
79 views

Looking up whole time-series for specific point from 45 GB file

I want to look-up 8760 times for a single lat/lon combo in less than a second from 43.82 GB file of wind data containing: 8760 times (every hour in a year) 721 latitudes (every 0.25° from -90.0° to ...
user212905's user avatar
0 votes
1 answer
337 views

How to apply a function on two rasters in Python?

I would like to cell-wise function operation on two rasters. While I saw some examples of adding or subtracting two rasters, I'm yet to come across a complex example of how to manipulate rasters using ...
PPR's user avatar
  • 521
0 votes
1 answer
2k views

Xarray computing of a new variable on the basis of the existing one

I have netcdf file with calculated average temperature (°F). My goal is to create new data variable within the same file with cooling / heating degree days using that average. This format is totally ...
nomad_gis's user avatar
0 votes
1 answer
71 views

NetCDF stretched along Y (latitude) axis

I'm working with NOAA temperature NetCDF files and trying limit area of interest to the US area only using bounding box. In Jupyter Notebook I wrote few lines to do it and on the plot everything looks ...
nomad_gis's user avatar
0 votes
1 answer
3k views

Create one NetCDF file from multiple NetCDF files using Python [closed]

I am downloading climate data in NetCDF format. For each variable (e.g. 'precipitation'), I need to merge 9 NetCDFs, each belonging to an unique climate model. Each NetCDF has the same size (time, lat,...
CrossLord's user avatar
  • 215
1 vote
1 answer
3k views

How to deal with Nan value when using rioxarray rio.reproject()?

I was trying to use rio.reproject_match() to match the resolution of two xarray datasets. However, when I used resample methods like Resampling.bilinear or Resampling.average, a large area would ...
QRW's user avatar
  • 53
2 votes
1 answer
300 views

Pixel-based regression using xarray has incorrect P-value, but everything else is correct

I am using the code from this website to perform a regression on each pixel of an image time-series of rain and NDVI. The code works for everything, that is the outputs match the outputs of scipy, for ...
SoupBones's user avatar
2 votes
1 answer
738 views

Convert GeoTIFF to Zarr Store using Xarray

I am trying to convert my 3-band GeoTIFF to Zarr store. I am able to read in the GeoTIFF from xarray with rasterio backend. In [1]: import xarray as xr In [2]: xtci = xr.open_dataset('tci.tif', ...
Aman Bagrecha's user avatar
0 votes
0 answers
860 views

Combine two raster datasets from different areas - xarray

I simply wish to combine two raster datasets from different spatial extents and with different coordinate reference systems using python. Eventually, I wish to combine enumerable datasets, but ...
Sean Carter's user avatar
2 votes
1 answer
2k views

Xarray Dataset to raster - ValueError: failed to prevent overwriting existing key grid_mapping in attrs

I have a netcdf file located here http://thredds.northwestknowledge.net:8080/thredds/catalog/TERRACLIMATE_ALL/data/catalog.html?dataset=TERRACLIMATE_ALL_SCAN/data/TerraClimate_tmin_1958.nc. I am ...
Stefano Potter's user avatar
1 vote
1 answer
2k views

Increase map size with subplots and Cartopy

I try to make subplot maps with Cartopy using data from xarray tutorial and increase each map in vertical size, but failed. Also making colorbar at each specific subplots. import matplotlib.pyplot as ...
Tuyen's user avatar
  • 211
2 votes
1 answer
459 views

Unable to convert Sentinel-5P NetCDF file to GeoTIFF using xarray python

I am trying to convert Sentinel-5P NetCDF file (available at https://drive.google.com/file/d/1dJdhQspdI3p5YyyiBBiNxUPCCOU91QrU/view?usp=sharing) to GeoTIFF using the following code: import xarray ...
RRSC NGP's user avatar
  • 658
0 votes
1 answer
1k views

Why do rioxarray reprojection and pyproj transform give different values when selecting a pixel by point coordinates?

I'm opening this grib file using rioxarray and reprojecting to WGS84 in the following manner with the goal of grabbing pixel values by coordinates. import rioxarray url = 'https://noaa-hrrr-bdp-pds....
JWB's user avatar
  • 604

15 30 50 per page
1 2 3
4
5
9