Skip to main content

Questions tagged [xarray]

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

0 votes
1 answer
66 views

QGIS crashes with "bad_alloc" when processing NetCDF file using xarray

I need to merge multiple NetCDF files in a QGIS plugin I am developing. I'm using xarray to do so, however, QGIS crashes with the error "Critical: Caught unhandled std::exception: std::bad_alloc&...
Francis Lapointe's user avatar
0 votes
0 answers
44 views

Change dtype of coordinates NetCDF

I was wondering how to change the dtype from float32 to float64 of coordinates. I can run the following code in the terminal ncap2 -s 'lat=double(lat); lon=double(lon)' infile.nc outfile.nc How ever ...
sss's user avatar
  • 1
0 votes
1 answer
279 views

Transform ee.ImageCollection to xr.Dataset in Python (via Colab)

I am trying to transform an ee.ImageCollection (Landsat) for a Region of Interest into an xr.Dataset so I can further process the data and ultimately export as a .csv. I have tried using the library ...
richard.turner's user avatar
0 votes
1 answer
603 views

Extract nearest values from NetCDF file in Python

I have a NetCDF database (link to file) obtained from Copernicus Climate Data of ~43k unevenly spaced values around the world. Instead of being indexed using (lat, lon) it uses a sequence of 'stations'...
terauser's user avatar
0 votes
0 answers
57 views

How to open NetCDF4-CF files from SMAP in xarray

I've downloaded a list of netCDF4-CF files from SMAP (Following this guide in jupyter notebook) to get daily soil moisture data over 2020 in South Sudan. The result is a series of .nc files that I ...
Nick Slanec's user avatar
1 vote
0 answers
100 views

Landsat from Planetary Computer unexpectedly turns up all no data in some regions

Using some code that gathers Landsat 8 collections from Microsoft Planetary Computer into Open Data Cube xarray using a stac search works fine in some regions but in others returns all nan values. ...
jeremyg19's user avatar
  • 317
1 vote
0 answers
387 views

Loading geospatial datasets with rioxarray

I'm using xarray to open and reproject some .grib files. The files have x, y, and time dimensions and contain several data variables. However, I have some issues with loading the data. Loading them ...
Felix's user avatar
  • 11
-1 votes
1 answer
58 views

Extending raster after rasterizing geodataframe using geocube

I have created rasterized a geodataframe using geocube make_geocube. The resulting xr.Dataset now has the extent of the underlying geodataframe vector data. Say, the bounding box would be covering ...
ChipChap's user avatar
0 votes
1 answer
77 views

GeoTIFF from Dataset is very weight and with three bands instead of one

I need to compute the NDVI from an xarray Dataset created using this solution. I've used a for loop to read all the GeoTIFFs in my folder and the result is this: <xarray.Dataset> Dimensions: ...
MaxDragonheart's user avatar
0 votes
1 answer
358 views

Memory filled with Xarray concat function

I'm facing in trouble related to the limit of my RAM. On my PC I have 32GB of RAM that is totaly filled from the concat of some DataArray. I've create e simple function below to read a single band of ...
MaxDragonheart's user avatar
1 vote
1 answer
222 views

Using Python (in Colab), how to convert a multiband ee.Image into an ee.ImageCollection?

I ultimately want to convert an ee.Image to an xarray object so I can further process the data. I know the library wxee can do that with ee.ImageCollection.wx.to_xarray(). However, it requires an ee....
Camila's user avatar
  • 21
1 vote
0 answers
177 views

Saving extracted array into new NetCDF file

I have a NetCDF file which looks like this: <xarray.Dataset> Dimensions: (time: 180, d2: 2, lat: 180, lon: 360) Coordinates: * time (time) object 2000-01-15 12:00:00 ... 2014-12-15 12:...
gis_grad_student's user avatar
0 votes
0 answers
364 views

Using rioxarray clip_box function does not return anything

I am trying to clip an xarray dataarray (or dataset, either one) to a bounding box using the rioxarray clip_box() function. My dataarray is 24 hours of temperature data for the continental US. My ...
yeet_man's user avatar
1 vote
1 answer
1k views

Interpolate irregularly sampled data to a regular grid

I'm using .nc files with spatially referenced timeseries data in xarray, i.e. inherently 3-dimensional data (lat, lon, time). My issue is, that the dataset's coordinates lat and lon are merged to a ...
Jonny32418's user avatar
0 votes
1 answer
596 views

Saving plot from .nc file without showing the plot

I am trying to save the sequence of plots of 24 hours of ERA5 data from .nc file without plotting them. I am using xarray for reading .nc data. Here is my code: import xarray as xr import matplotlib....
pwnkit's user avatar
  • 17

15 30 50 per page
1
2
3 4 5
9