-
Notifications
You must be signed in to change notification settings - Fork 6
/
README
95 lines (71 loc) · 2.64 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# windyLib
version: 0.1.5 [![](https://img.shields.io/badge/python-3.5-blue.svg)](https://www.python.org/download/releases/3.5/)
ONLY WORK ON PYTHON 3.
## Description
windyLib is a library including helper functions which can request and analyze the weather forecast data from www.windy.com
## How to install
```
pip3 install windyLib
```
if you have a "permission" denied error, please try:
```
sudo pip3 install windyLib
```
## Class
```
class windyWeather()
```
- org (string): 'EC' or 'GFS' (one of the world weather models)
- lon (float): longitude of the location
- lat (float): latitude of the location
- JSON (json): the json type of the data returned by windy.com
- verticalInfo (3D array): proceesed data from JSON
## Functions
```
updateInfo(self, inputOrg, inputLon, inputLat)
```
This function is used to update the point's information. Calling this function will automatically update JSON and verticalInfo.
- inputOrg (string): 'EC' or 'GFS' (one of the world weather models)
- inputLon (float): longitude of the location
- inputLat (float): latitude of the location
```
updateWeatherData()
```
This function will update the weather information of picked point.
return type:
- (json) the raw json file from windy.com
```
def getVerticalWeather(self)
```
This function will return a 3D array with all the data processed
return type:
- (array) 3D array([element, time, pressure(Geoheight)]) after the analysis from the json data from windy.com
[time, Pressure(Geoheight), Temperature, Humidity, windUcomonent, windVcomponent]
- every component is a 2D array, if you want to achieve only one time point, for example, the initial value of Temperature, you can use Temperature[0]
- every 1D array in the previous 2D array is element vs. Pressure(Geoheight)
```
getCertainTimeVerticalWeather(self, timePoint)
```
This function will return the detailed vertical weather in a certain time point.
- timePoint (int): (you can use getNumberOfData(self, timeStr) function to find index)the Index of the time you want to get the detailed weather information
return type:
- (array): [time, [Pressure], [Temperature], [Humidity], [windUcomonent], [windVcomponent]]
```
getNumberOfData(self, timeStr)
```
This function will return the index of the time in the time points array
- timeStr (string): the time you want to find, with format(DDHH).
return type:
- time point(int): (int)
```
getInfo(self)
```
This function will return the basic information of a picked points
return type:
- array: [organization, longitude of point, latitude of point, reference time]
```
def getJSON(self):
```
This function will return the json retrieved from windy.com
return type:
- json: (json)