noaawc


Namenoaawc JSON
Version 0.2 PyPI version JSON
download
home_pagehttps://github.com/reinanbr/noaawc
SummaryLibrary for plotting dataset from noaa site in basemap
upload_time2023-05-24 23:23:40
maintainer
docs_urlNone
authorReinan Br
requires_python
licenseGPLv3
keywords climate weather noaa plots
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
<h1 align='center'></h1>
<p align='center'>
<img src='https://raw.githubusercontent.com/reinanbr/noaawc/main/img/photo_2023-01-17_02-10-48.jpg' width='350' height='300'>


<br/>
<a href="https://github.com/perseu912"><img title="Autor" src="https://img.shields.io/badge/Autor-reinan_br-blue.svg?style=for-the-badge&logo=github"></a>

<p align='center'>
<!-- github dados --
<!-- sites de pacotes -->
<a href='https://pypi.org/project/noaawc/'><img src='https://img.shields.io/pypi/v/noaawc'></a>
<!-- <a href='#'><img src='https://img.shields.io/pypi/wheel/noaawc'></a>
<a href='#'><img alt="PyPI - Downloads" src="https://img.shields.io/pypi/dm/noawclg"></a> -->
<img alt="PyPI - License" src="https://img.shields.io/pypi/l/noaawc">
<br/>
<!-- outros premios e analises -->
<!-- <a href='#'><img alt="CodeFactor Grade" src="https://img.shields.io/codefactor/grade/github/perseu912/noawclg?logo=codefactor">
</a> -->
<!-- redes sociais -->
<a href='https://instagram.com/gpftc_ifsertao/'><img src='https://shields.io/badge/insta-gpftc_ifsertao-darkviolet?logo=instagram&style=flat'></a>
<a href='https://discord.gg/pFZP86gvEm'><img src='https://img.shields.io/discord/856582838467952680.svg?label=discord&logo=discord'></a>

</p>
</p>
<h3 align='center'>NOAAWC</h3>
<p align='center'> <b>Library for plotting the world data climate with the data <a href='https://nomads.ncep.noaa.gov/' title='NOAA Operational Model Archive and Distribution System
'>NOMADS</a> NOAA/NASA</b></p>
<hr/>

Please, <a href='https://github.com/reinanbr/noaawc'>Fork-me</a>.

## Installation

```bash
$ pip install noaawc -U
```




## Examples

### plotting 


#### wind temperature with focus point


```py
from noaawc.plot import plot_global
from noawclg.main import get_noaa_data as gnd
import matplotlib.pyplot as plt

plt.style.use('dark_background')
cmap = 'inferno'

date_base = '26/01/2023'
dn = gnd(date=date_base)
indice = 5



pg = plot_global(dn=dn)
pg.path=f'{cmap}_juazeiro_wind_focus1.png'
pg.title=f'Temperatura dos Jatos de Ventos'
pg.key_noaa='tmpmwl'
pg.indice=indice

pg.loc_focus=(-9.43847,-40.5052)

pg.text_cb='°C'
pg.author='@gpftc | @reinanbr_'
pg.cmap = cmap



pg.render(show=True)

```

<img height='300' src='https://raw.githubusercontent.com/reinanbr/noaawc/main/inferno_juazeiro_wind_focus1.png'/>



<hr>

#### wind temperature with focus point and text focus 

```py
from noaawc.plot import plot_global
from noawclg.main import get_noaa_data as gnd
import matplotlib.pyplot as plt

plt.style.use('dark_background')
cmap = 'inferno'

date_base = '26/01/2023'
dn = gnd(date=date_base)
indice = 5



pg = plot_global(dn=dn)
pg.path=f'{cmap}_juazeiro_wind_focus2.png'
pg.title=f'Temperatura dos Jatos de Ventos'
pg.key_noaa='tmpmwl'
pg.indice=indice

pg.loc_focus=(-9.43847,-40.5052)
pg.annotate_data_focus('. Juazeiro: %(data)sºC')
pg.annotate_color_focus = 'white'

pg.text_cb='°C'
pg.author='@gpftc | @reinanbr_'
pg.cmap = cmap



pg.render(show=True)

```

<img height='300' src='https://raw.githubusercontent.com/reinanbr/noaawc/main/inferno_juazeiro_wind_focus2.png'/>

<hr>

#### wind temperature with focus point, text focus and zoom


```py 
from noaawc.plot import plot_global
from noawclg.main import get_noaa_data as gnd
import matplotlib.pyplot as plt

plt.style.use('dark_background')
cmap = 'inferno'

date_base = '26/01/2023'
dn = gnd(date=date_base)
indice = 5



pg = plot_global(dn=dn)
pg.path=f'{cmap}_juazeiro_wind_focus.png'
pg.title=f'Temperatura dos Jatos de Ventos'
pg.key_noaa='tmpmwl'
pg.indice=indice

pg.loc_focus=(-9.43847,-40.5052)
pg.annotate_data_focus('. Juazeiro: %(data)sºC')
pg.annotate_color_focus = 'white'
pg.zoom(1,-1,-1,1)

pg.text_cb='°C'
pg.author='@gpftc | @reinanbr_'
pg.cmap = cmap



pg.render(show=True)
```

<img height='300' src='https://raw.githubusercontent.com/reinanbr/noaawc/main/inferno_juazeiro_wind_focus3.png'/>

<hr>

### Animation GIF

#### First time with the class ```noaawc.animate.Create_plot_gif```:

```py
>>>  from noaawc.animate import Create_plot_gif as cgp
```

init var's in the class
```py
#.../noaawc/animate.py
#...
import matplotlib.pyplot as plt
from noawclg.main import get_noaa_data as gnd
#...



@dataclass
class Create_plot_gif:
    dn:gnd
    path_save:str='img.gif'
    size:int=70
    path_data:str='data/img_'
    title:str=''
    key_noaa:str='vgrdpbl'
    loc_focus:tuple=(-9.45,-40.5)
    point_init=False
    point_end:float=False
    text_cb:str='°C'
    lon_stop:float=False
    alpha:float=.9
    subtr_data:float=273
    speed_frame:float=1
    speed_degree_frame:float=1
    zoom:tuple = None
    author = '@gpfc_ | @reinanbr_'
    annotate_focus_txt:str = None
    annotate_loc_txt:str = None
    annotate_loc_pos:tuple = (40.776676,-73.971321)
    color_annote_loc:str = 'white'
    fps:float = 10
    cmap:plt.cm=plt.cm.jet
    resolution:str = 'c'


#...

```

#### Wind Jet's
spinning
```py
from noaawc.animate import Create_plot_gif as Cpf # importing class to work gif plot
from noawclg.main import get_noaa_data as gnd # importing class to work data

dn = gnd(date='16/01/2023') # set the now date (best yesterday) in format d/m/Y

point_init=[-9.43,-89] #point init to spinning
point_jua = [-9.43,-40.50] # end point (my city)

gif = Cpf(dn=dn) # setting data noaa on the class to work gif

cmap = 'inferno' # cmap theme color plot

gif.path_save=f'tests_gifs/wind/{cmap}_test_spin_temp_wind.gif' #path to save gif

gif.key_noaa = 'tmpmwl' # key from data that we want 

gif.title='temperatura dos jatos de vento' # title plot gif

#setting the points
gif.point_init=point_init 
gif.point_end=point_jua

#longitude stop
gif.lon_stop=-39

# setting cmap
gif.cmap = cmap

gif.author = '@gpfc_ | @reinanbr_' #setting the title author plot

gif.text_cb = 'ºC' #title from colorbar
gif.subtr_data = 273 # substitution of data (273, because K - 273 = ºC)

gif.tracing() # working string's, map's, daw's, line's
gif.render() # rendering the frames of gif
```

in the .../tests_gifs/wind/CMRmap_test_spin_temp_wind.gif:

<img height='300' src='https://raw.githubusercontent.com/reinanbr/noaawc/main/tests_gifs/wind/CMRmap_test_spin_temp_wind.gif'>

<hr>

#### surface temperature
```py
from noaawc.animate import Create_plot_gif as Cpf
from noawclg.main import get_noaa_data as gnd

dn = gnd(date='16/01/2023')

point_init=[-9.43,-89]
point_jua = [-9.43,-40.50]

gif = Cpf(dn=dn)
gif.path_save='https://raw.githubusercontent.com/reinanbr/noaawc/main/tests_gifs/surface_temp/CMRmap_test_spin_temp_surface.gif'
gif.key_noaa = 'tmpsfc'
gif.title='temperatura da superficie'
gif.point_init=point_init
gif.point_end=point_jua
gif.lon_stop=-39
gif.annotate_loc_txt = '. Nova York: %(data)sºC'
gif.color_annote_loc = 'white'
gif.cmap = 'CMRmap'

gif.annotate_loc_pos:tuple = (40.776676,-73.971321) # point for write a text
gif.annotate_loc_txt = '. Nova York: %(data)sºC' # text for write in the plot
gif.color_annote_loc = 'white' # color of text

gif.tracing()
gif.render()
```
<img height='300' src='https://raw.githubusercontent.com/reinanbr/noaawc/main/tests_gifs/surface_temp/CMRmap_test_spin_temp_surface.gif'>

<hr>

#### zoom on a focus
```py
from noaawc.animate import Create_plot_gif as Cpf
from noawclg.main import get_noaa_data as gnd

dn = gnd()

gif = Cpf(dn=dn)
gif.path_save='tests_gifs/test_zoom_focus_temp_surface.gif'
gif.key_noaa = 'tmpsfc'
gif.title='temperatura da superficie'
gif.loc_focus= point_jua
gif.zoom = (4,-4,-.5,6) # xl,xr,yu,yd for zoom
gif.annotate_focus_txt = '. Juazeiro: %(data)sºC' # write text on focus point
gif.annotate_loc_txt = '. Nova York: %(data)sºC'
gif.tracing()
gif.render()
```
<img height='300' src='https://raw.githubusercontent.com/reinanbr/noaawc/main/tests_gifs/surface_temp/test_zoom_focus_temp_surface.gif'>

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/reinanbr/noaawc",
    "name": "noaawc",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "climate weather noaa plots",
    "author": "Reinan Br",
    "author_email": "slimchatuba@gmail.com",
    "download_url": "",
    "platform": null,
    "description": "\n<h1 align='center'></h1>\n<p align='center'>\n<img src='https://raw.githubusercontent.com/reinanbr/noaawc/main/img/photo_2023-01-17_02-10-48.jpg' width='350' height='300'>\n\n\n<br/>\n<a href=\"https://github.com/perseu912\"><img title=\"Autor\" src=\"https://img.shields.io/badge/Autor-reinan_br-blue.svg?style=for-the-badge&logo=github\"></a>\n\n<p align='center'>\n<!-- github dados --\n<!-- sites de pacotes -->\n<a href='https://pypi.org/project/noaawc/'><img src='https://img.shields.io/pypi/v/noaawc'></a>\n<!-- <a href='#'><img src='https://img.shields.io/pypi/wheel/noaawc'></a>\n<a href='#'><img alt=\"PyPI - Downloads\" src=\"https://img.shields.io/pypi/dm/noawclg\"></a> -->\n<img alt=\"PyPI - License\" src=\"https://img.shields.io/pypi/l/noaawc\">\n<br/>\n<!-- outros premios e analises -->\n<!-- <a href='#'><img alt=\"CodeFactor Grade\" src=\"https://img.shields.io/codefactor/grade/github/perseu912/noawclg?logo=codefactor\">\n</a> -->\n<!-- redes sociais -->\n<a href='https://instagram.com/gpftc_ifsertao/'><img src='https://shields.io/badge/insta-gpftc_ifsertao-darkviolet?logo=instagram&style=flat'></a>\n<a href='https://discord.gg/pFZP86gvEm'><img src='https://img.shields.io/discord/856582838467952680.svg?label=discord&logo=discord'></a>\n\n</p>\n</p>\n<h3 align='center'>NOAAWC</h3>\n<p align='center'> <b>Library for plotting the world data climate with the data <a href='https://nomads.ncep.noaa.gov/' title='NOAA Operational Model Archive and Distribution System\n'>NOMADS</a> NOAA/NASA</b></p>\n<hr/>\n\nPlease, <a href='https://github.com/reinanbr/noaawc'>Fork-me</a>.\n\n## Installation\n\n```bash\n$ pip install noaawc -U\n```\n\n\n\n\n## Examples\n\n### plotting \n\n\n#### wind temperature with focus point\n\n\n```py\nfrom noaawc.plot import plot_global\nfrom noawclg.main import get_noaa_data as gnd\nimport matplotlib.pyplot as plt\n\nplt.style.use('dark_background')\ncmap = 'inferno'\n\ndate_base = '26/01/2023'\ndn = gnd(date=date_base)\nindice = 5\n\n\n\npg = plot_global(dn=dn)\npg.path=f'{cmap}_juazeiro_wind_focus1.png'\npg.title=f'Temperatura dos Jatos de Ventos'\npg.key_noaa='tmpmwl'\npg.indice=indice\n\npg.loc_focus=(-9.43847,-40.5052)\n\npg.text_cb='\u00b0C'\npg.author='@gpftc | @reinanbr_'\npg.cmap = cmap\n\n\n\npg.render(show=True)\n\n```\n\n<img height='300' src='https://raw.githubusercontent.com/reinanbr/noaawc/main/inferno_juazeiro_wind_focus1.png'/>\n\n\n\n<hr>\n\n#### wind temperature with focus point and text focus \n\n```py\nfrom noaawc.plot import plot_global\nfrom noawclg.main import get_noaa_data as gnd\nimport matplotlib.pyplot as plt\n\nplt.style.use('dark_background')\ncmap = 'inferno'\n\ndate_base = '26/01/2023'\ndn = gnd(date=date_base)\nindice = 5\n\n\n\npg = plot_global(dn=dn)\npg.path=f'{cmap}_juazeiro_wind_focus2.png'\npg.title=f'Temperatura dos Jatos de Ventos'\npg.key_noaa='tmpmwl'\npg.indice=indice\n\npg.loc_focus=(-9.43847,-40.5052)\npg.annotate_data_focus('. Juazeiro: %(data)s\u00baC')\npg.annotate_color_focus = 'white'\n\npg.text_cb='\u00b0C'\npg.author='@gpftc | @reinanbr_'\npg.cmap = cmap\n\n\n\npg.render(show=True)\n\n```\n\n<img height='300' src='https://raw.githubusercontent.com/reinanbr/noaawc/main/inferno_juazeiro_wind_focus2.png'/>\n\n<hr>\n\n#### wind temperature with focus point, text focus and zoom\n\n\n```py \nfrom noaawc.plot import plot_global\nfrom noawclg.main import get_noaa_data as gnd\nimport matplotlib.pyplot as plt\n\nplt.style.use('dark_background')\ncmap = 'inferno'\n\ndate_base = '26/01/2023'\ndn = gnd(date=date_base)\nindice = 5\n\n\n\npg = plot_global(dn=dn)\npg.path=f'{cmap}_juazeiro_wind_focus.png'\npg.title=f'Temperatura dos Jatos de Ventos'\npg.key_noaa='tmpmwl'\npg.indice=indice\n\npg.loc_focus=(-9.43847,-40.5052)\npg.annotate_data_focus('. Juazeiro: %(data)s\u00baC')\npg.annotate_color_focus = 'white'\npg.zoom(1,-1,-1,1)\n\npg.text_cb='\u00b0C'\npg.author='@gpftc | @reinanbr_'\npg.cmap = cmap\n\n\n\npg.render(show=True)\n```\n\n<img height='300' src='https://raw.githubusercontent.com/reinanbr/noaawc/main/inferno_juazeiro_wind_focus3.png'/>\n\n<hr>\n\n### Animation GIF\n\n#### First time with the class ```noaawc.animate.Create_plot_gif```:\n\n```py\n>>>  from noaawc.animate import Create_plot_gif as cgp\n```\n\ninit var's in the class\n```py\n#.../noaawc/animate.py\n#...\nimport matplotlib.pyplot as plt\nfrom noawclg.main import get_noaa_data as gnd\n#...\n\n\n\n@dataclass\nclass Create_plot_gif:\n    dn:gnd\n    path_save:str='img.gif'\n    size:int=70\n    path_data:str='data/img_'\n    title:str=''\n    key_noaa:str='vgrdpbl'\n    loc_focus:tuple=(-9.45,-40.5)\n    point_init=False\n    point_end:float=False\n    text_cb:str='\u00b0C'\n    lon_stop:float=False\n    alpha:float=.9\n    subtr_data:float=273\n    speed_frame:float=1\n    speed_degree_frame:float=1\n    zoom:tuple = None\n    author = '@gpfc_ | @reinanbr_'\n    annotate_focus_txt:str = None\n    annotate_loc_txt:str = None\n    annotate_loc_pos:tuple = (40.776676,-73.971321)\n    color_annote_loc:str = 'white'\n    fps:float = 10\n    cmap:plt.cm=plt.cm.jet\n    resolution:str = 'c'\n\n\n#...\n\n```\n\n#### Wind Jet's\nspinning\n```py\nfrom noaawc.animate import Create_plot_gif as Cpf # importing class to work gif plot\nfrom noawclg.main import get_noaa_data as gnd # importing class to work data\n\ndn = gnd(date='16/01/2023') # set the now date (best yesterday) in format d/m/Y\n\npoint_init=[-9.43,-89] #point init to spinning\npoint_jua = [-9.43,-40.50] # end point (my city)\n\ngif = Cpf(dn=dn) # setting data noaa on the class to work gif\n\ncmap = 'inferno' # cmap theme color plot\n\ngif.path_save=f'tests_gifs/wind/{cmap}_test_spin_temp_wind.gif' #path to save gif\n\ngif.key_noaa = 'tmpmwl' # key from data that we want \n\ngif.title='temperatura dos jatos de vento' # title plot gif\n\n#setting the points\ngif.point_init=point_init \ngif.point_end=point_jua\n\n#longitude stop\ngif.lon_stop=-39\n\n# setting cmap\ngif.cmap = cmap\n\ngif.author = '@gpfc_ | @reinanbr_' #setting the title author plot\n\ngif.text_cb = '\u00baC' #title from colorbar\ngif.subtr_data = 273 # substitution of data (273, because K - 273 = \u00baC)\n\ngif.tracing() # working string's, map's, daw's, line's\ngif.render() # rendering the frames of gif\n```\n\nin the .../tests_gifs/wind/CMRmap_test_spin_temp_wind.gif:\n\n<img height='300' src='https://raw.githubusercontent.com/reinanbr/noaawc/main/tests_gifs/wind/CMRmap_test_spin_temp_wind.gif'>\n\n<hr>\n\n#### surface temperature\n```py\nfrom noaawc.animate import Create_plot_gif as Cpf\nfrom noawclg.main import get_noaa_data as gnd\n\ndn = gnd(date='16/01/2023')\n\npoint_init=[-9.43,-89]\npoint_jua = [-9.43,-40.50]\n\ngif = Cpf(dn=dn)\ngif.path_save='https://raw.githubusercontent.com/reinanbr/noaawc/main/tests_gifs/surface_temp/CMRmap_test_spin_temp_surface.gif'\ngif.key_noaa = 'tmpsfc'\ngif.title='temperatura da superficie'\ngif.point_init=point_init\ngif.point_end=point_jua\ngif.lon_stop=-39\ngif.annotate_loc_txt = '. Nova York: %(data)s\u00baC'\ngif.color_annote_loc = 'white'\ngif.cmap = 'CMRmap'\n\ngif.annotate_loc_pos:tuple = (40.776676,-73.971321) # point for write a text\ngif.annotate_loc_txt = '. Nova York: %(data)s\u00baC' # text for write in the plot\ngif.color_annote_loc = 'white' # color of text\n\ngif.tracing()\ngif.render()\n```\n<img height='300' src='https://raw.githubusercontent.com/reinanbr/noaawc/main/tests_gifs/surface_temp/CMRmap_test_spin_temp_surface.gif'>\n\n<hr>\n\n#### zoom on a focus\n```py\nfrom noaawc.animate import Create_plot_gif as Cpf\nfrom noawclg.main import get_noaa_data as gnd\n\ndn = gnd()\n\ngif = Cpf(dn=dn)\ngif.path_save='tests_gifs/test_zoom_focus_temp_surface.gif'\ngif.key_noaa = 'tmpsfc'\ngif.title='temperatura da superficie'\ngif.loc_focus= point_jua\ngif.zoom = (4,-4,-.5,6) # xl,xr,yu,yd for zoom\ngif.annotate_focus_txt = '. Juazeiro: %(data)s\u00baC' # write text on focus point\ngif.annotate_loc_txt = '. Nova York: %(data)s\u00baC'\ngif.tracing()\ngif.render()\n```\n<img height='300' src='https://raw.githubusercontent.com/reinanbr/noaawc/main/tests_gifs/surface_temp/test_zoom_focus_temp_surface.gif'>\n",
    "bugtrack_url": null,
    "license": "GPLv3",
    "summary": "Library for plotting dataset from noaa site in basemap",
    "version": "0.2",
    "project_urls": {
        "Homepage": "https://github.com/reinanbr/noaawc"
    },
    "split_keywords": [
        "climate",
        "weather",
        "noaa",
        "plots"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4f8eb2aca335bf807132712ca125f823015791de1d40d1a13e4a352387aba657",
                "md5": "06fb0b2f2f09977d699b16dae6dee9d7",
                "sha256": "adc6b3248a65cd165b381be7ef50eeead2356ce0a227b898d7868ec59b895a62"
            },
            "downloads": -1,
            "filename": "noaawc-0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "06fb0b2f2f09977d699b16dae6dee9d7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 10381,
            "upload_time": "2023-05-24T23:23:40",
            "upload_time_iso_8601": "2023-05-24T23:23:40.739163Z",
            "url": "https://files.pythonhosted.org/packages/4f/8e/b2aca335bf807132712ca125f823015791de1d40d1a13e4a352387aba657/noaawc-0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-24 23:23:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "reinanbr",
    "github_project": "noaawc",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "noaawc"
}
        
Elapsed time: 0.33973s