Questions tagged [python]

For questions related specifically to the Python dynamic programming language.

Filter by
Sorted by
Tagged with
13
votes
3answers
36k views

How to interpolate scattered data to a regular grid in Python?

I have three txt files for longitude, latitude and temperature (or let's say three lists lon, lat, temp) from scattered weather station in the UK. I would like firstly to interpolate these data in ...
12
votes
1answer
6k views

Plotting wind barbs in python

I'm trying to plot wind barbs in basemap and I have two separate netCDF files. Here is what I am trying to produce, or something like it: How do I read a uwnd variable in a netCDF file in python? <...
9
votes
2answers
712 views

Terrain correction for gravity data using Nagy, 1973

I am working with an algorithm for terrain correction of gravity data. I am using Nagy, 1973. However, I could not get the results I need. So, this is the problem. I have this function where x,y,z ...
8
votes
1answer
855 views

Plotting ERA5 U/V Wind Data Using Python

Hello Earth Science Community, I am a beginner Python programmer trying to plot a single time step of 10m surface wind data I grabbed from the ECMWF ERA5 reanalysis single level dataset in Python 3.8....
5
votes
2answers
395 views

How to map emission inventory from lat&lon corrdinate to WRF model grid

Here, I have a regional emission inventory, which mainly contains the varibales of lat,lon,...
4
votes
1answer
202 views

How to handle negative cosine of Solar Zenith Angle while calculating clear-sky UV Index?

I'm using this source to calculate the UVI value for every hour in a day (From 7am to 7pm). And using pysolar module to get the Solar Zenith Angle. The equation is ...
4
votes
0answers
135 views

Wind rose WRF-PYTHON

I'm trying to plot a windrose but I don't know how to get the variables ws and wd. Is there any variable in the wrf output that can be used to make a windrose? I tried with 'wspd' et 'wdir' but I ...
3
votes
2answers
1k views

Plotting wind barbs in python (no U,V component)

I've got 4 different .txt files for longitude, latitude, wind speed and wind direction (so no U and V components of the wind). Is there any way to plot wind barbs from such a dataset?
3
votes
1answer
333 views

How to solve libnetcdf.so.12: cannot open shared object file in pyferret?

My pyferret was working perfectly until I had installed netCDF4 and now it is throwing up this error ...
3
votes
1answer
148 views

Locating shearlines or deformation zones in a map

I am looking for a way to detect shearlines or confluence regions such as that shown in the figure below (red dashed line). I was able to derive the stretching, shear, and total deformations. The ...
3
votes
0answers
28 views

Which unsupervised classification method for non linear multivariate time series earth observation data in python

I have collect several data sets for a small region in Germany called Hessisches Ried (about 90 km²) from different sources for a time period from 2015 to 2019. Daily rainfall amount & daily ...
2
votes
1answer
75 views

What CRS does GFS use?

I'm trying to reproject GRIB data from NOAA forecasts onto other data using Python and the pygrib and proj packages (among many others). What is the proper Proj string for GFS GRIBs? The projection ...
2
votes
1answer
237 views

Interpolating world data to a local grid in Python

I have an NC file that has global data with a high resolution (about 25 minutes) so a lot of coordinates. I have some measured values of some region with irregularly spaced coordinates. In order to ...
2
votes
1answer
43 views

Insert points into a 2d grid [closed]

I have a list of single point values that I want to insert into a grid. point_values = [1, 4, 5, ...] point_lats = [-12.101, -12.1023, -12.1031, ...] point_lons = [155.511, 155.520, 155.533, ...] ...
2
votes
1answer
2k views

Error trying to download ERA5 data: Exception: Missing/incomplete configuration file: C:\Users\username/.cdsapirc

I am new with Python so please be kind. I want to download data from ERA5 and so far I have installed the CDS API package and followed all the instructions from https://cds.climate.copernicus.eu/api-...
2
votes
0answers
586 views

Interpolation and extrapolation of unstructured data in python: memory error

I have 3 arrays, for longitude, latitude and temperature (so the observations are scattered in space). I want to apply interpolation on these data, but also extrapolation. I 've written the code beow, ...
1
vote
1answer
208 views

Hydrology- flow accumulation

I'm not specialist in hydrology, and I would be very grateful if you answer my question: What is flow accumulation in hydrology? Why algorithms used to calculate it over a raster DEM don't take ...
1
vote
2answers
82 views

How to search for the nearest non nan value in 2d xarray dataset

I have a 2d xarray dataset and I am having several nan values in the dataset. These nan values need to be filled with the nearest non-nan values in the 2d array. How do I do this? I am trying to ...
1
vote
2answers
222 views

Anyone sucessfully installed pywafo for Python 3 under windows OS?

I've tried: pip install wafo pip install wafo==0.3.1 The instructions of readme provide a 2 step installation process but it fails on the first one. I am using windows 10 and python 3.6.1. Right ...
1
vote
0answers
20 views

Noise level estimation using Hildebrand & Sekhon method

I have some data from a radar to process in order to find the moments and in turn the wind speeds. I have no prior knowledge in signal processing so it's giving me a hard time to estimate the noise ...
1
vote
0answers
156 views

Issues with projection and fig using python and mpl_toolkits.basemap

I currently have depth data that I am plotting with the code below. The problem that I am having has to do with the figure python is spitting out. The figure is really tiny. I have tried a few things ...
0
votes
1answer
67 views

Wind speed data plot contains blank gaps

I am relatively new to Python, and I am having trouble plotting some data. Specifically, I am plotting wind speed data on a 2-D plot that I grabbed from the Weather Research & Forecasting (WRF) ...
0
votes
2answers
248 views

How to read and plot seismic waveform data in Ascii format using Obspy?

I wish to plot seismic waveform data using Obspy, bu they are in Ascii format. Is it possible to read and plot Ascii file using Obspy?
0
votes
0answers
20 views

How all of the files listed as stream (st) could be used or listed as traces (tr) in obspy (python)?

PPSD (seismic background noise) I list all of my files, basically as components (H1, H2, and V), as streas as follows: import os from obspy import read from obspy.signal import PPSD import ...
0
votes
0answers
151 views

How to calculate Lifted Index from ERA5 pressure level data?

I have taken a thunderstorm case where I need to calculate indices but I am not getting any code related stability indices in Python language, the code is available in GRADS, NCL for me it's difficult ...