netcdf4

Change grid size of a netCDF file

折月煮酒 提交于 2021-02-19 03:19:19
问题 Let's assume I have 2 netCDF data files with data for the same region (like South America, Africa, etc) but the different grid sizes as 0.5 degrees x 0.5 degrees and 1.0 degrees x 1.0 degrees in another. I want to increase or decrease its grid size to a different value such as 0.25 x 0.25 or 1.0 x 1.0 so that I can use this easily for raster calculations and comparison, etc. Is there a method to do this using any bash script, CDO, etc. A sample data can be downloaded from here. https://www

Change grid size of a netCDF file

谁说我不能喝 提交于 2021-02-19 03:18:57
问题 Let's assume I have 2 netCDF data files with data for the same region (like South America, Africa, etc) but the different grid sizes as 0.5 degrees x 0.5 degrees and 1.0 degrees x 1.0 degrees in another. I want to increase or decrease its grid size to a different value such as 0.25 x 0.25 or 1.0 x 1.0 so that I can use this easily for raster calculations and comparison, etc. Is there a method to do this using any bash script, CDO, etc. A sample data can be downloaded from here. https://www

Change grid size of a netCDF file

。_饼干妹妹 提交于 2021-02-19 03:18:37
问题 Let's assume I have 2 netCDF data files with data for the same region (like South America, Africa, etc) but the different grid sizes as 0.5 degrees x 0.5 degrees and 1.0 degrees x 1.0 degrees in another. I want to increase or decrease its grid size to a different value such as 0.25 x 0.25 or 1.0 x 1.0 so that I can use this easily for raster calculations and comparison, etc. Is there a method to do this using any bash script, CDO, etc. A sample data can be downloaded from here. https://www

Iterating over a function to combine many raster stacks into one

僤鯓⒐⒋嵵緔 提交于 2021-02-17 04:42:42
问题 Been stuck on this for a while now. Looked everywhere for an answer, but I can't seem to find anything on Stack. Any help you all can give that would be very appreciated. My main issue is that I need to import many, many netcdf4 files, create raster bricks of each, then combine many bricks to make a "master brick" per variable. To give you a clearer example, I have 40 years (netcdf = 40) of many climate variables (n = 15) that are at a daily resolution. The goal is to aggregate to monthly,

How to process the Time variables of OCO-2/Tropomi NETCDF4 files using Xarray?

非 Y 不嫁゛ 提交于 2021-02-11 14:02:41
问题 I am working on Tropomi .nc files. When I open the dataset using xarray, it does not process the time dimension. In Tropomi files, the time dimension is named as 'sounding_dim'. Instead of decoding the time, the returned output is just the sounding number. I have tried on OCO-2 .nc files as well. In OCO-2, the time dimension is 'sounding_id'. In case of OCO-2, the time is returned as a floating number, not as a date. The code and the output is given by: import numpy as np import xarray as xr

NetCDF Library Linkage on Windows with cmake

怎甘沉沦 提交于 2021-02-11 14:01:23
问题 I'm trying to include/link the NetCDF C library (https://www.unidata.ucar.edu/software/netcdf/docs/index.html) into my C++/CUDA project with cmake. I seem to be running into issues, though. I am on Windows 10 and have installed the NetCDF C libraries for Windows, version 4.7. Including the NetCDF libraries seems to go without a hitch, the problem is in the linking step. My code that uses the NetCDF library: netcdf_writer.cpp #ifndef __CUDACC__ //only actually include the NetCDF libraries if

NetCDF Library Linkage on Windows with cmake

风流意气都作罢 提交于 2021-02-11 13:57:49
问题 I'm trying to include/link the NetCDF C library (https://www.unidata.ucar.edu/software/netcdf/docs/index.html) into my C++/CUDA project with cmake. I seem to be running into issues, though. I am on Windows 10 and have installed the NetCDF C libraries for Windows, version 4.7. Including the NetCDF libraries seems to go without a hitch, the problem is in the linking step. My code that uses the NetCDF library: netcdf_writer.cpp #ifndef __CUDACC__ //only actually include the NetCDF libraries if

Using parallel NetCDF to save a distributed 3D complex array

北城余情 提交于 2021-02-08 03:46:28
问题 I have an MPI-based program written in Fortran which produces a 3D array of complex data at each node (sections of a 2D time-series). I would like to use parallel I/O to write these arrays to a single file which can be relatively easily opened in python for further analysis/visualization. Ideally I would like the solution to be memory efficient (i.e. avoid the creation of intermediate temporary arrays). Using NetCDF, I have managed to adapt a subroutine which achieves this for a 3D array of

How to plot a vertical section of the atmosphere along with the topography using the Iris module?

爱⌒轻易说出口 提交于 2021-01-29 12:55:29
问题 I have a netcdf with wind speed at model levels. On the same netcdf I have the altitude of each model level. I converted netcdf to a cube, so the altitude of each level became an auxiliary coordinate. I would like to plot a cross section (longitude x longitude) and would like the model levels to follow the topography. I tried using the Iris module documentation example (https://scitools.org.uk/iris/docs/latest/examples/General/cross_section.html), but it's not working. As I already have the

xarray: coords conversion to datetime64

自闭症网瘾萝莉.ら 提交于 2021-01-29 05:18:58
问题 I have a NetCDF4 file that i'm handling using xarray. The dataset has a "time" coordinate as dtype=object and i would like to convert it ot datetime64 in order to simplify plotting of the variables contained in the file. My plan was to create a new time coordinate called "time1" using ds.assign_coords(time1=pd.to_datetime(ds.time.values,infer_datetime_format=True)) and then delete the old one. But i get a new coordinate still as dtype=object. here's how the new dataset looks like What am i