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

Problem with netcdf?

try:

sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install libhdf5-serial-dev
sudo apt-get install libnetcdf-dev


export HDF5_DIR=/usr/local/hdf5
export HDF5_DIR=/usr/include/hdf5

pip install netcdf4

or

sudo apt-get install libhdf5-serial-dev netcdf-bin libnetcdf-dev

export HDF5_DIR=/usr/local/hdf5
export HDF5_DIR=/usr/include/hdf5

pip install netcdf4

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

you can see the all keys in it page.

>>> 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

import noawclg.main as main
from noawclg.main import get_noaa_data as gnd
from noawclg.plot import plot_data_from_place as pdp
import matplotlib.pyplot as plt
#plt.style.use('dark_background')
#reinan voltou, porrrrraaaaaaaaa

date_base = '12/01/2023'

main.set_date(date_base)
data_noaa = gnd()#,url_data='https://nomads.ncep.noaa.gov/dods/gfs_1p00/gfs20220108/gfs_1p00_00z')

place = 'juazeiro BA'

jua_pet = pdp(place=place,data=data_noaa)

jua_pet.path_file='plot_wind100m.png'

jua_pet.key_noaa='tmp80m'
jua_pet.title='Temperatura do Ar\nPetrolina-PE/Juazeiro-BA'
jua_pet.ylabel='°C'
jua_pet.xlabel='Janeiro de 2023'

def fmt_data(data): return data-273
jua_pet.fmt_data =  fmt_data

jua_pet.render()
#plt.show()

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.8-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file noawclg-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: noawclg-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for noawclg-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 ccf561a2b7bcb0db836908e1d0bf18b3f9aa60970484527d6ac0dc49855c3936
MD5 49fb90f67caf02471288ab6e7e3e2bbc
BLAKE2b-256 d13e89ebb83eae1d44f064730947d431db3f17a8c58ccb4d3183747e0648adc9

See more details on using hashes here.

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