# Tag Info

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 ...
• 4,993

### 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 ...
• 5,946

### 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 ...
• 1,999
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 ...
• 13.7k

### 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 ...
• 561
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 ...
• 1,268

### 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 ...
• 751
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 ...
• 24.7k
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°). ...
• 380

### 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.
Accepted

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 ...

### 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 ...
• 24.7k

### 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 ...
• 24.7k
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 ...
• 8,799

### 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" ...
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)...
• 8,799

### 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 ...
• 5,429

### 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 ...
• 561

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 ...

### Efficient way to parse lat-lon grid at certain depth in tripolar model from nc file?

First of all: NEVER, EVER, EVER (I repeat, EVER) loop in Python over an array to subset some values :) xarray was created exactly to avoid having to write something ...
• 421

### 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 ...
• 8,799

### 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-...
• 31

### 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,...

### 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,661
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 ...
• 8,799