Skip to main content

Library for getting dataset from noaa site

Project description

NOAWClg


PyPI - Downloads PyPI - License

Library for getting the world data climate from the data noaa/nasa


Instalation

$ pip3 install noawcgl -U

note: netcdf=1.5.7 | xarray=0.20.1

Examples

getting data


from a point

getting the data:

from noawclg import get_noaa_data as gnd

point = (-9.41,-40.5)

data = gnd.get_data_from_point(point)

# a example for the surface temperature
data = {'time':data['time'],'data':data['tmpsfc']}

print(data)
{'time': <xarray.IndexVariable 'time' (time: 129)>
array(['2022-01-01T00:00:00.000000000', '2022-01-01T03:00:00.000000000',
       '2022-01-01T06:00:00.000000000', '2022-01-01T09:00:00.000000000',
       '2022-01-01T12:00:00.000000000', 
...

keys

>>> from noawclg import get_noaa_data as  gnd

>>> gnd().get_noaa_keys()


{'time': 'time', 
'lev': 'altitude', 
'lat': 'latitude', 
'lon': 'longitude', 
'absvprs': '** (1000 975 950 925 900.. 10 7 4 2 1) absolute vorticity [1/s] ',
 'no4lftxsfc': '** surface best (4 layer) lifted index [k] ', 
 'acpcpsfc': '** surface convective precipitation [kg/m^2] ', 
 'albdosfc': '** surface albedo [%] ',
  'apcpsfc': '** surface total precipitation [kg/m^2] ', 
  'capesfc': '** surface convective available potential energy [j/kg] ', 
...

example plot wind

from noawclg.main import get_noaa_data as gnd
data_noaa = gnd(gfs='1p00')#,url_data='https://nomads.ncep.noaa.gov/dods/gfs_1p00/gfs20220108/gfs_1p00_00z')

place = 'juazeiro BA'
print(data_noaa.get_noaa_keys())


# ## rain's (mm)
# def fmt(data): return data* 100_000
# data_noaa.plot_data_from_place(place=place,path_file='plot_ch1.png',
#                                title='Previsão de Chuvas\nPetrolina-PE/Juazeiro-BA',
#                                 ylabel='mm',fmt_data=fmt,key_noaa='prateavesfc')



## temperature (ºC)
def fmt_t(data): return data
data_noaa.plot_data_from_place(place=place,path_file='plot_wind100m.png',
                               title='Velocidade dos Ventos\nPetrolina-PE/Juazeiro-BA',
                                ylabel='m/s',fmt_data=fmt_t,key_noaa='vgrdmwl')

result:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

noawclg-0.0.4.7-py3-none-any.whl (17.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page