All Questions
83
questions
2
votes
1
answer
36
views
Create .nc file from multiple tif files : metadata time
I'm trying to create a single .nc file with 3 dimensions : x,y and time. In order to do so I have multiple tif files named by their date : 2013-04-24_Turb.tif for the 24-04-2013. I would like to do ...
1
vote
0
answers
34
views
All-NaN slice encountered when apply xr_phenology function?
I want calculate vegetation phenology from ndvi netcdf dataset, I follow yours tutorials (DEA Australia and DEA Africa) to apply xr_phenology
function , defined here. To avoid killed kernel of my ...
0
votes
1
answer
34
views
Invert latitude of NetCDF in Python / xarray
I thought it would be straight up, but I don't find a question like this one here.
I created a NetCDF out of a GeoTIFF, but it did not have coordinates or CRS.
I added it doing this:
coords = {
'time' ...
0
votes
0
answers
101
views
Performance difference between xarray open_mfdataset and open_dataset
I'm dealing with CMIP6 Scenariomip data, I have eight ESMs precipitation grid that each one is composed by multiple netcdf files. There is one ESMs's netcdf files are seperately reserved every decade, ...
1
vote
1
answer
132
views
While exporting the rasters using rioxarray, nodata value is undefined after the mask
I have used xarray to open the netcdf file, and using rioxarray exported the raster as a .tif file. However, the exported raster doesn't have definition for nodata value, and hence, the GIS software ...
0
votes
0
answers
124
views
xarray : no such file directory
I'm trying to transform a .nc file in .tiff using this code :
import xarray as xr
import rioxarray as rio
nc_file = xr.open_dataset("C:/Users/aurel/OneDrive/Documents/Mémoire/Datasets/CCI_lake/...
0
votes
0
answers
61
views
How can I extract the array indices from a xarray.rio.clip operation?
I have a line of code that clips a Dataset from a larger xarray.core.dataset.Dataset.
clipped = ds.rio.clip([user_polygon], crs=4326, all_touched=True)
I need to process many of these large datasets (...
1
vote
0
answers
26
views
Buffer Error when using xarray
When I tried to using python package "xarray" to read grib files, I got an error. It's quite weird, because I had did it successfully yesterday.
This is my code:
import xarray as xr
import ...
3
votes
1
answer
411
views
How to write CRS info to NetCDF in a way QGIS can read? (Python/Xarray)
I have a NetCDF file I have subset by geometry and time, and now I need to save it as a new NetCDF file. The original file does not have the CRS set, thus I am setting it in this one. The problem is ...
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&...
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 ...
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'...
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 ...
-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 ...
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: ...