Questions tagged [metpy]

MetPy is a collection of tools in Python for reading, visualizing and performing calculations with weather data.

MetPy is a Python library for reading, visualizing and performing calculations with weather data. It leverages heavily the xarray library for its data model, though it is designed to work on any data that you can get into a numpy array--sometimes needing unit information, which is provided through the Pint library.

Resources

211 questions
1
vote
1 answer

Function moisture flux convergence?

I have to compute several thermodynamic indices and MetPy offers plenty of sounding based parameters (e.g. CAPE, CIN, ...). For the evolution of thunderstorms, the vertically integrated moisture flux convergence is a good predictor. Does MetPy offer…
akann
  • 37
  • 4
1
vote
1 answer

Saving image as geotiff (or png)

I'm using metpy and siphon to pull down and display radar data. Ideally, I'd like to save only the radar layer for display in, say, LeafletJS. GDAL appears to offer a solution using gdal_translate: gdal_translate -of PNG -ot Byte -b 1 -scale 10 100…
1
vote
2 answers

Metpy HRRR Cross Section

I am working on creating cross sections of HRRR model output, I have read in the grib files using xarray with pynio as the engine and then converted this files to netcdf so I can work with them on my windows machine, therefore I am wondering if this…
1
vote
1 answer

MetPy: projection information in xarray Dataset for cross sections?

The input for metpy.cross_section() is an xarray Dataset or DataArray that "must have attached projection information." To use MetPy cross secion I need to write my own xarray Dataset as my NWP data with meta data cannot be read autamatically into…
1
vote
1 answer

How do you add a textbox to a skew-t plot in metpy?

I am tinkering with the skew-t notebook we did at the unidata metpy training session. Is there a way to put a text box on or next to the skew-t that includes the information. (CAPE = xx, the LCL is XX, etc.) I know we did subplots, but I think the…
JL Dumas
  • 11
  • 2
1
vote
2 answers

Sounding: mixed layer CAPE calculation

Metpy provides a function to calculate surface based CAPE (metpy.calc.surface_based_cape_cin) or starting pressure based CAPE (metpy.calc.cape_cin). See: https://unidata.github.io/MetPy/latest/api/generated/metpy.calc.html#module-metpy.calc But is…
F.Debal
  • 13
  • 2
1
vote
1 answer

MetPy: Station plot contrast

I am wondering if it is possible to add some sort of a text shadow to the station plots to increase their contrast when overlaid on other fields. I am having a lot of trouble finding colors that work well when overlaid on visible satellite imagery…
1
vote
1 answer

Python calling metpy.calc.lfc() raise IndexError: index 0 is out of bounds for axis 0 with size 0

My Python program raised IndexError: index 0 is out of bounds for axis 0 with size 0 when I call the metpy.calc.lft() function. My original code: lfc_p, lfc_T = mpcalc.lfc(P,T,Td) The full informations as follow: Traceback (most recent call last):…
Clarmy Lee
  • 130
  • 5
1
vote
1 answer

Multipanel radar animation

I am currently having trouble getting the Multi-panel radar animation to plot. I am using juypter notebook and on the last cell I get this error. anim = ArtistAnimation(fig, new_artists, interval=100) anim IOPub data rate exceeded. The notebook…
1
vote
2 answers

AttributeError: 'numpy.ndarray' object has no attribute 'units'

I'm using a new Python package (metpy), which contains several subpackages - one of which defines gradient and wind convergence with the following code: from __future__ import division import numpy as np from ..package_tools import Exporter from…
amy712
  • 73
  • 2
  • 6
0
votes
1 answer

How to Create a Straight Line Cross-Section Plot in MetPy with Xarray Dataset?

I am trying to create a cross-section plot using MetPy and xarray for a variable stored in a data xarray.Dataset. However, the cross-section line appears curved when using longitude-latitude pairs, as shown in the attached image. I would like to…
abhiH
  • 1
  • 1
0
votes
1 answer

How metpy module calculate Moisture flux divergence in python

I am calculating moisture flux divergence using metpy module in python. I calculated it like ` import xarray as xr import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker as mticker import pandas as pd import metpy.calc as…
Sreeshma
  • 5
  • 2
0
votes
1 answer

How can I add the value in every point to a Contour Plot?

Right now I'm using matplotlib to generate contour plots of climatic variables. Now I wanted to add the numeric value on each point so that the final plot looks something like this: So, I was wondering if I could get some help on how I could…
jnava1612
  • 71
  • 8
0
votes
2 answers

How to use 1D function metpy.parcel_profile in xarray dataset open with dask

I can't calculate parcel_profile (1D function) on an xarray dataset (segmented with dask) in 4D. Hello, I really need help, I'm working on ERA5 hourly data on pressure levels. I've extracted relative humidity and temperature on several atmospheric…
nietreil
  • 11
  • 3
0
votes
1 answer

The laplacian of metpy can't convert the units of temperature advection

i received recently a work from university to calculate all terms of Sutcliffe equation, and now i trying to do this in python. But, for the Temperature Advection term, i need to do the laplacian of temperature advection, and this error is blocking…