Skip to content

Commit f28989b

Browse files
committed
Move cell
1 parent 009e71d commit f28989b

File tree

1 file changed

+47
-47
lines changed

1 file changed

+47
-47
lines changed

gee/time-series/time-series-test.ipynb

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,52 @@
148148
" return json_result"
149149
]
150150
},
151+
{
152+
"cell_type": "code",
153+
"execution_count": 43,
154+
"metadata": {},
155+
"outputs": [
156+
{
157+
"name": "stdout",
158+
"output_type": "stream",
159+
"text": [
160+
"{'table': [{'time': [2001.0, 2002.0, 2003.0, 2004.0, 2005.0, 2006.0, 2007.0, 2008.0, 2009.0, 2010.0, 2011.0, 2012.0, 2013.0, 2014.0, 2015.0, 2016.0, 2017.0, 2018.0, 2019.0, 2020.0, 2021.0], 'name': 'ndvi_max', 'y': [-20.298712891539253, -49.84760867764999, -142.94793314166145, -109.18966259438457, -3.420149071400374, -58.15354447984464, 103.67251847355419, -38.21928456404021, 120.44181660916729, 24.20228103633235, 69.75337084635794, 236.86592895579543, 31.309200901736403, 136.49544774126616, 626.0471677512078, 153.92202844297663, 540.6781601376028, 570.3179114784771, 631.2566358577483, 489.1332327970704, 430.31326066037946]}, {'time': [2001.0, 2002.0, 2003.0, 2004.0, 2005.0, 2006.0, 2007.0, 2008.0, 2009.0, 2010.0, 2011.0, 2012.0, 2013.0, 2014.0, 2015.0, 2016.0, 2017.0, 2018.0, 2019.0, 2020.0, 2021.0], 'name': 'ndvi_mean', 'y': [-419.83891694877707, -115.24624374625806, -338.08701543914106, -327.76351891293075, -235.3787097780539, -120.9360827329493, -16.873152793465803, -296.4657966613747, 21.315652258027427, -127.64212673868843, -64.96720254065022, 105.68896813631554, -202.0944013612229, 45.98613771587721, 378.1512024981405, 99.12355714249806, 367.459162277705, 350.4101365387817, 414.3876350537403, 295.47827431915925, 187.29244171326425]}, {'time': [2001.0, 2002.0, 2003.0, 2004.0, 2005.0, 2006.0, 2007.0, 2008.0, 2009.0, 2010.0, 2011.0, 2012.0, 2013.0, 2014.0, 2015.0, 2016.0, 2017.0, 2018.0, 2019.0, 2020.0, 2021.0], 'name': 'ndvi_min', 'y': [-657.3768248837287, -313.48870346864805, -484.03198491355397, -495.77653016354407, -427.33466048457467, -224.96154013474916, -176.66275127781682, -558.5186070584523, -131.9141536688394, -209.7385560542234, -242.31541637402643, -60.20113373989443, -447.72166485390426, -77.32880676360764, 130.57985092859963, -3.360473973414628, 130.76579666146336, 97.02612068747203, 119.12605242828886, 217.61299334799787, 129.88615464321902]}, {'time': [2001.0, 2002.0, 2003.0, 2004.0, 2005.0, 2006.0, 2007.0, 2008.0, 2009.0, 2010.0, 2011.0, 2012.0, 2013.0, 2014.0, 2015.0, 2016.0, 2017.0, 2018.0, 2019.0, 2020.0, 2021.0], 'name': 'ndvi_mode', 'y': [-657.3768248837287, -91.01534204706195, -484.03198491355397, -495.77653016354407, -427.33466048457467, -144.40752254993913, -40.11878206694519, -558.5186070584523, 120.44181660916729, -152.17623544335902, 69.75337084635794, 236.86592895579543, -447.72166485390426, 136.49544774126616, 626.0471677512078, 153.92202844297663, 540.6781601376028, 570.3179114784771, 631.2566358577483, 282.8135320012375, 129.88615464321902]}, {'time': [2001.0, 2002.0, 2003.0, 2004.0, 2005.0, 2006.0, 2007.0, 2008.0, 2009.0, 2010.0, 2011.0, 2012.0, 2013.0, 2014.0, 2015.0, 2016.0, 2017.0, 2018.0, 2019.0, 2020.0, 2021.0], 'name': 'ndvi_stdDev', 'y': [269.83319214734183, 102.3256853424134, 128.62496079449323, 141.1689891939797, 159.85795318599511, 68.22923572896032, 105.60673726217127, 207.46925137778126, 93.20902904567141, 86.32559826369666, 133.4296524952842, 111.64287385477353, 202.19786939755934, 86.48115932581523, 195.27424583731386, 63.69835562966978, 170.30542659011684, 175.2252617301482, 224.2658216475342, 104.78012909825429, 118.08292799111747]}], 'type': 'TimeSeriesTable', 'name': 'timeseries'}\n"
161+
]
162+
}
163+
],
164+
"source": [
165+
"logger.debug(\"Loading parameters.\")\n",
166+
"geojsons = json.loads(params.get(\"geojsons\"))\n",
167+
"year_initial = int(params.get(\"year_initial\"))\n",
168+
"year_final = int(params.get(\"year_final\"))\n",
169+
"trajectory_method = params.get(\"trajectory_method\")\n",
170+
"ndvi_gee_dataset = params.get(\"ndvi_gee_dataset\")\n",
171+
"climate_gee_dataset = params.get(\"climate_gee_dataset\")\n",
172+
"\n",
173+
"# Check the ENV. Are we running this locally or in prod?\n",
174+
"\n",
175+
"if params.get(\"ENV\") == \"dev\":\n",
176+
" EXECUTION_ID = str(random.randint(1000000, 99999999))\n",
177+
"else:\n",
178+
" EXECUTION_ID = params.get(\"EXECUTION_ID\", None)\n",
179+
"logger.debug(f\"Execution ID is {EXECUTION_ID}\")\n",
180+
"\n",
181+
"logger.debug(\"Running main script.\")\n",
182+
"# TODO: Right now timeseries will only work on the first geojson - this is\n",
183+
"# somewhat ok since for the most part this uses points, but should fix in\n",
184+
"# the future\n",
185+
"json_result = zonal_stats(\n",
186+
" geojsons[0],\n",
187+
" year_initial,\n",
188+
" year_final,\n",
189+
" trajectory_method,\n",
190+
" ndvi_gee_dataset,\n",
191+
" climate_gee_dataset,\n",
192+
" logger,\n",
193+
")\n",
194+
"print(json_result)"
195+
]
196+
},
151197
{
152198
"cell_type": "code",
153199
"execution_count": 41,
@@ -214,52 +260,6 @@
214260
"\n",
215261
"print(res_clean)"
216262
]
217-
},
218-
{
219-
"cell_type": "code",
220-
"execution_count": 43,
221-
"metadata": {},
222-
"outputs": [
223-
{
224-
"name": "stdout",
225-
"output_type": "stream",
226-
"text": [
227-
"{'table': [{'time': [2001.0, 2002.0, 2003.0, 2004.0, 2005.0, 2006.0, 2007.0, 2008.0, 2009.0, 2010.0, 2011.0, 2012.0, 2013.0, 2014.0, 2015.0, 2016.0, 2017.0, 2018.0, 2019.0, 2020.0, 2021.0], 'name': 'ndvi_max', 'y': [-20.298712891539253, -49.84760867764999, -142.94793314166145, -109.18966259438457, -3.420149071400374, -58.15354447984464, 103.67251847355419, -38.21928456404021, 120.44181660916729, 24.20228103633235, 69.75337084635794, 236.86592895579543, 31.309200901736403, 136.49544774126616, 626.0471677512078, 153.92202844297663, 540.6781601376028, 570.3179114784771, 631.2566358577483, 489.1332327970704, 430.31326066037946]}, {'time': [2001.0, 2002.0, 2003.0, 2004.0, 2005.0, 2006.0, 2007.0, 2008.0, 2009.0, 2010.0, 2011.0, 2012.0, 2013.0, 2014.0, 2015.0, 2016.0, 2017.0, 2018.0, 2019.0, 2020.0, 2021.0], 'name': 'ndvi_mean', 'y': [-419.83891694877707, -115.24624374625806, -338.08701543914106, -327.76351891293075, -235.3787097780539, -120.9360827329493, -16.873152793465803, -296.4657966613747, 21.315652258027427, -127.64212673868843, -64.96720254065022, 105.68896813631554, -202.0944013612229, 45.98613771587721, 378.1512024981405, 99.12355714249806, 367.459162277705, 350.4101365387817, 414.3876350537403, 295.47827431915925, 187.29244171326425]}, {'time': [2001.0, 2002.0, 2003.0, 2004.0, 2005.0, 2006.0, 2007.0, 2008.0, 2009.0, 2010.0, 2011.0, 2012.0, 2013.0, 2014.0, 2015.0, 2016.0, 2017.0, 2018.0, 2019.0, 2020.0, 2021.0], 'name': 'ndvi_min', 'y': [-657.3768248837287, -313.48870346864805, -484.03198491355397, -495.77653016354407, -427.33466048457467, -224.96154013474916, -176.66275127781682, -558.5186070584523, -131.9141536688394, -209.7385560542234, -242.31541637402643, -60.20113373989443, -447.72166485390426, -77.32880676360764, 130.57985092859963, -3.360473973414628, 130.76579666146336, 97.02612068747203, 119.12605242828886, 217.61299334799787, 129.88615464321902]}, {'time': [2001.0, 2002.0, 2003.0, 2004.0, 2005.0, 2006.0, 2007.0, 2008.0, 2009.0, 2010.0, 2011.0, 2012.0, 2013.0, 2014.0, 2015.0, 2016.0, 2017.0, 2018.0, 2019.0, 2020.0, 2021.0], 'name': 'ndvi_mode', 'y': [-657.3768248837287, -91.01534204706195, -484.03198491355397, -495.77653016354407, -427.33466048457467, -144.40752254993913, -40.11878206694519, -558.5186070584523, 120.44181660916729, -152.17623544335902, 69.75337084635794, 236.86592895579543, -447.72166485390426, 136.49544774126616, 626.0471677512078, 153.92202844297663, 540.6781601376028, 570.3179114784771, 631.2566358577483, 282.8135320012375, 129.88615464321902]}, {'time': [2001.0, 2002.0, 2003.0, 2004.0, 2005.0, 2006.0, 2007.0, 2008.0, 2009.0, 2010.0, 2011.0, 2012.0, 2013.0, 2014.0, 2015.0, 2016.0, 2017.0, 2018.0, 2019.0, 2020.0, 2021.0], 'name': 'ndvi_stdDev', 'y': [269.83319214734183, 102.3256853424134, 128.62496079449323, 141.1689891939797, 159.85795318599511, 68.22923572896032, 105.60673726217127, 207.46925137778126, 93.20902904567141, 86.32559826369666, 133.4296524952842, 111.64287385477353, 202.19786939755934, 86.48115932581523, 195.27424583731386, 63.69835562966978, 170.30542659011684, 175.2252617301482, 224.2658216475342, 104.78012909825429, 118.08292799111747]}], 'type': 'TimeSeriesTable', 'name': 'timeseries'}\n"
228-
]
229-
}
230-
],
231-
"source": [
232-
"logger.debug(\"Loading parameters.\")\n",
233-
"geojsons = json.loads(params.get(\"geojsons\"))\n",
234-
"year_initial = int(params.get(\"year_initial\"))\n",
235-
"year_final = int(params.get(\"year_final\"))\n",
236-
"trajectory_method = params.get(\"trajectory_method\")\n",
237-
"ndvi_gee_dataset = params.get(\"ndvi_gee_dataset\")\n",
238-
"climate_gee_dataset = params.get(\"climate_gee_dataset\")\n",
239-
"\n",
240-
"# Check the ENV. Are we running this locally or in prod?\n",
241-
"\n",
242-
"if params.get(\"ENV\") == \"dev\":\n",
243-
" EXECUTION_ID = str(random.randint(1000000, 99999999))\n",
244-
"else:\n",
245-
" EXECUTION_ID = params.get(\"EXECUTION_ID\", None)\n",
246-
"logger.debug(f\"Execution ID is {EXECUTION_ID}\")\n",
247-
"\n",
248-
"logger.debug(\"Running main script.\")\n",
249-
"# TODO: Right now timeseries will only work on the first geojson - this is\n",
250-
"# somewhat ok since for the most part this uses points, but should fix in\n",
251-
"# the future\n",
252-
"json_result = zonal_stats(\n",
253-
" geojsons[0],\n",
254-
" year_initial,\n",
255-
" year_final,\n",
256-
" trajectory_method,\n",
257-
" ndvi_gee_dataset,\n",
258-
" climate_gee_dataset,\n",
259-
" logger,\n",
260-
")\n",
261-
"print(json_result)"
262-
]
263263
}
264264
],
265265
"metadata": {
@@ -278,7 +278,7 @@
278278
"name": "python",
279279
"nbconvert_exporter": "python",
280280
"pygments_lexer": "ipython3",
281-
"version": "3.9.4"
281+
"version": "3.10.13"
282282
}
283283
},
284284
"nbformat": 4,

0 commit comments

Comments
 (0)