2,368 questions
1
vote
1
answer
74
views
HTTPError: 400 Client Error: Bad Request for url. Plot an Ensemble of CMIP6 Climate Projections — C3S Training
I am following the code from this tutorial.
https://ecmwf-projects.github.io/copernicus-training-c3s/projections-cmip6.html
When I type:
# DOWNLOAD DATA FOR HISTORICAL PERIOD
c = cdsapi.Client(url=...
0
votes
0
answers
127
views
Convert NETCDF files into TIF files
I’m creating a Python program that converts NetCDF files into GeoTIFFs, allowing the user to select the variable and time step using a Tkinter interface.
The conversion works, but I’m having a ...
0
votes
0
answers
38
views
Adding global attributes to existing netCDF file in Xarray
I have netCDF files of oceanographic data processed in Python, that I'd like to update the global attributes of (i.e., add the same attributes to a bunch of files). Tried doing it in Xarray per their ...
0
votes
1
answer
110
views
How can I concatenate 10 netcdf files along the time axis, while also retaining the attributes of each individual file
I am trying to concatenate 10 netCDF files that are output files from a software named Ichthyop. Each of the files is a result of a lagrangian simulation of particles drifting in the Eastern ...
0
votes
1
answer
57
views
Extreme trends in GSL (Growing Season Length) due to missing years in ERA5-Land based calculation
I calculated the Growing Season Length (GSL) index for the 1950–2023 period in Turkey using ERA5-Land daily mean temperature data. According to the definition:
First, find the first occurrence of at ...
0
votes
0
answers
51
views
Convert wrfout to netcdf
I use Python version 3.9.18 to reading wrfout files (name like: wrfout_d02_2020-01-01_00:00:00) and get T2, Q2, PSFC, U10, V10, ACSWDNB variables and combine all days in the month to a output netcdf ...
0
votes
0
answers
74
views
Xarray apply function to every element of dataset
I currently have to do some calculations on a netcdf dataset. For this, I have to apply a function to each non-NaN element.
Here is my current approach:
import xarray as xr
def calc_things(wind_speed)...
0
votes
0
answers
49
views
Reduce memory usage in CDO collgrid command
I have 78 netcdf files each around 17MB, with shape (time=1, x=2048, y=2048) to be merged spatially. The single timestep is shared for all 78 files. The collgrid merge command below was able to ...
1
vote
1
answer
176
views
Reading netCDF file with data not on a grid
I am trying to convert portions of a netCDF (.nc) file into a .csv and I am having some issues when I try and combine the portions I separated out into one matrix. This is the first time I have ever ...
1
vote
2
answers
143
views
How to extract OPeNDAP data for a single location in R?
I am trying to download vegetation index data for a single point location, and I want it to be automated in R so I can do this for multiple points in different runs. So I found the opendap.catalog ...
0
votes
0
answers
66
views
Error in saving a very large xarray dataset to zarr in python
I have global daily radiation data for 19 years. It is divided into one netCDF file for every day (so around 7000 files). I am loading all the files together as a single xarray dataset. This takes ...
0
votes
0
answers
42
views
MetPy "interpolate_to_isosurface" results in "IndexError: Unlabeled multi-dimensional array cannot be used for indexing: pressure_level"
I need help on the usage of MetPy's interpolate_to_isosurface function (link).
My goal was to interpolate a gridded meteorological dataset, such that its vertical coordinate is transformed from ...
1
vote
1
answer
63
views
Merging multiple NetCDFs from Copernicus into one NetCDF in Rstudio for plotting
I am trying to merge multiple NetCDFs containing 4 dimensions (lat, lon, depth, time) into one NetCDF. Each contain the same variable (sea surface temperature or 'thetao') and the same depth value and ...
1
vote
1
answer
70
views
Why isn't the array that I create in R being able to convert into a raster?
I am trying to plot a Hovmoller diagram using NetCDFs from Copernicus database. I am trying to plot it for one specific point (lon,lat). When I create a database for this with all depth values and all ...
0
votes
1
answer
185
views
Merge multiple NetCDF files with `cdo` or `nco` along a dimension other than time
I have two or more NetCDF files that share a time dimension and time variable, where the time variable is the same for all the files (from the start to the end of the time period, unit, etc). The ...
1
vote
1
answer
178
views
How to select from xarray.Dataset without hardcoding the name of the dimension?
When selecting data from an xarray.Dataset type, the examples they provide all include hardcoding the name of the dimension like so:
ds = ds.sel(state_name='California')
TLDR; How can you select from ...
0
votes
0
answers
65
views
What is the data_vars argument of xarray.open_mfdataset doing?
I have two datasets with identical dimension names and shapes and I am trying to use xarray.open_mfdataset() to merge them into one dataset before opening them. You can drop this code in your own IDE ...
1
vote
1
answer
176
views
Accessing metadata/ attributes of a netcdf file in terra
I'm having trouble figuring out how to access key metadata when using terra, though I can see it's available in the original netcdf file.
I have a dataset downloaded from the Climate Data Store that ...
-1
votes
2
answers
97
views
Extract grid from a NetCDF file
I am trying to extract the grid from a netcdf file for chlorophyll a in the South of Ireland / Celtic Sea.
This (below) is what I have done, but I get a large grid that also goes on land, even though ...
1
vote
0
answers
33
views
Serve NetCDF via WCS protocol with Python and MapServer
I'd like to serve a NetCDF resource via WCS using MapServer Python bindings.
I borrowed a mapfile form the MapServer test suite wcs_netcdf_input_output.map
for which I adapted the wcs_onlineresource ...
1
vote
2
answers
60
views
How to extract non-continuous indices using ncvar_get() in R?
I want to get specific specific indicies from the netcdf file to create a 3 dimensional array (and then take the mean of these). However ncvar_get from the R package ncdf4 interprets as additional ...
0
votes
0
answers
48
views
hvplot: plotting a netcdf file the hover in quadmesh plot shows x and y coordinates as “NaN”
I am using hvplot.quadmesh to visualize wind speed data.
The hover tool should show the x and y coordinates of the pixels, but it only shows “NaN”.
#interactive plot mean wind speed over whole year ...
0
votes
1
answer
103
views
Open a xarray created netCDF in QGIS
I have created a netCDF file using xarray in python with the code below:
latitude_save = sorted(list(set(copy2_sorted['lat'])))
longitud_save = sorted(list(set(copy2_sorted['lon'])))
time_save = ...
0
votes
0
answers
33
views
How to plot streamlines from west to east with netcdf data in python
I wanted to plot streamlines with NOAA composite (2.5*2.5 lon/lat) from 30 west to 10 east ( I definitely want the map to be from west to east(. I tried to draw it with basemap (The codes are attached)...
-1
votes
2
answers
210
views
invert latitude from -90,90 to 90,-90 in a netcdf file
I have the following netcdf file: ncfile.nc
The file has latitudes ranging from -90deg to 90deg.
I need to flip these coordinates to 90deg, -90deg, so that the southern hemisphere becomes the northern ...
0
votes
0
answers
53
views
How to use the SDSLite package to convert C# objects into variables and dimensions and create a new NetCDF file to store them?
SDSLite package version 3.0.1
I hope to use the data I calculated as variables in the nc file, so I first need to create a Dimension structure, but when I create it, the definition of Dimension in the ...
1
vote
1
answer
214
views
Using xarray in JupyterLab to read NC file from url
I am trying to prevent unnecessary downloading of large datasets by reading the publicly available files directly from their online location. Surprisingly I cannot find an answer to my question on ...
-1
votes
1
answer
254
views
How to Extract timeseries from gridded lat lon data (ERA5) in Python?
I have downloaded ERA5 global data which contains the following params:
total precipitation
snow fall
cloud cover
temperature at 2m
The data range is from Jan 2008 to Dec 2024.I am using xarray ...
-1
votes
1
answer
164
views
Export to netcdf / .nc file from a pandas DataFrame
I want to multiple data extract from cmip6 model data and save as netcdf file by using the following scripts:
import pandas as pd
import xarray as xr
from netCDF4 import Dataset
nc_file = (r"...
-1
votes
1
answer
62
views
Renaming the unit in a netcdf
So i want to rename "m" into millimeters.
I used xarray.Dataset.rename and its variations for other renaming but as far as i can see it is only able to rename "GRIB_units" and &...
0
votes
1
answer
50
views
Why did I get the error: Error In File (file, "rt") Cannot Open the Connection when converting hourly to monthly data with zoo package?
so I pulled an hourly time series from a netcdf file and wanted to convert it to monthly data for some runs I'm doing. I keep getting the error in the title whenever I try to use the Zoo package to ...
0
votes
2
answers
252
views
How to create an array of length n in R where each element has two elements (example given)
I would like to create an array in R that looks like the following array made in Python. This may be a very simple question, but it's giving me trouble!
array([[19358, 19388],
[19389, 19416],
...
-1
votes
1
answer
126
views
Error at HDF5 layer using NCO trying to convert netcdf3 to 4
So i tried this
ncks -C -v expver in.nc expver.nc
ncks -5 -C -x -v expver in.nc in_5.nc
ncrename -d latitude,lat -d longitude,lon -d valid_time,time
-v latitude,lat -v longitude,lon -v ...
0
votes
1
answer
78
views
Deleting a dimension with NCO
I used NCO's ncrename to rename longitude, Latitude and valid_time to long,lat, and time. So that I can run the data through a different package that only excepts the mentioned names ( Climate Indices)...
0
votes
2
answers
268
views
Issue with renaming netCDF dimensions with NCO's ncrename [closed]
I used NCO's ncrename to rename longitude, Latitude and valid_time to long,lat, and time. So that I can run the data through a different package that only accepts the mentioned names.
the original ...
1
vote
1
answer
289
views
How can I select by latitude / longitude for a NetCDF dataset when these are given as Coordinates (not Dimensions)?
I am working with NetCDF data. The dimensions for the Xarray dataset are given as "x", "y", "time" and the coordinates are "lon" (y,x) "lat" (x,y) and ...
0
votes
1
answer
63
views
CMIP6 How to merge multiple .nc files in R
I want thank everyone for taking the time to answer this question. I cannot seem to find how to merge 2 or more .nc files in R--this is after a solid few days of trying different solns from here, ...
1
vote
2
answers
160
views
CMIP6, automating by month
Thanks in advance for any help and insight. I am still new/learning R.
I am working with CMIP6 historical data across several models for several variables. Ideally, my baseline would run from 1850 - ...
0
votes
1
answer
140
views
Error when using xarray.apply_ufunc on a chunked xarray DataArray
Hello I am trying to sort the data inside some netCDF4 (.nc) files into bins as efficiently as possible. I am currently trying this with xarray and NumPy's digitize function. Since I want to process a ...
0
votes
1
answer
57
views
Extract precipitation values from netcfd
I’m stuck on a question about extracting a variable from a NetCDF file. Here is the structure of my input netcdf file:
comephore_all
Out[37]:
<xarray.Dataset>
Dimensions: (x: 85, y: 99, time: ...
1
vote
3
answers
334
views
Extracting time from an unconventionally-named netcdf using terra
I have a netcdf file (ERA5 climate data) that I'm converting to a SpatRaster using terra. I would like to access the time data for each layer; however, the date element of the original file is named ...
1
vote
1
answer
66
views
How to create a DataFrame from GC-MS data with retention time, mass values, and intensities in Python with correct alignment?
I am processing gas chromatography - mass spectroscopy (GC-MS) data stored in a NetCDF file in Python, and I’m having trouble aligning the data correctly to create a structured DataFrame. My goal is ...
2
votes
1
answer
122
views
How to split a raster stack by seasons
I have downloaded multiple Lm3 4 km netcdf files (n = 4640) for sea surface temperature from the Ocean Colour Project, NASA from 2012 to 2024.
I have put all my files into a raster stack:
class :...
0
votes
1
answer
178
views
How to extract point data for sea surface temperature for specific dates over multiple years from multiple netcdf files using terra::extract() in R
I have downloaded multiple Lm3 4 km netcdf files (n = 4640) for sea surface temperature from the Ocean Colour Project, NASA.
class : SpatRaster
dimensions : 766, 709, 1 (nrow, ncol, nlyr)
...
1
vote
1
answer
158
views
Geoserver API - "the specified coverage is not available"
I am using GeoServer 2.26.0 (docker.osgeo.org/geoserver:2.26.0), and the only extension I have installed is NetCDF; otherwise, it is a vanilla install.
I have created a NetCDF store and successfully ...
0
votes
1
answer
92
views
How to Extract Point Data from Multiple Subsetted Netcdf Files for Sea Surface Density using terra::rast() and terra::extract functions in R
Description of Data
I downloaded MULTIOBS_GLO_PHY_S_SURFACE_MYNRT_015_013 data for daily sea surface density from 2012 to 2024 from The Copernicus Website. A person can only download 2 years of data ...
0
votes
0
answers
45
views
Am I doing the t-test on wind vectors correctly?
I'm trying to create an wind anomaly plot and shade the regions that are statistically significant at the 95% level using the Student's t-test.
The anomaly plot is simple to do. The problem is that my ...
0
votes
2
answers
99
views
Concatenating netcdf and hdf5 files
I have two data files in two formats, one is netcdf, the other is hdf5. I wish to combine them and export the combined data as hdf5. My current solution includes converting each to a python dictionary ...
-1
votes
1
answer
243
views
Creating a SpatRaster with Multiple Binned AQUA-MODIS (NetCDF) Files with the Function terra::rast() in R
Issue
I downloaded AQUA-MODIS netcdf files (total = 3422) for chlorophyll-a from the Earthdata website from 2012 to 2024 for The Northern Red Sea, Egypt.
I need to:
Stack all the 3422 AQUA MODIS ...
2
votes
1
answer
211
views
xarray and dask: efficiently processing a large netcdf file
I am trying to do a simple calculation on a very large netcdf file, and am struggling to speed it up -- probably because I program primarily in julia and R. I think xarray/dask are the best approach ...