Package: noaawc
NOAAWCLibrary for plotting the world data climate with the dataNOMADSNOAA/NASAPlease,Fork-me.Installation$pipinstallnoaawc-UExamplesplottingwind temperature with focus pointfromnoaawc.plotimportplot_globalfromnoawclg.mainimportget_noaa_dataasgndimportmatplotlib.pyplotaspltplt.style.use('dark_background')cmap='inferno'date_base='26/01/2023'dn=gnd(date=date_base)indice=5pg=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=indicepg.loc_focus=(-9.43847,-40.5052)pg.text_cb='°C'pg.author='@gpftc | @reinanbr_'pg.cmap=cmappg.render(show=True)wind temperature with focus point and text focusfromnoaawc.plotimportplot_globalfromnoawclg.mainimportget_noaa_dataasgndimportmatplotlib.pyplotaspltplt.style.use('dark_background')cmap='inferno'date_base='26/01/2023'dn=gnd(date=date_base)indice=5pg=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=indicepg.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=cmappg.render(show=True)wind temperature with focus point, text focus and zoomfromnoaawc.plotimportplot_globalfromnoawclg.mainimportget_noaa_dataasgndimportmatplotlib.pyplotaspltplt.style.use('dark_background')cmap='inferno'date_base='26/01/2023'dn=gnd(date=date_base)indice=5pg=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=indicepg.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=cmappg.render(show=True)Animation GIFFirst time with the classnoaawc.animate.Create_plot_gif:>>>fromnoaawc.animateimportCreate_plot_gifascgpinit var's in the class#.../noaawc/animate.py#...importmatplotlib.pyplotaspltfromnoawclg.mainimportget_noaa_dataasgnd#...@dataclassclassCreate_plot_gif:dn:gndpath_save:str='img.gif'size:int=70path_data:str='data/img_'title:str=''key_noaa:str='vgrdpbl'loc_focus:tuple=(-9.45,-40.5)point_init=Falsepoint_end:float=Falsetext_cb:str='°C'lon_stop:float=Falsealpha:float=.9subtr_data:float=273speed_frame:float=1speed_degree_frame:float=1zoom:tuple=Noneauthor='@gpfc_ | @reinanbr_'annotate_focus_txt:str=Noneannotate_loc_txt:str=Noneannotate_loc_pos:tuple=(40.776676,-73.971321)color_annote_loc:str='white'fps:float=10cmap:plt.cm=plt.cm.jetresolution:str='c'#...Wind Jet'sspinningfromnoaawc.animateimportCreate_plot_gifasCpf# importing class to work gif plotfromnoawclg.mainimportget_noaa_dataasgnd# importing class to work datadn=gnd(date='16/01/2023')# set the now date (best yesterday) in format d/m/Ypoint_init=[-9.43,-89]#point init to spinningpoint_jua=[-9.43,-40.50]# end point (my city)gif=Cpf(dn=dn)# setting data noaa on the class to work gifcmap='inferno'# cmap theme color plotgif.path_save=f'tests_gifs/wind/{cmap}_test_spin_temp_wind.gif'#path to save gifgif.key_noaa='tmpmwl'# key from data that we wantgif.title='temperatura dos jatos de vento'# title plot gif#setting the pointsgif.point_init=point_initgif.point_end=point_jua#longitude stopgif.lon_stop=-39# setting cmapgif.cmap=cmapgif.author='@gpfc_ | @reinanbr_'#setting the title author plotgif.text_cb='ºC'#title from colorbargif.subtr_data=273# substitution of data (273, because K - 273 = ºC)gif.tracing()# working string's, map's, daw's, line'sgif.render()# rendering the frames of gifin the .../tests_gifs/wind/CMRmap_test_spin_temp_wind.gif:surface temperaturefromnoaawc.animateimportCreate_plot_gifasCpffromnoawclg.mainimportget_noaa_dataasgnddn=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_initgif.point_end=point_juagif.lon_stop=-39gif.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 textgif.annotate_loc_txt='. Nova York:%(data)sºC'# text for write in the plotgif.color_annote_loc='white'# color of textgif.tracing()gif.render()zoom on a focusfromnoaawc.animateimportCreate_plot_gifasCpffromnoawclg.mainimportget_noaa_dataasgnddn=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_juagif.zoom=(4,-4,-.5,6)# xl,xr,yu,yd for zoomgif.annotate_focus_txt='. Juazeiro:%(data)sºC'# write text on focus pointgif.annotate_loc_txt='. Nova York:%(data)sºC'gif.tracing()gif.render()