[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[python #FFR-890728]: Any code recommendations to convert altimetry pressure to altitude



Hello, and thanks for following up!

MetPy doesn't require NetCDF for any of its functionality. MetPy does require 
xarray, and some *very* old versions of xarray might require NetCDF, and MetPy 
does not support these very old version of xarray. You might want to make sure 
your environment is as updated as you can get it!

We do have some examples in general you can check out,

    Our user's guide: 
https://unidata.github.io/MetPy/latest/userguide/index.html
    The MetPy examples gallery: 
https://unidata.github.io/MetPy/latest/examples/index.html

We don't have any specific examples of this conversion being used, but I might 
be able to put one together for you with some sample data or if you provide me 
with some shareable data.

If updating your environment doesn't fix your import errors, then follow up and 
let me know, and provide the full code and errors you get if possible. Thanks!


All the best,

Drew


> I am doing lots of calculations comparing accuracy of pressure to height:
> 
> I try adding your stuff, for example,
> 
> 
> import math
> import metpy.calc as mpcalc
> from metpy.units import units
> 
> #Read in Data
> df = pd.read_csv("./balloon_data/gps_analysis_2.csv", index_col = False)
> df['Time']=(pd.to_datetime(df['Time'].str.strip(), format='%Y-%m-%d 
> %H:%M:%S'))
> #reduce data sample size to second level precision
> df['Time'] = df['Time'].values.astype('<M8[s]')
> df.drop_duplicates(subset ="Time",inplace = True, keep = 'last')
> print(df)
> 
> def pres2alt_metpy(P):
> p = P.vaules * units.pPa
> h = mpcalc.pressure_to_height_std(p)
> return h
> 
> but getting lots of import errors like I need netcdf,
> 
> do use your mini-calc-functions to do calculations, do you have an example I 
> can use. I mean, I will import netcdf,
> just surprised I need it.
> 


Ticket Details
===================
Ticket ID: FFR-890728
Department: Support Python
Priority: Low
Status: Open
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata 
inquiry tracking system and then made publicly available through the web.  If 
you do not want to have your interactions made available in this way, you must 
let us know in each email you send to us.



pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy