873 lines
58 KiB
Plaintext
873 lines
58 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "0c18e312-8421-47d7-84f9-ed7d5e47e7ee",
|
|
"metadata": {
|
|
"tags": []
|
|
},
|
|
"source": [
|
|
"#### Load packages and connect to SentinelHub"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"id": "b7ca7102-5fd9-481f-90cd-3ba60e288649",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"# $ pip install sentinelhub\n",
|
|
"# pip install gdal\n",
|
|
"\n",
|
|
"import os\n",
|
|
"import json\n",
|
|
"import datetime\n",
|
|
"import numpy as np\n",
|
|
"import matplotlib.pyplot as plt\n",
|
|
"from pathlib import Path\n",
|
|
"from osgeo import gdal\n",
|
|
"\n",
|
|
"from sentinelhub import MimeType, CRS, BBox, SentinelHubRequest, SentinelHubDownloadClient, \\\n",
|
|
" DataCollection, bbox_to_dimensions, DownloadRequest, SHConfig, BBoxSplitter, read_data, Geometry\n",
|
|
"\n",
|
|
"config = SHConfig()\n",
|
|
"\n",
|
|
"import time\n",
|
|
"import shutil\n",
|
|
"\n",
|
|
"import geopandas as gpd\n",
|
|
"from shapely.geometry import MultiLineString, MultiPolygon, Polygon, box, shape\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 2,
|
|
"id": "330c967c-2742-4a7a-9a61-28bfdaf8eeca",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"# pip install geopandas"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 3,
|
|
"id": "49f8496a-a267-4b74-9500-a168e031ed68",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"#import pipreqs\n",
|
|
"#pipreqs Resilience BV/4002 CMD App - General/4002 CMD Team/4002 TechnicalData/04 WP2 technical/python/Chemba_download.ipynb"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 4,
|
|
"id": "5491a840-779c-4f0c-8164-c3de738b3298",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"config.sh_client_id = '1a72d811-4f0e-4447-8282-df09608cff44'\n",
|
|
"config.sh_client_secret = 'FcBlRL29i9ZmTzhmKTv1etSMFs5PxSos'"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 5,
|
|
"id": "eb1fb662-0e25-4ca9-8317-c6953290842b",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"collection_id = 'c691479f-358c-46b1-b0f0-e12b70a9856c'\n",
|
|
"byoc = DataCollection.define_byoc(\n",
|
|
" collection_id,\n",
|
|
" name='planet_data2',\n",
|
|
" is_timeless=True)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "6adb603d-8182-48c6-a051-869e16ee7bba",
|
|
"metadata": {
|
|
"tags": []
|
|
},
|
|
"source": [
|
|
"#### Set some variables\n",
|
|
"The only place anything might need to be changed."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 6,
|
|
"id": "060396e0-e5ee-4b54-b211-5d8bfcba167f",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"project = 'Butali' #or xinavane or chemba_test_8b\n",
|
|
"#project = 'xinavane' #or xinavane or chemba_test_8b\n",
|
|
"#project = 'chemba_test_8b' #or xinavane or chemba_test_8b\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 7,
|
|
"id": "c9f79e81-dff8-4109-8d26-6c423142dcf2",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Adjust the number of days needed\n",
|
|
"days = 7 #change back to 28 which is the default. 3 years is 1095 days."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 8,
|
|
"id": "e18bdf8f-be4b-44ab-baaa-de5de60d92cb",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"#delete all the satellite outputs -> then True\n",
|
|
"empty_folder_question = False"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "81bbb513-0bd2-4277-83e8-6f94051ce70b",
|
|
"metadata": {
|
|
"tags": []
|
|
},
|
|
"source": [
|
|
"#### Define functions\n",
|
|
"After this block, no manual changes to parameters are required. \n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 9,
|
|
"id": "3f7c8e04-4569-457b-b39d-283582c4ba36",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"BASE_PATH = Path('../laravel_app/storage/app') / os.getenv('PROJECT_DIR',project) \n",
|
|
"BASE_PATH_SINGLE_IMAGES = Path(BASE_PATH / 'single_images')\n",
|
|
"folder_for_merged_tifs = str(BASE_PATH / 'merged_tif')\n",
|
|
"folder_for_virtual_raster = str(BASE_PATH / 'merged_virtual')\n",
|
|
"geojson_file = Path(BASE_PATH /'Data'/ 'pivot.geojson') #the geojsons should have the same name\n",
|
|
" \n",
|
|
"# Check if the folders exist, and if not, create them\n",
|
|
"if not os.path.exists(BASE_PATH_SINGLE_IMAGES):\n",
|
|
" os.makedirs(BASE_PATH_SINGLE_IMAGES)\n",
|
|
" \n",
|
|
"if not os.path.exists(folder_for_merged_tifs):\n",
|
|
" os.makedirs(folder_for_merged_tifs)\n",
|
|
"\n",
|
|
"if not os.path.exists(folder_for_virtual_raster):\n",
|
|
" os.makedirs(folder_for_virtual_raster)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 10,
|
|
"id": "244b5752-4f02-4347-9278-f6a0a46b88f4",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"evalscript_true_color = \"\"\"\n",
|
|
" //VERSION=3\n",
|
|
"\n",
|
|
" function setup() {\n",
|
|
" return {\n",
|
|
" input: [{\n",
|
|
" bands: [\"red\", \"green\", \"blue\", \"nir\", \"udm1\"]\n",
|
|
" }],\n",
|
|
" output: {\n",
|
|
" bands: 4 \n",
|
|
" //sampleType: \"FLOAT32\"\n",
|
|
" }\n",
|
|
" };\n",
|
|
" }\n",
|
|
"\n",
|
|
" function evaluatePixel(sample) {\n",
|
|
" // Scale the bands\n",
|
|
" var scaledBlue = [2.5 * sample.Blue / 10000];\n",
|
|
" var scaledGreen = [2.5 * sample.Green / 10000];\n",
|
|
" var scaledRed = [2.5 * sample.Red / 10000];\n",
|
|
" var scaledNIR = [2.5 * sample.NIR / 10000];\n",
|
|
" \n",
|
|
" // Calculate the CI (Chlorophyll Index) using the scaled values\n",
|
|
" // var CI = [scaledNIR / scaledGreen - 1] ;\n",
|
|
"\n",
|
|
"// Output the scaled bands and CI\n",
|
|
" if (sample.udm1 == 0) { \n",
|
|
" return [\n",
|
|
" scaledRed,\n",
|
|
" scaledGreen,\n",
|
|
" scaledBlue,\n",
|
|
" scaledNIR\n",
|
|
" // sample.UDM,\n",
|
|
" // CI,\n",
|
|
" ]\n",
|
|
" } else {\n",
|
|
" return [NaN, NaN, NaN, NaN]}\n",
|
|
" }\n",
|
|
"\"\"\"\n",
|
|
"\n",
|
|
"def get_true_color_request_day(time_interval, bbox, size):\n",
|
|
" return SentinelHubRequest(\n",
|
|
" evalscript=evalscript_true_color,\n",
|
|
" input_data=[\n",
|
|
" SentinelHubRequest.input_data(\n",
|
|
" data_collection=DataCollection.planet_data2,\n",
|
|
" time_interval=(time_interval, time_interval)\n",
|
|
" )\n",
|
|
" ],\n",
|
|
" responses=[\n",
|
|
" SentinelHubRequest.output_response('default', MimeType.TIFF)\n",
|
|
" ],\n",
|
|
" bbox=bbox,\n",
|
|
" size=size,\n",
|
|
" config=config,\n",
|
|
" data_folder=str(BASE_PATH_SINGLE_IMAGES / time_interval),\n",
|
|
"\n",
|
|
" )\n",
|
|
"\n",
|
|
"def download_function(slot, bbox, size):\n",
|
|
" # create a list of requests\n",
|
|
" list_of_requests = [get_true_color_request_day(slot, bbox, size)]\n",
|
|
" list_of_requests = [request.download_list[0] for request in list_of_requests]\n",
|
|
"\n",
|
|
" # download data chemba west with multiple threads\n",
|
|
" data = SentinelHubDownloadClient(config=config).download(list_of_requests, max_threads=15)\n",
|
|
" print(f' Image downloaded for ' +slot + ' and bbox ' + str(bbox))\n",
|
|
" \n",
|
|
" time.sleep(.1)\n",
|
|
" \n",
|
|
"\n",
|
|
"def merge_files(slot):\n",
|
|
" \n",
|
|
" # List the downloaded Tiffs in the different subfolders with pathlib (native library)\n",
|
|
" file_list = [f\"{x}/response.tiff\" for x in Path(BASE_PATH_SINGLE_IMAGES / slot).iterdir()]\n",
|
|
" \n",
|
|
" #print(file_list)\n",
|
|
"\n",
|
|
" folder_for_merged_tifs = str(BASE_PATH / 'merged_tif' / f\"{slot}.tif\")\n",
|
|
" folder_for_virtual_raster = str(BASE_PATH / 'merged_virtual' / f\"merged{slot}.vrt\")\n",
|
|
"\n",
|
|
" # Create a virtual raster\n",
|
|
" vrt_all = gdal.BuildVRT(folder_for_virtual_raster, file_list)\n",
|
|
" vrt_all = gdal.BuildVRT(folder_for_virtual_raster, file_list)\n",
|
|
"\n",
|
|
" # Convert to JPEG\n",
|
|
" gdal.Translate(folder_for_merged_tifs,folder_for_virtual_raster)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 11,
|
|
"id": "848dc773-70d6-4ae6-b05c-d6ebfb41624d",
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"Monthly time windows:\n",
|
|
"\n",
|
|
"2024-08-14\n",
|
|
"2024-08-15\n",
|
|
"2024-08-16\n",
|
|
"2024-08-17\n",
|
|
"2024-08-18\n",
|
|
"2024-08-19\n",
|
|
"2024-08-20\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"days_needed = int(os.environ.get(\"DAYS\", days))\n",
|
|
"date_str = os.environ.get(\"DATE\")\n",
|
|
"if date_str:\n",
|
|
" # Parse de datumstring naar een datetime.date object\n",
|
|
" end = datetime.datetime.strptime(date_str, \"%Y-%m-%d\").date()\n",
|
|
"else:\n",
|
|
" # Gebruik de huidige datum als fallback\n",
|
|
" end = datetime.date.today() \n",
|
|
"\n",
|
|
"start = end - datetime.timedelta(days=days_needed - 1)\n",
|
|
"\n",
|
|
"slots = [(start + datetime.timedelta(days=i)).strftime('%Y-%m-%d') for i in range(days_needed)]\n",
|
|
"\n",
|
|
"print('Monthly time windows:\\n')\n",
|
|
"if len(slots) > 10:\n",
|
|
" for slot in slots[:3]:\n",
|
|
" print(slot)\n",
|
|
" print(\"...\")\n",
|
|
" for slot in slots[-3:]:\n",
|
|
" print(slot)\n",
|
|
"else:\n",
|
|
" for slot in slots:\n",
|
|
" print(slot)\n",
|
|
"\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "f8ea846f-783b-4460-a951-7b522273555f",
|
|
"metadata": {},
|
|
"source": [
|
|
"#### Download images\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 12,
|
|
"id": "c803e373-2567-4233-af7d-0d2d6f7d4f8e",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"geo_json = gpd.read_file(str(geojson_file))"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 13,
|
|
"id": "dc24d54e-2272-4f30-bcf5-4d8fc381915c",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"geometries = [Geometry(geometry, crs=CRS.WGS84) for geometry in geo_json.geometry]"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 14,
|
|
"id": "cd071b42-d0cd-4e54-8f88-ad1a339748e3",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"shapely_geometries = [geometry.geometry for geometry in geometries]"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 15,
|
|
"id": "301d12e4-e47a-4034-aec0-aa5673e64935",
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"Area bounding box: BBox(((34.82970726773786, 0.490469085371239), (34.84039153582786, 0.503255785720052)), crs=CRS('4326'))\n",
|
|
"\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"bbox_splitter = BBoxSplitter(\n",
|
|
" shapely_geometries, CRS.WGS84, (5, 5), reduce_bbox_sizes=True\n",
|
|
") # bounding box will be split into a grid of 5x4 bounding boxes\n",
|
|
"\n",
|
|
"# based on https://github.com/sentinel-hub/sentinelhub-py/blob/master/examples/large_area_utilities.ipynb \n",
|
|
"\n",
|
|
"print(\"Area bounding box: {}\\n\".format(bbox_splitter.get_area_bbox().__repr__()))\n",
|
|
"\n",
|
|
"bbox_list = bbox_splitter.get_bbox_list()\n",
|
|
"info_list = bbox_splitter.get_info_list()\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 16,
|
|
"id": "431f6856-8d7e-4868-b627-20deeb47d77e",
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"image/svg+xml": [
|
|
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"100.0\" height=\"100.0\" viewBox=\"34.82966374156163 0.5021241051382165 0.000916320908970647 0.0011752067580600434\" preserveAspectRatio=\"xMinYMin meet\"><g transform=\"matrix(1,0,0,-1,0,1.0054234170344931)\"><path fill-rule=\"evenodd\" fill=\"#66cc99\" stroke=\"#555555\" stroke-width=\"2.3504135161200866e-05\" opacity=\"0.6\" d=\"M 34.830137647621626,0.502167631314441 L 34.82981923648811,0.502772939092997 L 34.82970726773786,0.503094836848337 L 34.83015514273886,0.503255785720052 L 34.830536536294375,0.502524517988352 L 34.830137647621626,0.502167631314441 z\" /></g></svg>"
|
|
],
|
|
"text/plain": [
|
|
"<POLYGON ((34.83 0.502, 34.83 0.503, 34.83 0.503, 34.83 0.503, 34.831 0.503,...>"
|
|
]
|
|
},
|
|
"execution_count": 16,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"geometry_list = bbox_splitter.get_geometry_list()\n",
|
|
"\n",
|
|
"geometry_list[0]"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 17,
|
|
"id": "b0cabe8f-e1f2-4b18-8ac0-c2565d0ff16b",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"def show_splitter(splitter, alpha=0.2, area_buffer=0.2, show_legend=False):\n",
|
|
" area_bbox = splitter.get_area_bbox()\n",
|
|
" minx, miny, maxx, maxy = area_bbox\n",
|
|
" lng, lat = area_bbox.middle\n",
|
|
" w, h = maxx - minx, maxy - miny\n",
|
|
" minx = minx - area_buffer * w\n",
|
|
" miny = miny - area_buffer * h\n",
|
|
" maxx = maxx + area_buffer * w\n",
|
|
" maxy = maxy + area_buffer * h\n",
|
|
"\n",
|
|
" fig = plt.figure(figsize=(10, 10))\n",
|
|
" ax = fig.add_subplot(111)\n",
|
|
"\n",
|
|
" base_map = Basemap(\n",
|
|
" projection=\"mill\",\n",
|
|
" lat_0=lat,\n",
|
|
" lon_0=lng,\n",
|
|
" llcrnrlon=minx,\n",
|
|
" llcrnrlat=miny,\n",
|
|
" urcrnrlon=maxx,\n",
|
|
" urcrnrlat=maxy,\n",
|
|
" resolution=\"l\",\n",
|
|
" epsg=4326,\n",
|
|
" )\n",
|
|
" base_map.drawcoastlines(color=(0, 0, 0, 0))\n",
|
|
"\n",
|
|
" area_shape = splitter.get_area_shape()\n",
|
|
"\n",
|
|
" if isinstance(area_shape, Polygon):\n",
|
|
" polygon_iter = [area_shape]\n",
|
|
" elif isinstance(area_shape, MultiPolygon):\n",
|
|
" polygon_iter = area_shape.geoms\n",
|
|
" else:\n",
|
|
" raise ValueError(f\"Geometry of type {type(area_shape)} is not supported\")\n",
|
|
"\n",
|
|
" for polygon in polygon_iter:\n",
|
|
" if isinstance(polygon.boundary, MultiLineString):\n",
|
|
" for linestring in polygon.boundary:\n",
|
|
" ax.add_patch(PltPolygon(np.array(linestring), closed=True, facecolor=(0, 0, 0, 0), edgecolor=\"red\"))\n",
|
|
" else:\n",
|
|
" ax.add_patch(\n",
|
|
" PltPolygon(np.array(polygon.boundary.coords), closed=True, facecolor=(0, 0, 0, 0), edgecolor=\"red\")\n",
|
|
" )\n",
|
|
"\n",
|
|
" bbox_list = splitter.get_bbox_list()\n",
|
|
" info_list = splitter.get_info_list()\n",
|
|
"\n",
|
|
" cm = plt.get_cmap(\"jet\", len(bbox_list))\n",
|
|
" legend_shapes = []\n",
|
|
" for i, bbox in enumerate(bbox_list):\n",
|
|
" wgs84_bbox = bbox.transform(CRS.WGS84).get_polygon()\n",
|
|
"\n",
|
|
" tile_color = tuple(list(cm(i))[:3] + [alpha])\n",
|
|
" ax.add_patch(PltPolygon(np.array(wgs84_bbox), closed=True, facecolor=tile_color, edgecolor=\"green\"))\n",
|
|
"\n",
|
|
" if show_legend:\n",
|
|
" legend_shapes.append(plt.Rectangle((0, 0), 1, 1, fc=cm(i)))\n",
|
|
"\n",
|
|
" if show_legend:\n",
|
|
" legend_names = []\n",
|
|
" for info in info_list:\n",
|
|
" legend_name = \"{},{}\".format(info[\"index_x\"], info[\"index_y\"])\n",
|
|
"\n",
|
|
" for prop in [\"grid_index\", \"tile\"]:\n",
|
|
" if prop in info:\n",
|
|
" legend_name = \"{},{}\".format(info[prop], legend_name)\n",
|
|
"\n",
|
|
" legend_names.append(legend_name)\n",
|
|
"\n",
|
|
" plt.legend(legend_shapes, legend_names)\n",
|
|
" plt.tight_layout()\n",
|
|
" plt.show()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 18,
|
|
"id": "8f2c3e20-894c-4fe5-95d3-482ee3bac117",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"#from mpl_toolkits.basemap import Basemap # Available here: https://github.com/matplotlib/basemap\n",
|
|
"#from matplotlib.patches import Polygon as PltPolygon\n",
|
|
"\n",
|
|
"#show_splitter(bbox_splitter, show_legend=True)\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 19,
|
|
"id": "41b7369c-f768-44ba-983e-eb8eae4f3afd",
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
" Image downloaded for 2024-08-14 and bbox 34.82970726773786,0.502167631314441,34.830536536294375,0.503255785720052\n",
|
|
" Image downloaded for 2024-08-14 and bbox 34.8334617198946,0.49885648209679895,34.83398097497386,0.499660676826314\n"
|
|
]
|
|
},
|
|
{
|
|
"name": "stderr",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"/usr/local/anaconda3/lib/python3.11/site-packages/sentinelhub/geometry.py:136: SHDeprecationWarning: Initializing `BBox` objects from `BBox` objects will no longer be possible in future versions.\n",
|
|
" return BBox._tuple_from_bbox(bbox)\n",
|
|
"/var/folders/qt/jcd_lqsd6nq6_5902w6403_h0000gn/T/ipykernel_46134/4136298839.py:67: SHDeprecationWarning: The string representation of `BBox` will change to match its `repr` representation.\n",
|
|
" print(f' Image downloaded for ' +slot + ' and bbox ' + str(bbox))\n",
|
|
"/usr/local/anaconda3/lib/python3.11/site-packages/sentinelhub/geometry.py:136: SHDeprecationWarning: Initializing `BBox` objects from `BBox` objects will no longer be possible in future versions.\n",
|
|
" return BBox._tuple_from_bbox(bbox)\n"
|
|
]
|
|
},
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
" Image downloaded for 2024-08-14 and bbox 34.83398097497386,0.498759712488145,34.83427174382217,0.4993881837791638\n",
|
|
" Image downloaded for 2024-08-14 and bbox 34.83990692108071,0.490469085371239,34.84039153582786,0.49136130359895\n",
|
|
" Image downloaded for 2024-08-15 and bbox 34.82970726773786,0.502167631314441,34.830536536294375,0.503255785720052\n",
|
|
" Image downloaded for 2024-08-15 and bbox 34.8334617198946,0.49885648209679895,34.83398097497386,0.499660676826314\n",
|
|
" Image downloaded for 2024-08-15 and bbox 34.83398097497386,0.498759712488145,34.83427174382217,0.4993881837791638\n",
|
|
" Image downloaded for 2024-08-15 and bbox 34.83990692108071,0.490469085371239,34.84039153582786,0.49136130359895\n",
|
|
" Image downloaded for 2024-08-16 and bbox 34.82970726773786,0.502167631314441,34.830536536294375,0.503255785720052\n",
|
|
" Image downloaded for 2024-08-16 and bbox 34.8334617198946,0.49885648209679895,34.83398097497386,0.499660676826314\n",
|
|
" Image downloaded for 2024-08-16 and bbox 34.83398097497386,0.498759712488145,34.83427174382217,0.4993881837791638\n",
|
|
" Image downloaded for 2024-08-16 and bbox 34.83990692108071,0.490469085371239,34.84039153582786,0.49136130359895\n",
|
|
" Image downloaded for 2024-08-17 and bbox 34.82970726773786,0.502167631314441,34.830536536294375,0.503255785720052\n",
|
|
" Image downloaded for 2024-08-17 and bbox 34.8334617198946,0.49885648209679895,34.83398097497386,0.499660676826314\n",
|
|
" Image downloaded for 2024-08-17 and bbox 34.83398097497386,0.498759712488145,34.83427174382217,0.4993881837791638\n",
|
|
" Image downloaded for 2024-08-17 and bbox 34.83990692108071,0.490469085371239,34.84039153582786,0.49136130359895\n",
|
|
" Image downloaded for 2024-08-18 and bbox 34.82970726773786,0.502167631314441,34.830536536294375,0.503255785720052\n",
|
|
" Image downloaded for 2024-08-18 and bbox 34.8334617198946,0.49885648209679895,34.83398097497386,0.499660676826314\n",
|
|
" Image downloaded for 2024-08-18 and bbox 34.83398097497386,0.498759712488145,34.83427174382217,0.4993881837791638\n",
|
|
" Image downloaded for 2024-08-18 and bbox 34.83990692108071,0.490469085371239,34.84039153582786,0.49136130359895\n",
|
|
" Image downloaded for 2024-08-19 and bbox 34.82970726773786,0.502167631314441,34.830536536294375,0.503255785720052\n",
|
|
" Image downloaded for 2024-08-19 and bbox 34.8334617198946,0.49885648209679895,34.83398097497386,0.499660676826314\n",
|
|
" Image downloaded for 2024-08-19 and bbox 34.83398097497386,0.498759712488145,34.83427174382217,0.4993881837791638\n",
|
|
" Image downloaded for 2024-08-19 and bbox 34.83990692108071,0.490469085371239,34.84039153582786,0.49136130359895\n",
|
|
" Image downloaded for 2024-08-20 and bbox 34.82970726773786,0.502167631314441,34.830536536294375,0.503255785720052\n",
|
|
" Image downloaded for 2024-08-20 and bbox 34.8334617198946,0.49885648209679895,34.83398097497386,0.499660676826314\n",
|
|
" Image downloaded for 2024-08-20 and bbox 34.83398097497386,0.498759712488145,34.83427174382217,0.4993881837791638\n",
|
|
" Image downloaded for 2024-08-20 and bbox 34.83990692108071,0.490469085371239,34.84039153582786,0.49136130359895\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"# Load areas outside the loop if they remain constant\n",
|
|
"#bbox_area = json.dumps(chosen_area)\n",
|
|
"#areas = json.loads(os.getenv('BBOX', bbox_area))\n",
|
|
"resolution = 3\n",
|
|
"\n",
|
|
"for slot in slots:\n",
|
|
" for bbox in bbox_list:\n",
|
|
" bbox = BBox(bbox=bbox, crs=CRS.WGS84)\n",
|
|
" size = bbox_to_dimensions(bbox, resolution=resolution)\n",
|
|
" download_function(slot, bbox, size)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 20,
|
|
"id": "7c0f8f0e-b1bc-4b5a-939d-e4358a485c06",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"\n",
|
|
"#if project == 'chemba':\n",
|
|
"# chosen_area = [[34.9460, -17.3500, 34.9839, -17.3110], [34.8830, -17.3516, 34.9380, -17.2917]]\n",
|
|
"\n",
|
|
"#if project == 'chemba_test_8b':\n",
|
|
"# chosen_area = [[34.946, -17.3516, 34.938, -17.2917], [34.883, -17.3516, 34.938, -17.2917]]\n",
|
|
"\n",
|
|
"#if project == 'xinavane':\n",
|
|
"# chosen_area = [[32.6790, -25.0333, 32.7453, -25.0235], [32.6213, -25.0647, 32.6284, -25.0570]]"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 21,
|
|
"id": "16c449ab-eb40-4ed9-9a26-6a64dae114e1",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"#bbox_area = json.dumps(chosen_area)\n",
|
|
"\n",
|
|
"#areas = json.loads(os.getenv('BBOX', bbox_area))\n",
|
|
"#areas"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 22,
|
|
"id": "6c02d7de-cddf-4fc3-8d23-8431415d07b8",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Load areas outside the loop if they remain constant\n",
|
|
"#bbox_area = json.dumps(chosen_area)\n",
|
|
"#areas = json.loads(os.getenv('BBOX', bbox_area))\n",
|
|
"#resolution = 3\n",
|
|
"\n",
|
|
"#for slot in slots:\n",
|
|
"# for area in areas:\n",
|
|
"# bbox = BBox(bbox=area, crs=CRS.WGS84)\n",
|
|
"# size = bbox_to_dimensions(bbox, resolution=resolution)\n",
|
|
"# download_function(slot, bbox, size)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 23,
|
|
"id": "f62d8af8-1c5c-4a83-b888-7205bbe191af",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"#size"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 24,
|
|
"id": "68db3c15-6f94-432e-b315-c329e4251b21",
|
|
"metadata": {
|
|
"tags": []
|
|
},
|
|
"outputs": [
|
|
{
|
|
"name": "stderr",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-14/ef6d31c5422078af6cb7cd4f081fba55/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-14/86f5adebbde3cc84ebd1a1c2713eb1b4/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-14/30ba735efce3cdec1ff0d0aaa5157ee6/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-14/ed08da38bdd2dce45b239ebd36aaf6cb/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-14/ef6d31c5422078af6cb7cd4f081fba55/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-14/86f5adebbde3cc84ebd1a1c2713eb1b4/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-14/30ba735efce3cdec1ff0d0aaa5157ee6/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-14/ed08da38bdd2dce45b239ebd36aaf6cb/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-14/ef6d31c5422078af6cb7cd4f081fba55/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-14/86f5adebbde3cc84ebd1a1c2713eb1b4/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-14/30ba735efce3cdec1ff0d0aaa5157ee6/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-14/ed08da38bdd2dce45b239ebd36aaf6cb/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-15/eb155f61d90258554446c4b0e19e3a1d/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-15/27a18decf46bc92dab45207d670de64d/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-15/c68945780987cf316798e3cfba1d8c1c/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-15/495c4ff2ba333860fbd7cb2df6ae6337/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-15/eb155f61d90258554446c4b0e19e3a1d/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-15/27a18decf46bc92dab45207d670de64d/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-15/c68945780987cf316798e3cfba1d8c1c/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-15/495c4ff2ba333860fbd7cb2df6ae6337/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-15/eb155f61d90258554446c4b0e19e3a1d/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-15/27a18decf46bc92dab45207d670de64d/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-15/c68945780987cf316798e3cfba1d8c1c/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-15/495c4ff2ba333860fbd7cb2df6ae6337/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-16/457e50bbe535548c2365e486ba9c2aa2/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-16/c90a5f036c9116f4953608a61e7cc42b/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-16/b9652f82e47a22769af83d591d68eae3/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-16/7850ac546430c815d19b497da6b6c7ee/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-16/457e50bbe535548c2365e486ba9c2aa2/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-16/c90a5f036c9116f4953608a61e7cc42b/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-16/b9652f82e47a22769af83d591d68eae3/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-16/7850ac546430c815d19b497da6b6c7ee/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-16/457e50bbe535548c2365e486ba9c2aa2/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-16/c90a5f036c9116f4953608a61e7cc42b/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-16/b9652f82e47a22769af83d591d68eae3/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-16/7850ac546430c815d19b497da6b6c7ee/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-17/22a882b61a4bc5fa7df1c26c003d0d58/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-17/281a6c4e3583b4f96fd46be0af82edbd/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-17/b6506ef411afcd941a0b776573d4f1ca/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-17/46922f95c5409b9213eed0d7294e45ea/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-17/22a882b61a4bc5fa7df1c26c003d0d58/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-17/281a6c4e3583b4f96fd46be0af82edbd/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-17/b6506ef411afcd941a0b776573d4f1ca/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-17/46922f95c5409b9213eed0d7294e45ea/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-17/22a882b61a4bc5fa7df1c26c003d0d58/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-17/281a6c4e3583b4f96fd46be0af82edbd/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-17/b6506ef411afcd941a0b776573d4f1ca/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-17/46922f95c5409b9213eed0d7294e45ea/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-18/97ff9146fcf97134abfb024813c18a46/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-18/f6749a66964c04dee41c4332fa1ba226/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-18/d97d9736fa409aeee3abaf6584e25691/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-18/4c5943399e742c95c2f4b91cf96f2360/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-18/97ff9146fcf97134abfb024813c18a46/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-18/f6749a66964c04dee41c4332fa1ba226/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-18/d97d9736fa409aeee3abaf6584e25691/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-18/4c5943399e742c95c2f4b91cf96f2360/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-18/97ff9146fcf97134abfb024813c18a46/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-18/f6749a66964c04dee41c4332fa1ba226/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-18/d97d9736fa409aeee3abaf6584e25691/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-18/4c5943399e742c95c2f4b91cf96f2360/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-19/1bcc6b42db152e6dc6f7b2363542c017/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-19/96359544e98d143c3579d27f525f2c2b/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-19/21adbda11f4f80e341a2b6638bdb7a38/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-19/d260b63a7020a6d388e1745a3c77be00/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-19/1bcc6b42db152e6dc6f7b2363542c017/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-19/96359544e98d143c3579d27f525f2c2b/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-19/21adbda11f4f80e341a2b6638bdb7a38/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-19/d260b63a7020a6d388e1745a3c77be00/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-19/1bcc6b42db152e6dc6f7b2363542c017/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-19/96359544e98d143c3579d27f525f2c2b/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-19/21adbda11f4f80e341a2b6638bdb7a38/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-19/d260b63a7020a6d388e1745a3c77be00/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-20/d6d7322e5b2e1ee200c1289f7e3ca584/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-20/8743609eaa73d8daccf38173f18cab62/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-20/51430ceb565cc95c4bf84fd6d0ba17ab/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-20/c8f521df119266886b1d57f10ca39666/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-20/d6d7322e5b2e1ee200c1289f7e3ca584/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-20/8743609eaa73d8daccf38173f18cab62/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-20/51430ceb565cc95c4bf84fd6d0ba17ab/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-20/c8f521df119266886b1d57f10ca39666/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-20/d6d7322e5b2e1ee200c1289f7e3ca584/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-20/8743609eaa73d8daccf38173f18cab62/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-20/51430ceb565cc95c4bf84fd6d0ba17ab/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n",
|
|
"Warning 1: ../laravel_app/storage/app/Butali/single_images/2024-08-20/c8f521df119266886b1d57f10ca39666/response.tiff: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"for slot in slots:\n",
|
|
" merge_files(slot)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "4274d8e7-1ea3-46db-9528-069ede0b2132",
|
|
"metadata": {
|
|
"tags": []
|
|
},
|
|
"source": [
|
|
"#### Delete intermediate files\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 25,
|
|
"id": "cb3fa856-a550-4899-844a-e69209bba3ad",
|
|
"metadata": {
|
|
"tags": []
|
|
},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"Skipping empty_folders function.\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"# List of folder names\n",
|
|
"\n",
|
|
"folders_to_empty = [BASE_PATH / 'merged_virtual', BASE_PATH_SINGLE_IMAGES]\n",
|
|
" \n",
|
|
"# Function to empty folders\n",
|
|
"\n",
|
|
"# Function to empty folders\n",
|
|
"def empty_folders(folders, run=True):\n",
|
|
" if not run:\n",
|
|
" print(\"Skipping empty_folders function.\")\n",
|
|
" return\n",
|
|
" \n",
|
|
" for folder in folders:\n",
|
|
" try:\n",
|
|
" for filename in os.listdir(folder):\n",
|
|
" file_path = os.path.join(folder, filename)\n",
|
|
" try:\n",
|
|
" if os.path.isfile(file_path):\n",
|
|
" os.unlink(file_path)\n",
|
|
" elif os.path.isdir(file_path):\n",
|
|
" shutil.rmtree(file_path)\n",
|
|
" except Exception as e:\n",
|
|
" print(f\"Error: {e}\")\n",
|
|
" print(f\"Emptied folder: {folder}\")\n",
|
|
" except OSError as e:\n",
|
|
" print(f\"Error: {e}\")\n",
|
|
"\n",
|
|
"# Call the function to empty folders only if the 'run' parameter is set to True\n",
|
|
"empty_folders(folders_to_empty, run=empty_folder_question)\n"
|
|
]
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "Python 3 (ipykernel)",
|
|
"language": "python",
|
|
"name": "python3"
|
|
},
|
|
"language_info": {
|
|
"codemirror_mode": {
|
|
"name": "ipython",
|
|
"version": 3
|
|
},
|
|
"file_extension": ".py",
|
|
"mimetype": "text/x-python",
|
|
"name": "python",
|
|
"nbconvert_exporter": "python",
|
|
"pygments_lexer": "ipython3",
|
|
"version": "3.11.4"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 5
|
|
}
|