Questions tagged [xarray]
xarray is a Python module for working with N-dimensional arrays
135
questions
1
vote
0
answers
158
views
Convert the netcdf file to geotiff with chosen coordinate system
I have a nc file retrieved from the following link https://www.globsnow.info/swe/nrt/2020/data/GlobSnow_SWE_L3A_20200110_v.1.0.nc.gz. I am trying to convert this file to geotiff in wgs 1984 coordinate ...
0
votes
1
answer
406
views
Error reading variables from NetCDF file with Xarray when there are multiple variable layers
I get an error reading variables from NetCDF file with Xarray when there are multiple variable layers
Data:
The netCDF file that I have has multiple layers:
/Geophysical_Data/...
1
vote
2
answers
1k
views
Fixing the flipped/inverted Y axis in the xarray with rasterio
The data I read with xarray with rasterio engine is inverted along Y axis (This is SMAPL4 data). The correct dimension values are y=ds.y*(-1).
ds = xr.open_mfdataset(file_paths, engine="rasterio&...
2
votes
2
answers
1k
views
Is it possible to change a coordinate in an netCDF loaded with xarray?
I have a netCDF which is loaded in xarray with a dimension named bands (it was originally an import via rioxarray of ENVI data), but actually, I want to be able to parse the data by time. I have tried ...
0
votes
1
answer
249
views
When i save my xarray DataAarray the coordinates are wrong
I have three 3x3 arrays that are downsampled data from NOAA's Global Hydro Estimator (smaller to make it quicker for testing). One array is lats, one is lons, and one is rainfall. Here's a sample
lons:...
0
votes
1
answer
850
views
Convert a multiband GeoTIFF to a timeseries NetCDF file in xarray
I am trying to create a time series object from extracted climate data (NEX-GDDP) using the Google Earth Engine (GEE). The data is daily meteorological data, and in the attached file, the data for ...
1
vote
0
answers
340
views
How to add additional bands to a TIFF using rioxarray
I'm trying to work out how to open a raster, determine the name of the existing band(s), then use that bands value in math to create a new band.
I believe the data is being loaded to a DataArray. I'm ...
0
votes
1
answer
306
views
Save multiple GeoTIFF files from a GRIB file, one file per day (time dimension)
I am trying to save multiple GeoTIFF files from a GRIB file I have elaborated.
Before converting to raster, the GRIB file I started with is a ERA5 2m hourly temperature over 3 days:
import iris
# ...
1
vote
1
answer
794
views
Mask NetCDF data in Python with shapefile
Precursor to this question: Masking NetCDF data with a shapefile in that has more than one variable Python. Note: Data files are in the previous question.
I am trying to mask my polygon but I don't ...
1
vote
0
answers
300
views
Georeference NetCDF using rioxarray
I have a NetCDF file with a lot of variables and an improperly set georeference. Loading using xarray works, using rioxarray.open_rasterio I get the following error: "NotGeoreferencedWarning: ...
2
votes
0
answers
552
views
Create an xarray dataset form a series of GeoTIFFs and clipping problem
I am trying to create a dataset from a series of GeoTIFFs (one .tiff file per day) and then clip it with a given geometry (shapefile).
The TIFF files, one per day, have this format: e.g. day 29-07-...
0
votes
1
answer
454
views
Extract data for aoi from preprocessed Landsat CCDC ImageCollection using GEE Python API
I try to extract for a collection of 1 ha square polygons the bands coefficients from a preprocessed Landsat CCDC Google Earth Engine Asset ee.ImageCollection('projects/CCDC/v3').
My plan is the ...
0
votes
1
answer
109
views
GeoServer Java error when adding layer from NetCDF based store
Using xarray I have subsetted surface current data from the https://resources.marine.coperncus.eu OPeNDAP server. I save the subset as a NetCDF4 file. I am able to add the NetCDF file as a store in ...
0
votes
0
answers
52
views
Python, colorize raster randomly avoiding same color for adjacent cells
I'm processing GeoTIFF rasters with python and xarray. The file contains some cells with different values. It looks like that:
There are about 100 different values in the file and each value needs to ...
2
votes
1
answer
249
views
Is there a way to limit the distance of rioxarray's interpolate_na()
I'm trying to run something similar to gdal's fillnodata command line tool in Xarray. Xarray has interpolate_na() that comes with an optional parameter limit where you can limit the number of ...