dataset update draft + setup script

This commit is contained in:
jexck committed 2025-05-06 14:54:50 +07:00
1 parent 670cd0aebc
commit 8524c81410
3 files changed
+403

No files matched your search

+45
View File
@@ -0,0 +1,45 @@
# setup_tensorflow.ps1
#!!!!!!!!!!!!!!!
# NOTICE
# if cant run run this first:
# Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
# Ensure script runs from its own directory
Set-Location -Path $PSScriptRoot
# Check Python version
$pythonVersion = & python --version
Write-Host "Detected Python version: $pythonVersion"
# Create virtual environment
python -m venv .venv
# Activate virtual environment
. .\.venv\Scripts\Activate.ps1
# Upgrade pip
python -m pip install --upgrade pip
# Install TensorFlow (CPU version)
pip install tensorflow
# Install additional dependencies
pip install numpy pandas matplotlib scikit-learn jupyter statsmodels requests
# Verify TensorFlow installation
python -c "import tensorflow as tf; print('TensorFlow version:', tf.__version__)"
# Optional: Check for GPU availability
python -c "import tensorflow as tf; print('GPUs available:', tf.config.list_physical_devices('GPU'))"
# Verify installations
python -c "import sklearn; print('scikit-learn version:', sklearn.__version__)"
python -c "import matplotlib; print('matplotlib version:', matplotlib.__version__)"
python -c "import pandas as pd; print('pandas version:', pd.__version__)"
python -c "import statsmodels.api as sm; print('statsmodels version:', sm.__version__)"
python -c "import requests; print('requests exists:', requests.__version__)"
+31
View File
@@ -0,0 +1,31 @@
import requests
import pandas as pd
from datetime import datetime
# Define parameters
latitude = 21.0305
longitude = 105.8458
start_date = "2024-06-24"
end_date = datetime.now().strftime("%Y-%m-%d") # Today's date
# Construct the API URL
url = (
f"https://power.larc.nasa.gov/api/temporal/daily/point"
f"?parameters=QV2M"
f"&community=RE"
f"&longitude={longitude}"
f"&latitude={latitude}"
f"&start={start_date.replace('-', '')}"
f"&end={end_date.replace('-', '')}"
f"&format=CSV"
)
# Make the API request
response = requests.get(url)
if response.status_code == 200:
# Save the CSV content to a file
with open("hanoi_qv2m_latest.csv", "w") as file:
file.write(response.text)
print("Data successfully downloaded and saved to 'hanoi_qv2m_latest.csv'.")
else:
print(f"Failed to retrieve data: {response.status_code}")
+327
View File
@@ -0,0 +1,327 @@
-BEGIN HEADER-␍
NASA/POWER Source Native Resolution Daily Data ␍
Dates (month/day/year): 06/24/2024 through 05/06/2025 in LST␍
Location: latitude 21.0305 longitude 105.8458 ␍
elevation from MERRA-2: Average for 0.5 x 0.625 degree lat/lon region = 87.73 meters␍
The value for missing source data that cannot be computed or is outside of the sources availability range: -999 ␍
parameter(s): ␍
QV2M MERRA-2 Specific Humidity at 2 Meters (g/kg) ␍
-END HEADER-␍
YEAR,MO,DY,QV2M
2024,6,24,21.04
2024,6,25,21.36
2024,6,26,21.37
2024,6,27,21.11
2024,6,28,21.8
2024,6,29,22.21
2024,6,30,22.17
2024,7,1,21.63
2024,7,2,20.98
2024,7,3,22.14
2024,7,4,21.59
2024,7,5,20.86
2024,7,6,21.47
2024,7,7,21.74
2024,7,8,21.68
2024,7,9,22.06
2024,7,10,22.5
2024,7,11,21.78
2024,7,12,21.37
2024,7,13,22.14
2024,7,14,22.12
2024,7,15,21.48
2024,7,16,21.72
2024,7,17,21.14
2024,7,18,21.13
2024,7,19,21.64
2024,7,20,22.11
2024,7,21,21.34
2024,7,22,20.41
2024,7,23,20.64
2024,7,24,21.53
2024,7,25,21.82
2024,7,26,21.71
2024,7,27,22.0
2024,7,28,22.89
2024,7,29,21.96
2024,7,30,21.48
2024,7,31,20.91
2024,8,1,20.39
2024,8,2,20.53
2024,8,3,20.64
2024,8,4,21.31
2024,8,5,21.56
2024,8,6,21.37
2024,8,7,21.23
2024,8,8,21.89
2024,8,9,22.17
2024,8,10,22.02
2024,8,11,23.39
2024,8,12,22.19
2024,8,13,20.99
2024,8,14,21.01
2024,8,15,21.5
2024,8,16,21.26
2024,8,17,21.08
2024,8,18,21.37
2024,8,19,21.67
2024,8,20,21.85
2024,8,21,22.18
2024,8,22,22.34
2024,8,23,21.49
2024,8,24,20.78
2024,8,25,20.74
2024,8,26,21.03
2024,8,27,20.4
2024,8,28,20.83
2024,8,29,21.7
2024,8,30,21.69
2024,8,31,21.21
2024,9,1,21.04
2024,9,2,21.23
2024,9,3,20.95
2024,9,4,20.91
2024,9,5,21.87
2024,9,6,22.46
2024,9,7,20.38
2024,9,8,22.21
2024,9,9,22.59
2024,9,10,19.73
2024,9,11,18.93
2024,9,12,19.58
2024,9,13,20.13
2024,9,14,20.97
2024,9,15,19.92
2024,9,16,20.7
2024,9,17,20.91
2024,9,18,20.88
2024,9,19,21.2
2024,9,20,21.49
2024,9,21,21.34
2024,9,22,18.08
2024,9,23,15.67
2024,9,24,15.72
2024,9,25,17.01
2024,9,26,18.15
2024,9,27,20.34
2024,9,28,21.82
2024,9,29,22.5
2024,9,30,22.59
2024,10,1,17.75
2024,10,2,13.32
2024,10,3,12.16
2024,10,4,12.46
2024,10,5,12.75
2024,10,6,14.79
2024,10,7,15.56
2024,10,8,14.75
2024,10,9,15.01
2024,10,10,14.92
2024,10,11,14.56
2024,10,12,16.09
2024,10,13,17.78
2024,10,14,18.31
2024,10,15,18.89
2024,10,16,17.75
2024,10,17,18.73
2024,10,18,19.35
2024,10,19,19.14
2024,10,20,18.75
2024,10,21,18.82
2024,10,22,18.3
2024,10,23,13.04
2024,10,24,12.12
2024,10,25,11.88
2024,10,26,12.38
2024,10,27,13.23
2024,10,28,11.89
2024,10,29,12.62
2024,10,30,14.27
2024,10,31,14.25
2024,11,1,12.54
2024,11,2,10.86
2024,11,3,12.62
2024,11,4,14.28
2024,11,5,13.31
2024,11,6,12.96
2024,11,7,12.3
2024,11,8,10.86
2024,11,9,10.56
2024,11,10,11.53
2024,11,11,13.48
2024,11,12,15.48
2024,11,13,16.0
2024,11,14,16.8
2024,11,15,17.69
2024,11,16,17.32
2024,11,17,15.78
2024,11,18,13.79
2024,11,19,12.67
2024,11,20,11.13
2024,11,21,10.25
2024,11,22,10.07
2024,11,23,11.01
2024,11,24,13.13
2024,11,25,14.48
2024,11,26,10.12
2024,11,27,8.89
2024,11,28,8.4
2024,11,29,7.89
2024,11,30,8.23
2024,12,1,10.56
2024,12,2,12.95
2024,12,3,14.32
2024,12,4,13.74
2024,12,5,13.33
2024,12,6,13.49
2024,12,7,10.27
2024,12,8,8.06
2024,12,9,9.51
2024,12,10,12.57
2024,12,11,11.36
2024,12,12,8.62
2024,12,13,7.53
2024,12,14,6.2
2024,12,15,5.72
2024,12,16,5.88
2024,12,17,7.43
2024,12,18,7.79
2024,12,19,6.57
2024,12,20,6.94
2024,12,21,7.41
2024,12,22,6.65
2024,12,23,7.08
2024,12,24,6.82
2024,12,25,8.07
2024,12,26,9.09
2024,12,27,8.88
2024,12,28,6.77
2024,12,29,7.18
2024,12,30,9.45
2024,12,31,8.77
2025,1,1,9.01
2025,1,2,9.48
2025,1,3,8.9
2025,1,4,9.04
2025,1,5,8.48
2025,1,6,8.38
2025,1,7,10.05
2025,1,8,10.79
2025,1,9,8.49
2025,1,10,6.25
2025,1,11,5.25
2025,1,12,4.88
2025,1,13,6.18
2025,1,14,8.71
2025,1,15,7.92
2025,1,16,6.61
2025,1,17,7.2
2025,1,18,9.15
2025,1,19,9.57
2025,1,20,9.25
2025,1,21,9.1
2025,1,22,10.87
2025,1,23,11.66
2025,1,24,12.4
2025,1,25,13.38
2025,1,26,6.73
2025,1,27,4.98
2025,1,28,5.08
2025,1,29,6.57
2025,1,30,9.55
2025,1,31,12.04
2025,2,1,12.62
2025,2,2,11.92
2025,2,3,7.08
2025,2,4,6.33
2025,2,5,8.68
2025,2,6,10.71
2025,2,7,7.47
2025,2,8,5.87
2025,2,9,5.76
2025,2,10,7.78
2025,2,11,10.23
2025,2,12,11.98
2025,2,13,9.21
2025,2,14,11.81
2025,2,15,13.55
2025,2,16,12.12
2025,2,17,11.73
2025,2,18,10.42
2025,2,19,11.56
2025,2,20,12.26
2025,2,21,12.02
2025,2,22,12.23
2025,2,23,9.44
2025,2,24,7.47
2025,2,25,9.16
2025,2,26,9.68
2025,2,27,11.47
2025,2,28,13.32
2025,3,1,14.55
2025,3,2,15.38
2025,3,3,15.63
2025,3,4,15.82
2025,3,5,13.52
2025,3,6,7.54
2025,3,7,7.35
2025,3,8,9.21
2025,3,9,11.06
2025,3,10,12.61
2025,3,11,14.01
2025,3,12,15.53
2025,3,13,16.46
2025,3,14,16.73
2025,3,15,15.55
2025,3,16,8.23
2025,3,17,8.28
2025,3,18,8.03
2025,3,19,7.61
2025,3,20,7.59
2025,3,21,8.26
2025,3,22,9.52
2025,3,23,11.31
2025,3,24,12.96
2025,3,25,14.77
2025,3,26,15.56
2025,3,27,16.38
2025,3,28,16.95
2025,3,29,9.29
2025,3,30,7.54
2025,3,31,7.78
2025,4,1,8.88
2025,4,2,9.74
2025,4,3,10.32
2025,4,4,12.76
2025,4,5,13.94
2025,4,6,14.16
2025,4,7,14.74
2025,4,8,15.99
2025,4,9,16.53
2025,4,10,16.99
2025,4,11,18.25
2025,4,12,17.02
2025,4,13,11.06
2025,4,14,11.39
2025,4,15,12.32
2025,4,16,13.41
2025,4,17,17.43
2025,4,18,19.03
2025,4,19,18.94
2025,4,20,19.42
2025,4,21,20.04
2025,4,22,20.53
2025,4,23,20.75
2025,4,24,20.22
2025,4,25,18.37
2025,4,26,18.09
2025,4,27,19.44
2025,4,28,18.48
2025,4,29,16.88
2025,4,30,17.44
2025,5,1,17.31
2025,5,2,17.37
2025,5,3,19.26
2025,5,4,-999.0
2025,5,5,-999.0
2025,5,6,-999.0
1 -BEGIN HEADER-
2 NASA/POWER Source Native Resolution Daily Data
3 Dates (month/day/year): 06/24/2024 through 05/06/2025 in LST
4 Location: latitude 21.0305 longitude 105.8458
5 elevation from MERRA-2: Average for 0.5 x 0.625 degree lat/lon region = 87.73 meters
6 The value for missing source data that cannot be computed or is outside of the sources availability range: -999
7 parameter(s):
8 QV2M MERRA-2 Specific Humidity at 2 Meters (g/kg)
9 -END HEADER-
10 YEAR,MO,DY,QV2M
11 2024,6,24,21.04
12 2024,6,25,21.36
13 2024,6,26,21.37
14 2024,6,27,21.11
15 2024,6,28,21.8
16 2024,6,29,22.21
17 2024,6,30,22.17
18 2024,7,1,21.63
19 2024,7,2,20.98
20 2024,7,3,22.14
21 2024,7,4,21.59
22 2024,7,5,20.86
23 2024,7,6,21.47
24 2024,7,7,21.74
25 2024,7,8,21.68
26 2024,7,9,22.06
27 2024,7,10,22.5
28 2024,7,11,21.78
29 2024,7,12,21.37
30 2024,7,13,22.14
31 2024,7,14,22.12
32 2024,7,15,21.48
33 2024,7,16,21.72
34 2024,7,17,21.14
35 2024,7,18,21.13
36 2024,7,19,21.64
37 2024,7,20,22.11
38 2024,7,21,21.34
39 2024,7,22,20.41
40 2024,7,23,20.64
41 2024,7,24,21.53
42 2024,7,25,21.82
43 2024,7,26,21.71
44 2024,7,27,22.0
45 2024,7,28,22.89
46 2024,7,29,21.96
47 2024,7,30,21.48
48 2024,7,31,20.91
49 2024,8,1,20.39
50 2024,8,2,20.53
51 2024,8,3,20.64
52 2024,8,4,21.31
53 2024,8,5,21.56
54 2024,8,6,21.37
55 2024,8,7,21.23
56 2024,8,8,21.89
57 2024,8,9,22.17
58 2024,8,10,22.02
59 2024,8,11,23.39
60 2024,8,12,22.19
61 2024,8,13,20.99
62 2024,8,14,21.01
63 2024,8,15,21.5
64 2024,8,16,21.26
65 2024,8,17,21.08
66 2024,8,18,21.37
67 2024,8,19,21.67
68 2024,8,20,21.85
69 2024,8,21,22.18
70 2024,8,22,22.34
71 2024,8,23,21.49
72 2024,8,24,20.78
73 2024,8,25,20.74
74 2024,8,26,21.03
75 2024,8,27,20.4
76 2024,8,28,20.83
77 2024,8,29,21.7
78 2024,8,30,21.69
79 2024,8,31,21.21
80 2024,9,1,21.04
81 2024,9,2,21.23
82 2024,9,3,20.95
83 2024,9,4,20.91
84 2024,9,5,21.87
85 2024,9,6,22.46
86 2024,9,7,20.38
87 2024,9,8,22.21
88 2024,9,9,22.59
89 2024,9,10,19.73
90 2024,9,11,18.93
91 2024,9,12,19.58
92 2024,9,13,20.13
93 2024,9,14,20.97
94 2024,9,15,19.92
95 2024,9,16,20.7
96 2024,9,17,20.91
97 2024,9,18,20.88
98 2024,9,19,21.2
99 2024,9,20,21.49
100 2024,9,21,21.34
101 2024,9,22,18.08
102 2024,9,23,15.67
103 2024,9,24,15.72
104 2024,9,25,17.01
105 2024,9,26,18.15
106 2024,9,27,20.34
107 2024,9,28,21.82
108 2024,9,29,22.5
109 2024,9,30,22.59
110 2024,10,1,17.75
111 2024,10,2,13.32
112 2024,10,3,12.16
113 2024,10,4,12.46
114 2024,10,5,12.75
115 2024,10,6,14.79
116 2024,10,7,15.56
117 2024,10,8,14.75
118 2024,10,9,15.01
119 2024,10,10,14.92
120 2024,10,11,14.56
121 2024,10,12,16.09
122 2024,10,13,17.78
123 2024,10,14,18.31
124 2024,10,15,18.89
125 2024,10,16,17.75
126 2024,10,17,18.73
127 2024,10,18,19.35
128 2024,10,19,19.14
129 2024,10,20,18.75
130 2024,10,21,18.82
131 2024,10,22,18.3
132 2024,10,23,13.04
133 2024,10,24,12.12
134 2024,10,25,11.88
135 2024,10,26,12.38
136 2024,10,27,13.23
137 2024,10,28,11.89
138 2024,10,29,12.62
139 2024,10,30,14.27
140 2024,10,31,14.25
141 2024,11,1,12.54
142 2024,11,2,10.86
143 2024,11,3,12.62
144 2024,11,4,14.28
145 2024,11,5,13.31
146 2024,11,6,12.96
147 2024,11,7,12.3
148 2024,11,8,10.86
149 2024,11,9,10.56
150 2024,11,10,11.53
151 2024,11,11,13.48
152 2024,11,12,15.48
153 2024,11,13,16.0
154 2024,11,14,16.8
155 2024,11,15,17.69
156 2024,11,16,17.32
157 2024,11,17,15.78
158 2024,11,18,13.79
159 2024,11,19,12.67
160 2024,11,20,11.13
161 2024,11,21,10.25
162 2024,11,22,10.07
163 2024,11,23,11.01
164 2024,11,24,13.13
165 2024,11,25,14.48
166 2024,11,26,10.12
167 2024,11,27,8.89
168 2024,11,28,8.4
169 2024,11,29,7.89
170 2024,11,30,8.23
171 2024,12,1,10.56
172 2024,12,2,12.95
173 2024,12,3,14.32
174 2024,12,4,13.74
175 2024,12,5,13.33
176 2024,12,6,13.49
177 2024,12,7,10.27
178 2024,12,8,8.06
179 2024,12,9,9.51
180 2024,12,10,12.57
181 2024,12,11,11.36
182 2024,12,12,8.62
183 2024,12,13,7.53
184 2024,12,14,6.2
185 2024,12,15,5.72
186 2024,12,16,5.88
187 2024,12,17,7.43
188 2024,12,18,7.79
189 2024,12,19,6.57
190 2024,12,20,6.94
191 2024,12,21,7.41
192 2024,12,22,6.65
193 2024,12,23,7.08
194 2024,12,24,6.82
195 2024,12,25,8.07
196 2024,12,26,9.09
197 2024,12,27,8.88
198 2024,12,28,6.77
199 2024,12,29,7.18
200 2024,12,30,9.45
201 2024,12,31,8.77
202 2025,1,1,9.01
203 2025,1,2,9.48
204 2025,1,3,8.9
205 2025,1,4,9.04
206 2025,1,5,8.48
207 2025,1,6,8.38
208 2025,1,7,10.05
209 2025,1,8,10.79
210 2025,1,9,8.49
211 2025,1,10,6.25
212 2025,1,11,5.25
213 2025,1,12,4.88
214 2025,1,13,6.18
215 2025,1,14,8.71
216 2025,1,15,7.92
217 2025,1,16,6.61
218 2025,1,17,7.2
219 2025,1,18,9.15
220 2025,1,19,9.57
221 2025,1,20,9.25
222 2025,1,21,9.1
223 2025,1,22,10.87
224 2025,1,23,11.66
225 2025,1,24,12.4
226 2025,1,25,13.38
227 2025,1,26,6.73
228 2025,1,27,4.98
229 2025,1,28,5.08
230 2025,1,29,6.57
231 2025,1,30,9.55
232 2025,1,31,12.04
233 2025,2,1,12.62
234 2025,2,2,11.92
235 2025,2,3,7.08
236 2025,2,4,6.33
237 2025,2,5,8.68
238 2025,2,6,10.71
239 2025,2,7,7.47
240 2025,2,8,5.87
241 2025,2,9,5.76
242 2025,2,10,7.78
243 2025,2,11,10.23
244 2025,2,12,11.98
245 2025,2,13,9.21
246 2025,2,14,11.81
247 2025,2,15,13.55
248 2025,2,16,12.12
249 2025,2,17,11.73
250 2025,2,18,10.42
251 2025,2,19,11.56
252 2025,2,20,12.26
253 2025,2,21,12.02
254 2025,2,22,12.23
255 2025,2,23,9.44
256 2025,2,24,7.47
257 2025,2,25,9.16
258 2025,2,26,9.68
259 2025,2,27,11.47
260 2025,2,28,13.32
261 2025,3,1,14.55
262 2025,3,2,15.38
263 2025,3,3,15.63
264 2025,3,4,15.82
265 2025,3,5,13.52
266 2025,3,6,7.54
267 2025,3,7,7.35
268 2025,3,8,9.21
269 2025,3,9,11.06
270 2025,3,10,12.61
271 2025,3,11,14.01
272 2025,3,12,15.53
273 2025,3,13,16.46
274 2025,3,14,16.73
275 2025,3,15,15.55
276 2025,3,16,8.23
277 2025,3,17,8.28
278 2025,3,18,8.03
279 2025,3,19,7.61
280 2025,3,20,7.59
281 2025,3,21,8.26
282 2025,3,22,9.52
283 2025,3,23,11.31
284 2025,3,24,12.96
285 2025,3,25,14.77
286 2025,3,26,15.56
287 2025,3,27,16.38
288 2025,3,28,16.95
289 2025,3,29,9.29
290 2025,3,30,7.54
291 2025,3,31,7.78
292 2025,4,1,8.88
293 2025,4,2,9.74
294 2025,4,3,10.32
295 2025,4,4,12.76
296 2025,4,5,13.94
297 2025,4,6,14.16
298 2025,4,7,14.74
299 2025,4,8,15.99
300 2025,4,9,16.53
301 2025,4,10,16.99
302 2025,4,11,18.25
303 2025,4,12,17.02
304 2025,4,13,11.06
305 2025,4,14,11.39
306 2025,4,15,12.32
307 2025,4,16,13.41
308 2025,4,17,17.43
309 2025,4,18,19.03
310 2025,4,19,18.94
311 2025,4,20,19.42
312 2025,4,21,20.04
313 2025,4,22,20.53
314 2025,4,23,20.75
315 2025,4,24,20.22
316 2025,4,25,18.37
317 2025,4,26,18.09
318 2025,4,27,19.44
319 2025,4,28,18.48
320 2025,4,29,16.88
321 2025,4,30,17.44
322 2025,5,1,17.31
323 2025,5,2,17.37
324 2025,5,3,19.26
325 2025,5,4,-999.0
326 2025,5,5,-999.0
327 2025,5,6,-999.0