28
votes
Accepted
How to interpolate scattered data to a regular grid in Python?
It is straightforward to do so with numpy, scipy.interpolate.griddata, and matplotlib. Here ...
13
votes
Accepted
Plotting wind barbs in python
Your uwnd variable holds 32 bit floats and has shape (1,73,144) corresponding to time, lat, lon and is located in the Dataset ...
13
votes
How to interpolate scattered data to a regular grid in Python?
You have a lot of options.
The easiest solution for this simple task would be to use a GIS software, e.g. the free QGIS. Add delimited text layer and try raster interpolation. Download a free ...
7
votes
Python - How to write interpolated raster to netcdf file
I changed your model solution a little bit; but it's like Ingvar Lukas wrote in his answer: you redefined xi and yi in the ...
6
votes
Python - How to write interpolated raster to netcdf file
You have a shape mismatch, as you are overwritingxi and yi using np.meshgrid, then assigning ...
6
votes
Accepted
Python, R or etc.?
In my opinion, python is a more established global language that is used by many more disciplines/users, compared to R. This can be advantageous because examples/tutorials are everywhere and you can ...
5
votes
Accepted
Determining if a fine resolution lat/lon point lies in a coarse resolution lat/lon grid box?
Note: I'm assuming that the original data are provided in NetCDF format.
There are two (OK, there are more, but I'll focus on these two) relatively quick ways to deal with this issue. Which one to ...
5
votes
Hydrology- flow accumulation
The flow accumulation algorithm essentially determines the upstream contributing area of every grid cell; in other words, what area or how many other cells will drain into a given cell. The flow ...
5
votes
Accepted
Problems when interpolating time series data (average problem)
Is it a solution to multiply the B Average Value with 0.7, so the weighted average value will be 3.5?
No, this is not a solution. Doing this effectively assigns a value of zero to the stations that ...
5
votes
Accepted
ETOPO1 region selection (in python)
It looks like you simply messed up the order of your min and max of the latitude. And you were looking at the wrong place (-44° instead of +44°).
...
4
votes
How to solve libnetcdf.so.12: cannot open shared object file in pyferret?
You need to uninstall netCDF4 as it is not compatible with pyferret library as of now.
pip uninstall netCDF4
should do.
4
votes
Accepted
Error trying to download ERA5 data: Exception: Missing/incomplete configuration file: C:\Users\username/.cdsapirc
I had the same problem but have just found the solution after an hour or so of trawling through forums! The problem was that the code 'api.py' could not find the '.cdsapirc' file. The file type has to ...
4
votes
Python, R or etc.?
Essentially there is no consensus. To some degree it comes down to personal preference but it also depends on the application - what needs to be done.
Python is a very popular language and for smaller ...
3
votes
How to calculate Ocean heat content?
The temperature readings are point samples which can occur at various depths depending on who took the reading, how they were taken & the conditions at the time when they were taken.
If modeling ...
3
votes
Accepted
What CRS does GFS use?
My ansatz for what cyl means is likely Equidistant Cylindrical Projection, because in the older Basemap module, 'cyl' was the ...
3
votes
Accepted
Plotting wind barbs in python (no U,V component)
I can answer this in two steps
Calculate $u$ and $v$. This site has formulas for $u$ and $v$. They are as follows: $$u=-|\vec{v}|\sin(\frac{\pi}{180}\phi)$$ and $$v=-|\vec{v}|\cos(\frac{\pi}{180}\phi)...
3
votes
Plotting wind barbs in python (no U,V component)
The data format you have (magnitude and direction) is usually referred to as polar co-ordinates. The data format you need (horizontal and vertical offsets) is Cartesian co-ordinates. There's plenty of ...
3
votes
Terrain correction for gravity data using Nagy, 1973
Instead of the Nagy prism formula, I suggest you to use the formula quoted in the following paper:
B. Banerjee, S.P. Das Gupta (1977):
"Gravitational attraction of a rectangular parallelepiped"
...
3
votes
Read SMAP grib data using python
It seems like the GRIB format is being used to distribute the data (probably for storage, ease of processing?), while satellite SMAP doesn't fit under the GRIB standard (see available parameters ...
3
votes
Downloading JRA-3Q efficiently using a python script
The URL strings are base64-encoded, the example given decodes to:
/JRA3Q/Client9120/Daily/anl_isentrop/anl_isentrop_bvf2.cglt9103.day0107
With this information, you ...
2
votes
How to map emission inventory from lat&lon corrdinate to WRF model grid
I would suggest using cdo for your purpose. At least for variables, which values are independent of the grid cell size, one can use cdo.
cdo
cdo (Climate Data Operators) is a command line program to ...
2
votes
Terrain correction for gravity data using Nagy, 1973
I have recently had to deal with the same problem and tackled it in Matlab,
If it helps, here's a link to it on the file exchange
https://au.mathworks.com/matlabcentral/fileexchange/57349-nagyprism-...
2
votes
How to handle negative cosine of Solar Zenith Angle while calculating clear-sky UV Index?
This is only to address the title question.
You are right, in a way. I would recommend that you set an if statement up such that
...
2
votes
How to calculate Lifted Index from ERA5 pressure level data?
Metpy 1.0 has a lifted_index function, which requires a profile temperature parameter, which in turn can be calculated using the parcel_profile function. That requires having the dew point temperature,...
2
votes
Accepted
Wind speed data plot contains blank gaps
The answer is actually pretty easy. The WRF model lies on a grid. The vertical component of the grid is unevenly spaced, though you can manually space it. The vertical coordinate of WRF uses a sigma ...
2
votes
How to search for the nearest non nan value in 2d xarray dataset
If I were you, I would exclude the NaN values and then perform gridding on the resulting irregularly spaced data.
There are already the tools to perform this in Python and using the library SciPy
...
1
vote
What is the best way to interpolate Isotopic data and display them?
Ok I think there is no similar package. Therefore, the best approach is to do the interpolation with the package Pykrige and for displaying the data I would recommend the package Basemap (...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
python × 65meteorology × 21
interpolation × 9
climate-models × 7
oceanography × 6
mapping × 6
netcdf × 6
temperature × 5
atmosphere-modelling × 5
wrf × 5
climate × 4
wind × 4
data-analysis × 4
era × 4
isotopic × 4
geophysics × 3
reanalysis × 3
grid-spacing × 3
climate-data × 3
climate-change × 2
atmosphere × 2
models × 2
air-pollution × 2
earth-observation × 2
soil-moisture × 2