Skip to content

Commit

Permalink
version 0.0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
donmezkutay committed Nov 14, 2020
1 parent caccd85 commit bb1ce12
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
13 changes: 6 additions & 7 deletions Usage_Examples/painter.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,19 @@
"""

from visjobs.datas import get_MODEL
from visjobs.visualize import draw_map
from visjobs.visualize import easy_plot
import numpy as np
import xarray as xr

data = get_data.pick_data(latest=True, hour='06', model='GFS', resolution=0.25)

time, dt_dict = get_data.pick_area(data, init_time=0 ,total_process=10, interval=1,
list_of_vars=['prmslmsl', 'tmpprs', 'hgtprs'],
list_of_areas=['europe'],pr_height=[500])
dt_dict = get_data.pick_area(data, init_time=0 ,total_process=10, interval=1,
list_of_vars=['prmslmsl', 'tmpprs', 'hgtprs'],
list_of_areas=['europe'],pr_height=['500'])

pr = np.divide(dt_dict['europe'][0],100) #to hPa
temp = np.subtract(dt_dict['europe'][1],273.15) #DegreeC
hgt = dt_dict['europe'][2] # metres
pr = np.divide(dt_dict['europe']['prmslmsl'], 100) #to hPa
temp = np.subtract(dt_dict['europe']['tmpprs'], 273.15) #DegreeC
hgt = dt_dict['europe']['hgtprs'] # metres

lon = pr.lon[:].values
lat = pr.lat[:].values
Expand Down
8 changes: 4 additions & 4 deletions Usage_Examples/relative_vorticity.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
time, dt_dict = get_data.pick_area(data, total_process=32, interval=1, pr_height=['500'], list_of_vars=['ugrdprs', 'vgrdprs', 'hgtprs','prmslmsl'],
list_of_areas=['europe'], )
#set data
uw = dt_dict['europe'][0]
vw = dt_dict['europe'][1]
hgt = dt_dict['europe'][2]
prs = dt_dict['europe'][3] / 100
uw = dt_dict['europe']['ugrdprs']
vw = dt_dict['europe']['vgrdprs']
hgt = dt_dict['europe']['hgtprs']
prs = dt_dict['europe']['prmslmsl'] / 100


#set lat lon
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="visjobs", # Replace with your own username
version="0.0.13",
version="0.0.14",
author="Kutay Donmez & Berkay Donmez",
author_email="[email protected]",
description="Get The Latest Atmospheric Model Data | Analyse | Visualize Easily",
Expand Down
6 changes: 3 additions & 3 deletions visjobs/datas/get_MODEL.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def pick_area(data ,total_process, interval ,list_of_vars, list_of_areas, init_t
#looping in the list of areas
say_pl = 1
for pl in list_of_areas:
variables_l = []
variables_l = {}
#looping in the list of variables
say_var =1
for var in list_of_vars:
Expand All @@ -247,11 +247,11 @@ def pick_area(data ,total_process, interval ,list_of_vars, list_of_areas, init_t
lat=slice(p_d[pl][2],p_d[pl][3]),).isel(time=slice(init_time, total_process, interval))

#append a single variable given by the user
variables_l.append(single)
variables_l[var] = single


#append all the variables with respect to their area of interest.
places_dict[pl] = variables_l[0]
places_dict[pl] = variables_l

#return
return places_dict

0 comments on commit bb1ce12

Please sign in to comment.