Skip to content

Commit

Permalink
update notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
jpn-geo6 committed Mar 29, 2024
1 parent d788e35 commit b89f841
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"outputs": [],
"source": [
"# Get aggregated NDVI time series\n",
"client.get_time_series(polygon, year_ago, today, collection=SatelliteImageryCollection.MODIS, indicators=[\"NDVI\"])"
"client.get_time_series(year_ago, today, collection=SatelliteImageryCollection.MODIS, indicators=[\"NDVI\"],polygon=polygon)"
]
},
{
Expand All @@ -52,7 +52,7 @@
"outputs": [],
"source": [
"# Get aggregated EVI time series\n",
"client.get_time_series(polygon, year_ago, today, collection=SatelliteImageryCollection.MODIS, indicators=[\"EVI\"])"
"client.get_time_series(year_ago, today, collection=SatelliteImageryCollection.MODIS, indicators=[\"EVI\"], polygon=polygon)"
]
},
{
Expand All @@ -64,7 +64,7 @@
"# Get aggregated 'Forecast daily' time series\n",
"indicators = ['Precipitation', 'Temperature','Date']\n",
"point = \"POINT (0.0872845021171696 43.69457564315705)\"\n",
"client.get_time_series(point, dt.date.today(), dt.date.today() + relativedelta(days=+5), collection=WeatherTypeCollection.WEATHER_FORECAST_DAILY, indicators=indicators)"
"client.get_time_series(dt.date.today(), dt.date.today() + relativedelta(days=+5), collection=WeatherTypeCollection.WEATHER_FORECAST_DAILY, indicators=indicators,polygon=point)"
]
},
{
Expand All @@ -76,7 +76,7 @@
"# Get aggregated 'Forecast hourly' time series\n",
"indicators = ['Precipitation', 'Temperature']\n",
"point = \"POINT (0.0872845021171696 43.69457564315705)\"\n",
"client.get_time_series(point, dt.date.today(), dt.date.today() + relativedelta(days=+2), collection=WeatherTypeCollection.WEATHER_FORECAST_HOURLY, indicators=indicators)"
"client.get_time_series(dt.date.today(), dt.date.today() + relativedelta(days=+2), collection=WeatherTypeCollection.WEATHER_FORECAST_HOURLY, indicators=indicators, polygon=point)"
]
},
{
Expand All @@ -89,7 +89,7 @@
"indicators = ['Precipitation', 'Temperature']\n",
"start_date = dt.datetime.strptime(\"2022-01-01\", \"%Y-%m-%d\")\n",
"end_date = dt.datetime.strptime(\"2022-02-01\", \"%Y-%m-%d\")\n",
"client.get_time_series(polygon, start_date, end_date, collection=WeatherTypeCollection.WEATHER_HISTORICAL_DAILY, indicators=indicators)"
"client.get_time_series(start_date, end_date, collection=WeatherTypeCollection.WEATHER_HISTORICAL_DAILY, indicators=indicators,polygon=polygon)"
]
},
{
Expand All @@ -99,7 +99,7 @@
"outputs": [],
"source": [
"# Get satellite image time series for Modis NDVI\n",
"client.get_satellite_image_time_series(polygon, year_ago, today, collections=[SatelliteImageryCollection.MODIS], indicators=[\"NDVI\"])"
"client.get_satellite_image_time_series(year_ago, today, collections=[SatelliteImageryCollection.MODIS], indicators=[\"NDVI\"], polygon=polygon)"
]
},
{
Expand All @@ -111,7 +111,7 @@
"outputs": [],
"source": [
"# Get satellite image time series for LANDSAT_8 and SENTINEL_2 Reflectance\n",
"time_series_xarr = client.get_satellite_image_time_series(polygon, year_ago, today, collections=[SatelliteImageryCollection.SENTINEL_2, SatelliteImageryCollection.LANDSAT_8], indicators=[\"Reflectance\"])\n",
"time_series_xarr = client.get_satellite_image_time_series(year_ago, today, collections=[SatelliteImageryCollection.SENTINEL_2, SatelliteImageryCollection.LANDSAT_8], indicators=[\"Reflectance\"],polygon=polygon)\n",
"time_series_xarr\n"
]
},
Expand All @@ -127,7 +127,7 @@
"import xarray as xr\n",
"# Get satellite image time series for LANDSAT_8 and SENTINEL_2 NDVI \n",
"# list of available indicators: Reflectance, NDVI, EVI, GNDVI, NDWI, CVI, CVIn, LAI\n",
"ndvi_time_series_xarr = client.get_satellite_image_time_series(polygon, year_ago, today, collections=[SatelliteImageryCollection.SENTINEL_2, SatelliteImageryCollection.LANDSAT_8], indicators=[\"ndvi\"])\n",
"ndvi_time_series_xarr = client.get_satellite_image_time_series(year_ago, today, collections=[SatelliteImageryCollection.SENTINEL_2, SatelliteImageryCollection.LANDSAT_8], indicators=[\"ndvi\"], polygon=polygon)\n",
"\n",
"ndvi_time_series_xarr\n"
]
Expand All @@ -140,7 +140,7 @@
},
"outputs": [],
"source": [
"lai_time_series_xarr = client.get_satellite_image_time_series(polygon, year_ago, today, collections=[SatelliteImageryCollection.SENTINEL_2, SatelliteImageryCollection.LANDSAT_8], indicators=[\"NDWI\"])\n",
"lai_time_series_xarr = client.get_satellite_image_time_series(year_ago, today, collections=[SatelliteImageryCollection.SENTINEL_2, SatelliteImageryCollection.LANDSAT_8], indicators=[\"NDWI\"],polygon=polygon)\n",
"lai_time_series_xarr"
]
},
Expand Down Expand Up @@ -221,7 +221,7 @@
"outputs": [],
"source": [
"# Get coverage for the polygon\n",
"coverage_info_df, images_references = client.get_satellite_coverage_image_references(polygon, year_ago, today, collections=[SatelliteImageryCollection.SENTINEL_2, SatelliteImageryCollection.LANDSAT_8, SatelliteImageryCollection.LANDSAT_9])\n",
"coverage_info_df, images_references = client.get_satellite_coverage_image_references(year_ago, today, collections=[SatelliteImageryCollection.SENTINEL_2, SatelliteImageryCollection.LANDSAT_8, SatelliteImageryCollection.LANDSAT_9],polygon=polygon)\n",
"coverage_info_df"
]
},
Expand Down Expand Up @@ -270,7 +270,7 @@
"end_date = dt.datetime.strptime(\"2022-03-01\", \"%Y-%m-%d\")\n",
"schema_id = \"LAI_RADAR\"\n",
"polygon = \"POLYGON((-52.72591542 -18.7395779,-52.72604885 -18.73951122,-52.72603114 -18.73908689,-52.71556835 -18.72490316,-52.71391916 -18.72612966,-52.71362802 -18.72623726,-52.71086473 -18.72804231,-52.72083542 -18.74173696,-52.72118937 -18.74159174,-52.72139229 -18.7418552,-52.72600257 -18.73969719,-52.72591542 -18.7395779))\"\n",
"client.get_metrics(polygon, schema_id, start_date, end_date)"
"client.get_metrics( schema_id, start_date, end_date,polygon=polygon)"
]
},
{
Expand All @@ -282,7 +282,7 @@
"# Get time serie\n",
"start_date = dt.datetime.strptime(\"2018-12-30\", \"%Y-%m-%d\")\n",
"end_date = dt.datetime.strptime(\"2019-12-31\", \"%Y-%m-%d\")\n",
"df = client.get_time_series(polygon, start_date, end_date, collection=SatelliteImageryCollection.MODIS, indicators=[\"NDVI\"])\n",
"df = client.get_time_series(start_date, end_date, collection=SatelliteImageryCollection.MODIS, indicators=[\"NDVI\"],polygon=polygon)\n",
"df.head()"
]
},
Expand Down Expand Up @@ -313,7 +313,7 @@
"source": [
"# Push metrics in Analytics Fabrics\n",
"schema_id = \"GeosysPy_NDVI\"\n",
"client.push_metrics(polygon, schema_id, values)"
"client.push_metrics(schema_id, values, polygon=polygon)"
]
},
{
Expand All @@ -325,7 +325,7 @@
"# Get metrics in Analytics Fabrics\n",
"start_date = dt.datetime.strptime(\"2018-01-01\", \"%Y-%m-%d\")\n",
"end_date = dt.datetime.strptime(\"2022-04-01\", \"%Y-%m-%d\")\n",
"client.get_metrics(polygon, schema_id, start_date, end_date)"
"client.get_metrics(schema_id, start_date, end_date, polygon=polygon)"
]
},
{
Expand Down Expand Up @@ -652,9 +652,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "geosyspy_0.2.0",
"display_name": "geosyspy_aq",
"language": "python",
"name": "geosyspy_0.2.0"
"name": "geosyspy_aq"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -666,7 +666,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
"version": "3.11.3"
},
"vscode": {
"interpreter": {
Expand Down

0 comments on commit b89f841

Please sign in to comment.