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

[python #KWB-294985]: Question about Python and GRIB



Hello! Thanks for reaching out.

If you want to save your `grb.values` arrays to .csv files, you can use 
`numpy.savetxt`

  https://numpy.org/doc/stable/reference/generated/numpy.savetxt.html

or if you can get these arrays into a Pandas dataframe, you can use 
`pandas.DataFrame.to_csv`

  
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_csv.html

If we can help you get your data visualized, you'll have to let us know more 
information about what you've tried and what errors you're getting. I might 
suggest trying out using cfgrib directly as demonstrated with some of their 
examples in the README at https://github.com/ecmwf/cfgrib as this might help 
you overcome any multi-key errors you might be getting by opening your file 
through xarray. If you are still getting an issue with xarray+cfgrib from 
there, then you might want to put together a full picture of what data you're 
using and what errors you're getting to let them know if there are problems 
with their code!

If there are any further ways we can help, don't hesitate to follow up with 
more information about your errors! Thanks.


All the best,

Drew


> So i work with zygrib i don't know if you know this software , after i open
> zygrib i select the zone that i want to know total precipitation for 8 days
> then i download the file (.grb) after that i open anaconda to use pygrib to
> read my grib file and of course with success i can read it and it shows me
> the grb.values i want to extract lat , lon , time and total precipitation
> from grib file to convert it in CSV and i want also to visualise it with
> cartopy hope you have an idea about that if you can help me thnx in advance
> 
> Note that :
> -Im using Zygrib to extract grib file
> -using python i also used xarray open dataset and i get error after using
> engine cfgrib idk why normally others works normally with them


Ticket Details
===================
Ticket ID: KWB-294985
Department: Support Python
Priority: Low
Status: Closed
===================
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.