diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/blade.xml b/.idea/blade.xml new file mode 100644 index 0000000..f791cc1 --- /dev/null +++ b/.idea/blade.xml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..ac30fa6 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,14 @@ + + + + \ No newline at end of file diff --git a/.idea/laravel-idea.xml b/.idea/laravel-idea.xml new file mode 100644 index 0000000..9fa6625 --- /dev/null +++ b/.idea/laravel-idea.xml @@ -0,0 +1,20 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..47ca648 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..65d49bd --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/php.xml b/.idea/php.xml new file mode 100644 index 0000000..635c8d4 --- /dev/null +++ b/.idea/php.xml @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/phpunit.xml b/.idea/phpunit.xml new file mode 100644 index 0000000..784b031 --- /dev/null +++ b/.idea/phpunit.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/.idea/smartCane.iml b/.idea/smartCane.iml new file mode 100644 index 0000000..d5c4c0f --- /dev/null +++ b/.idea/smartCane.iml @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/build_report.sh b/build_report.sh new file mode 100755 index 0000000..856d78b --- /dev/null +++ b/build_report.sh @@ -0,0 +1,7 @@ +#!/bin/bash +## Runnen van Rmd bestand +# -e betekent "evalueren" en -i specificeert de input file +pwd +script_dir="$(dirname "$0")" +echo $script_dir; +Rscript -e "rmarkdown::render('${script_dir}/r_app/CI_Report_dashboard_planet.Rmd', 'all')" diff --git a/laravel_app/app/Http/Controllers/DownloadController.php b/laravel_app/app/Http/Controllers/DownloadController.php new file mode 100644 index 0000000..ed72448 --- /dev/null +++ b/laravel_app/app/Http/Controllers/DownloadController.php @@ -0,0 +1,13 @@ +loginUsingId(1); $this->buttonText = __('Start'); } @@ -24,7 +25,8 @@ public function start() $projectFolder = base_path('../'); $command = [ - sprintf('%srunpython.sh', $projectFolder ), + sprintf('%srunpython.sh', $projectFolder), + sprintf('--days=%d', $this->days), ]; // Convert commands array to a single string @@ -54,6 +56,6 @@ public function start() public function render() { - return view('livewire.download-form'); + return view('livewire.download.download-form'); } } diff --git a/laravel_app/app/Livewire/Download/DownloadGrid.php b/laravel_app/app/Livewire/Download/DownloadGrid.php new file mode 100644 index 0000000..e48695d --- /dev/null +++ b/laravel_app/app/Livewire/Download/DownloadGrid.php @@ -0,0 +1,28 @@ +directories = collect(Storage::directories('chemba/single_images')) + ->map(function ($directory) { + $parts = explode('/', $directory); + return Carbon::parse(end($parts)); + })->sortByDesc(function ($date, $key) { + return $date; + })->values(); + } + + public function render() + { + return view('livewire.download.download-grid')->with(['directories', $this->directories]); + } +} diff --git a/laravel_app/app/Livewire/Reports/ReportManager.php b/laravel_app/app/Livewire/Reports/ReportManager.php new file mode 100644 index 0000000..46eae3e --- /dev/null +++ b/laravel_app/app/Livewire/Reports/ReportManager.php @@ -0,0 +1,135 @@ + '', + 'path' => '', + ]; + + public $processOutput = ''; + + public $confirmingReportDeletion = false; + + /** + * The ID of the API token being deleted. + * + * @var int + */ + public $reportIdBeingDeleted; + + /** + * Mount the component. + * + * @return void + */ + public function mount() + { + + } + + /** + * Create a new API token. + * + * @return void + */ + public function createReport() + { + $this->resetErrorBag(); + + Validator::make([ + 'name' => $this->createReportForm['name'], + ], [ + 'name' => ['required', 'string', 'max:255'], + ])->validateWithBag('createReport'); + + + $projectFolder = base_path('../'); + + $command = [ + sprintf('%sbuild_report.sh', $projectFolder), + sprintf('--filename=%s', $this->createReportForm['name']), + ]; + + // Convert commands array to a single string + + $process = new Process($command); + $process->setTimeout(3600); // stel een geschikte timeout in + $process->start(); + + try { + $myOutput = []; + $process->wait(function ($type, $buffer) use (&$myOutput){ + $this->stream(to: 'processOutput', content: $buffer); + $myOutput[] = $buffer; + }); + $this->processOutput = collect($myOutput)->join('\n'); + + } catch (ProcessFailedException $exception) { + echo $exception->getMessage(); + } + + Report::create( + $this->createReportForm + ); + + $this->createReportForm['name'] = ''; + + $this->dispatch('created'); + } + + + /** + * Confirm that the given API token should be deleted. + * + * @param int $tokenId + * @return void + */ + public function confirmReportDeletion($reportId) + { + $this->confirmingReportDeletion = true; + + $this->reportIdBeingDeleted = $reportId; + } + + /** + * Delete the API token. + * + * @return void + */ + public function deleteReport() + { + Report::whereId($this->reportIdBeingDeleted)->first()->delete(); + + $this->confirmingReportDeletion = false; + } + + /** + * Get the current user of the application. + * + * @return mixed + */ + public function getReportsProperty() + { + return Report::all(); + } + + public function render() + { + return view('livewire.reports.report-manager'); + } +} diff --git a/laravel_app/app/Models/Report.php b/laravel_app/app/Models/Report.php new file mode 100644 index 0000000..ce3631e --- /dev/null +++ b/laravel_app/app/Models/Report.php @@ -0,0 +1,11 @@ +id(); + $table->string('path'); + $table->string('name'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('reports'); + } +}; diff --git a/laravel_app/resources/views/download/show.blade.php b/laravel_app/resources/views/download/show.blade.php new file mode 100644 index 0000000..21a22d3 --- /dev/null +++ b/laravel_app/resources/views/download/show.blade.php @@ -0,0 +1,20 @@ + + +

+ {{ __('Download') }} +

+
+ +
+
+
+ @livewire('download.download-grid') +
+ + +
+ @livewire('download.download-form') +
+
+
+
diff --git a/laravel_app/resources/views/livewire/download-form.blade.php b/laravel_app/resources/views/livewire/download-form.blade.php deleted file mode 100644 index 2b04383..0000000 --- a/laravel_app/resources/views/livewire/download-form.blade.php +++ /dev/null @@ -1,40 +0,0 @@ - - - {{ __('Two Factor Authentication') }} - - - - {{ __('Add additional security to your account using two factor authentication.') }} - - - -

- {{ __('Finish enabling two factor authentication.') }} - -

-
-

- {{ __('When two factor authentication is enabled, you will be prompted for a secure, random token during authentication. You may retrieve this token from your phone\'s Google Authenticator application.') }} -

-
-
-

- {{ __('some text') }} -

-
- -
{{ $output }} -
-
- - {{ $buttonText }} - -
-
-
- - - - - diff --git a/laravel_app/resources/views/livewire/download/download-form.blade.php b/laravel_app/resources/views/livewire/download/download-form.blade.php new file mode 100644 index 0000000..404db60 --- /dev/null +++ b/laravel_app/resources/views/livewire/download/download-form.blade.php @@ -0,0 +1,47 @@ + + + {{ __('Satellite data') }} + + + + {{ __('Add additional satellite data to your account.') }} + + + +

+ {{ __('Download satellite data') }} + +

+
+

+ {{ __('Vul een aantal dagen in en druk op start om de betreffende sateliet data te downloaden') }} + +

+
+
+

+ {{ __('') }} +

+
+ @if ($this->output) +
{{ $output }} +
+ @endif +
+ + {{ $buttonText }} + +
+
+
+ + + + + diff --git a/laravel_app/resources/views/livewire/download/download-grid.blade.php b/laravel_app/resources/views/livewire/download/download-grid.blade.php new file mode 100644 index 0000000..8c3ff61 --- /dev/null +++ b/laravel_app/resources/views/livewire/download/download-grid.blade.php @@ -0,0 +1,24 @@ +
+ + + {{ __('Available Satellite data') }} + + + + {{ __('The grid has a date for every date the data has already been downloaded.') }} + + + + +
+ @foreach ($directories as $directory) +
+
+ {!! Illuminate\Support\Carbon::parse($directory)->format('Y-m-d') !!} +
+
+ @endforeach +
+
+
+
diff --git a/laravel_app/resources/views/livewire/reports/report-manager.blade.php b/laravel_app/resources/views/livewire/reports/report-manager.blade.php new file mode 100644 index 0000000..98172da --- /dev/null +++ b/laravel_app/resources/views/livewire/reports/report-manager.blade.php @@ -0,0 +1,94 @@ +
+ + + + {{ __('Create report') }} + + + + {{ __('Report generator for generating reports') }} + + + + +
+ + + +
+
{{ $processOutput }} +
+
+ + + + {{ __('Created.') }} + + + + {{ __('Create') }} + + +
+ + + + + +
+ + + {{ __('Manage reports') }} + + + + {{ __('You may delete any of your reports if they are no longer needed.') }} + + + + +
+ @foreach ($this->reports->sortBy('name') as $report) +
+
+ {{ $report->name }} +
+ +
+ +
+
+ @endforeach +
+
+
+
+ + + + + + + + {{ __('Delete Report') }} + + + + {{ __('Are you sure you would like to delete this Report?') }} + + + + + {{ __('Cancel') }} + + + + {{ __('Delete') }} + + + +
diff --git a/laravel_app/resources/views/navigation-menu.blade.php b/laravel_app/resources/views/navigation-menu.blade.php index b97314b..acc19ad 100644 --- a/laravel_app/resources/views/navigation-menu.blade.php +++ b/laravel_app/resources/views/navigation-menu.blade.php @@ -15,6 +15,12 @@ {{ __('Dashboard') }} + + {{ __('Download') }} + + + {{ __('Report') }} + diff --git a/laravel_app/resources/views/reports/index.blade.php b/laravel_app/resources/views/reports/index.blade.php new file mode 100644 index 0000000..fa94a75 --- /dev/null +++ b/laravel_app/resources/views/reports/index.blade.php @@ -0,0 +1,16 @@ + + +

+ {{ __('Reports') }} +

+
+ +
+
+ +
+ @livewire('reports.report-manager') +
+
+
+
diff --git a/laravel_app/routes/web.php b/laravel_app/routes/web.php index 8865335..67c752b 100644 --- a/laravel_app/routes/web.php +++ b/laravel_app/routes/web.php @@ -13,7 +13,6 @@ | */ -Route::get('/streamer', \App\Livewire\DownloadForm::class ); Route::get('/', function () { return view('welcome'); }); @@ -26,4 +25,7 @@ Route::get('/dashboard', function () { return view('dashboard'); })->name('dashboard'); + + Route::get('/download', [\App\Http\Controllers\DownloadController::class, 'show'])->name('download'); + Route::get('/report', [\App\Http\Controllers\ReportController::class, 'index'])->name('report'); }); diff --git a/laravel_app/vite.config.js b/laravel_app/vite.config.js index f190771..2eae5c0 100644 --- a/laravel_app/vite.config.js +++ b/laravel_app/vite.config.js @@ -14,4 +14,7 @@ export default defineConfig({ ], }), ], + server: { + host: 'smartcane.test', + } }); diff --git a/python_app/Chemba_download.ipynb b/python_app/Chemba_download.ipynb index e86e00a..d0bf350 100644 --- a/python_app/Chemba_download.ipynb +++ b/python_app/Chemba_download.ipynb @@ -283,7 +283,8 @@ "source": [ "#end = datetime.date(2022, 8, 4)\n", "#start = datetime.date(2023, 3, 1)\n", - "days_needed = 6\n", + "days_needed = int(os.environ.get(\"DAYS\", 6))\n", + "print(\"Days needed:\", days_needed)\n", "\n", "end = datetime.date.today() - datetime.timedelta(days=days_needed - 1)\n", "start = end - datetime.timedelta(days=1)\n", diff --git a/python_app/chemba_single_images/2023-10-04/37292b2973437bbcd8164d4b0cb5ce09/request.json b/python_app/chemba_single_images/2023-10-04/37292b2973437bbcd8164d4b0cb5ce09/request.json deleted file mode 100644 index 2891121..0000000 --- a/python_app/chemba_single_images/2023-10-04/37292b2973437bbcd8164d4b0cb5ce09/request.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "request": { - "headers": { - "accept": "image/tiff", - "content-type": "application/json" - }, - "payload": { - "evalscript": "\n //VERSION=3\n\n function setup() {\n return {\n input: [{\n bands: [\"Blue\", \"Green\", \"Red\", \"NIR\", \"UDM\"]\n }],\n output: {\n bands: 5\n }\n };\n }\n\n function evaluatePixel(sample) {\n return [2.5 * sample.Blue / 10000, 2.5 * sample.Green / 10000, 2.5 * sample.Red / 10000, 2.5 * sample.NIR / 10000, sample.UDM];\n }\n", - "input": { - "bounds": { - "bbox": [ - 34.946, - -17.35, - 34.9839, - -17.311 - ], - "properties": { - "crs": "http://www.opengis.net/def/crs/EPSG/0/4326" - } - }, - "data": [ - { - "dataFilter": { - "timeRange": { - "from": "2023-10-04T00:00:00Z", - "to": "2023-10-04T23:59:59Z" - } - }, - "type": "byoc-c691479f-358c-46b1-b0f0-e12b70a9856c" - } - ] - }, - "output": { - "height": 1425, - "responses": [ - { - "format": { - "type": "image/tiff" - }, - "identifier": "default" - } - ], - "width": 1358 - } - }, - "timestamp": "2023-10-10T11:45:04.511299", - "url": "https://services.sentinel-hub.com/api/v1/process" - }, - "response": { - "elapsed": 3.275736, - "headers": { - "Connection": "keep-alive", - "Content-Type": "image/tiff", - "Date": "Tue, 10 Oct 2023 09:45:04 GMT", - "Transfer-Encoding": "chunked", - "access-control-allow-credentials": "true", - "access-control-allow-headers": "origin,content-type,accept,accept-crs,authorization,cache-control", - "access-control-allow-methods": "GET, POST, PUT, DELETE, OPTIONS, HEAD, PATCH", - "access-control-allow-origin": "*", - "access-control-max-age": "3600", - "x-processingunits-spent": "12.303352062622253" - }, - "status_code": 200 - } -} \ No newline at end of file diff --git a/python_app/chemba_single_images/2023-10-04/a3957aa1c1478fed498c3f1e94b8703a/request.json b/python_app/chemba_single_images/2023-10-04/a3957aa1c1478fed498c3f1e94b8703a/request.json deleted file mode 100644 index 94f717d..0000000 --- a/python_app/chemba_single_images/2023-10-04/a3957aa1c1478fed498c3f1e94b8703a/request.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "request": { - "headers": { - "accept": "image/tiff", - "content-type": "application/json" - }, - "payload": { - "evalscript": "\n //VERSION=3\n\n function setup() {\n return {\n input: [{\n bands: [\"Blue\", \"Green\", \"Red\", \"NIR\", \"UDM\"]\n }],\n output: {\n bands: 5\n }\n };\n }\n\n function evaluatePixel(sample) {\n return [2.5 * sample.Blue / 10000, 2.5 * sample.Green / 10000, 2.5 * sample.Red / 10000, 2.5 * sample.NIR / 10000, sample.UDM];\n }\n", - "input": { - "bounds": { - "bbox": [ - 34.883, - -17.3516, - 34.938, - -17.2917 - ], - "properties": { - "crs": "http://www.opengis.net/def/crs/EPSG/0/4326" - } - }, - "data": [ - { - "dataFilter": { - "timeRange": { - "from": "2023-10-04T00:00:00Z", - "to": "2023-10-04T23:59:59Z" - } - }, - "type": "byoc-c691479f-358c-46b1-b0f0-e12b70a9856c" - } - ] - }, - "output": { - "height": 2191, - "responses": [ - { - "format": { - "type": "image/tiff" - }, - "identifier": "default" - } - ], - "width": 1971 - } - }, - "timestamp": "2023-10-10T11:45:01.042605", - "url": "https://services.sentinel-hub.com/api/v1/process" - }, - "response": { - "elapsed": 5.668425, - "headers": { - "Connection": "keep-alive", - "Content-Type": "image/tiff", - "Date": "Tue, 10 Oct 2023 09:45:00 GMT", - "Transfer-Encoding": "chunked", - "access-control-allow-credentials": "true", - "access-control-allow-headers": "origin,content-type,accept,accept-crs,authorization,cache-control", - "access-control-allow-methods": "GET, POST, PUT, DELETE, OPTIONS, HEAD, PATCH", - "access-control-allow-origin": "*", - "access-control-max-age": "3600", - "x-processingunits-spent": "27.456034959410772" - }, - "status_code": 200 - } -} \ No newline at end of file diff --git a/python_app/chemba_single_images/2023-10-05/1ab274c42d49578ad25c592bc16c5c17/request.json b/python_app/chemba_single_images/2023-10-05/1ab274c42d49578ad25c592bc16c5c17/request.json deleted file mode 100644 index af9a1f6..0000000 --- a/python_app/chemba_single_images/2023-10-05/1ab274c42d49578ad25c592bc16c5c17/request.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "request": { - "headers": { - "accept": "image/tiff", - "content-type": "application/json" - }, - "payload": { - "evalscript": "\n //VERSION=3\n\n function setup() {\n return {\n input: [{\n bands: [\"Blue\", \"Green\", \"Red\", \"NIR\", \"UDM\"]\n }],\n output: {\n bands: 5\n }\n };\n }\n\n function evaluatePixel(sample) {\n return [2.5 * sample.Blue / 10000, 2.5 * sample.Green / 10000, 2.5 * sample.Red / 10000, 2.5 * sample.NIR / 10000, sample.UDM];\n }\n", - "input": { - "bounds": { - "bbox": [ - 34.946, - -17.35, - 34.9839, - -17.311 - ], - "properties": { - "crs": "http://www.opengis.net/def/crs/EPSG/0/4326" - } - }, - "data": [ - { - "dataFilter": { - "timeRange": { - "from": "2023-10-05T00:00:00Z", - "to": "2023-10-05T23:59:59Z" - } - }, - "type": "byoc-c691479f-358c-46b1-b0f0-e12b70a9856c" - } - ] - }, - "output": { - "height": 1425, - "responses": [ - { - "format": { - "type": "image/tiff" - }, - "identifier": "default" - } - ], - "width": 1358 - } - }, - "timestamp": "2023-10-10T11:45:13.161955", - "url": "https://services.sentinel-hub.com/api/v1/process" - }, - "response": { - "elapsed": 2.723803, - "headers": { - "Connection": "keep-alive", - "Content-Type": "image/tiff", - "Date": "Tue, 10 Oct 2023 09:45:13 GMT", - "Transfer-Encoding": "chunked", - "access-control-allow-credentials": "true", - "access-control-allow-headers": "origin,content-type,accept,accept-crs,authorization,cache-control", - "access-control-allow-methods": "GET, POST, PUT, DELETE, OPTIONS, HEAD, PATCH", - "access-control-allow-origin": "*", - "access-control-max-age": "3600", - "x-processingunits-spent": "12.303352062622253" - }, - "status_code": 200 - } -} \ No newline at end of file diff --git a/python_app/chemba_single_images/2023-10-05/ca219fceac18e287d129aaca803998f0/request.json b/python_app/chemba_single_images/2023-10-05/ca219fceac18e287d129aaca803998f0/request.json deleted file mode 100644 index 653cc8a..0000000 --- a/python_app/chemba_single_images/2023-10-05/ca219fceac18e287d129aaca803998f0/request.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "request": { - "headers": { - "accept": "image/tiff", - "content-type": "application/json" - }, - "payload": { - "evalscript": "\n //VERSION=3\n\n function setup() {\n return {\n input: [{\n bands: [\"Blue\", \"Green\", \"Red\", \"NIR\", \"UDM\"]\n }],\n output: {\n bands: 5\n }\n };\n }\n\n function evaluatePixel(sample) {\n return [2.5 * sample.Blue / 10000, 2.5 * sample.Green / 10000, 2.5 * sample.Red / 10000, 2.5 * sample.NIR / 10000, sample.UDM];\n }\n", - "input": { - "bounds": { - "bbox": [ - 34.883, - -17.3516, - 34.938, - -17.2917 - ], - "properties": { - "crs": "http://www.opengis.net/def/crs/EPSG/0/4326" - } - }, - "data": [ - { - "dataFilter": { - "timeRange": { - "from": "2023-10-05T00:00:00Z", - "to": "2023-10-05T23:59:59Z" - } - }, - "type": "byoc-c691479f-358c-46b1-b0f0-e12b70a9856c" - } - ] - }, - "output": { - "height": 2191, - "responses": [ - { - "format": { - "type": "image/tiff" - }, - "identifier": "default" - } - ], - "width": 1971 - } - }, - "timestamp": "2023-10-10T11:45:10.248784", - "url": "https://services.sentinel-hub.com/api/v1/process" - }, - "response": { - "elapsed": 5.010186, - "headers": { - "Connection": "keep-alive", - "Content-Type": "image/tiff", - "Date": "Tue, 10 Oct 2023 09:45:10 GMT", - "Transfer-Encoding": "chunked", - "access-control-allow-credentials": "true", - "access-control-allow-headers": "origin,content-type,accept,accept-crs,authorization,cache-control", - "access-control-allow-methods": "GET, POST, PUT, DELETE, OPTIONS, HEAD, PATCH", - "access-control-allow-origin": "*", - "access-control-max-age": "3600", - "x-processingunits-spent": "27.456034959410772" - }, - "status_code": 200 - } -} \ No newline at end of file diff --git a/python_app/chemba_single_images/2023-10-06/a1c4a82635c5b3379cac01c44428a46c/request.json b/python_app/chemba_single_images/2023-10-06/a1c4a82635c5b3379cac01c44428a46c/request.json deleted file mode 100644 index 53a1fe1..0000000 --- a/python_app/chemba_single_images/2023-10-06/a1c4a82635c5b3379cac01c44428a46c/request.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "request": { - "headers": { - "accept": "image/tiff", - "content-type": "application/json" - }, - "payload": { - "evalscript": "\n //VERSION=3\n\n function setup() {\n return {\n input: [{\n bands: [\"Blue\", \"Green\", \"Red\", \"NIR\", \"UDM\"]\n }],\n output: {\n bands: 5\n }\n };\n }\n\n function evaluatePixel(sample) {\n return [2.5 * sample.Blue / 10000, 2.5 * sample.Green / 10000, 2.5 * sample.Red / 10000, 2.5 * sample.NIR / 10000, sample.UDM];\n }\n", - "input": { - "bounds": { - "bbox": [ - 34.946, - -17.35, - 34.9839, - -17.311 - ], - "properties": { - "crs": "http://www.opengis.net/def/crs/EPSG/0/4326" - } - }, - "data": [ - { - "dataFilter": { - "timeRange": { - "from": "2023-10-06T00:00:00Z", - "to": "2023-10-06T23:59:59Z" - } - }, - "type": "byoc-c691479f-358c-46b1-b0f0-e12b70a9856c" - } - ] - }, - "output": { - "height": 1425, - "responses": [ - { - "format": { - "type": "image/tiff" - }, - "identifier": "default" - } - ], - "width": 1358 - } - }, - "timestamp": "2023-10-10T11:45:22.861847", - "url": "https://services.sentinel-hub.com/api/v1/process" - }, - "response": { - "elapsed": 3.398991, - "headers": { - "Connection": "keep-alive", - "Content-Type": "image/tiff", - "Date": "Tue, 10 Oct 2023 09:45:22 GMT", - "Transfer-Encoding": "chunked", - "access-control-allow-credentials": "true", - "access-control-allow-headers": "origin,content-type,accept,accept-crs,authorization,cache-control", - "access-control-allow-methods": "GET, POST, PUT, DELETE, OPTIONS, HEAD, PATCH", - "access-control-allow-origin": "*", - "access-control-max-age": "3600", - "x-processingunits-spent": "12.303352062622253" - }, - "status_code": 200 - } -} \ No newline at end of file diff --git a/python_app/chemba_single_images/2023-10-06/cae35e70e26ce81aff15dcea89246b07/request.json b/python_app/chemba_single_images/2023-10-06/cae35e70e26ce81aff15dcea89246b07/request.json deleted file mode 100644 index 885637d..0000000 --- a/python_app/chemba_single_images/2023-10-06/cae35e70e26ce81aff15dcea89246b07/request.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "request": { - "headers": { - "accept": "image/tiff", - "content-type": "application/json" - }, - "payload": { - "evalscript": "\n //VERSION=3\n\n function setup() {\n return {\n input: [{\n bands: [\"Blue\", \"Green\", \"Red\", \"NIR\", \"UDM\"]\n }],\n output: {\n bands: 5\n }\n };\n }\n\n function evaluatePixel(sample) {\n return [2.5 * sample.Blue / 10000, 2.5 * sample.Green / 10000, 2.5 * sample.Red / 10000, 2.5 * sample.NIR / 10000, sample.UDM];\n }\n", - "input": { - "bounds": { - "bbox": [ - 34.883, - -17.3516, - 34.938, - -17.2917 - ], - "properties": { - "crs": "http://www.opengis.net/def/crs/EPSG/0/4326" - } - }, - "data": [ - { - "dataFilter": { - "timeRange": { - "from": "2023-10-06T00:00:00Z", - "to": "2023-10-06T23:59:59Z" - } - }, - "type": "byoc-c691479f-358c-46b1-b0f0-e12b70a9856c" - } - ] - }, - "output": { - "height": 2191, - "responses": [ - { - "format": { - "type": "image/tiff" - }, - "identifier": "default" - } - ], - "width": 1971 - } - }, - "timestamp": "2023-10-10T11:45:19.247047", - "url": "https://services.sentinel-hub.com/api/v1/process" - }, - "response": { - "elapsed": 5.512139, - "headers": { - "Connection": "keep-alive", - "Content-Type": "image/tiff", - "Date": "Tue, 10 Oct 2023 09:45:19 GMT", - "Transfer-Encoding": "chunked", - "access-control-allow-credentials": "true", - "access-control-allow-headers": "origin,content-type,accept,accept-crs,authorization,cache-control", - "access-control-allow-methods": "GET, POST, PUT, DELETE, OPTIONS, HEAD, PATCH", - "access-control-allow-origin": "*", - "access-control-max-age": "3600", - "x-processingunits-spent": "27.456034959410772" - }, - "status_code": 200 - } -} \ No newline at end of file diff --git a/python_app/chemba_single_images/2023-10-07/3a899f894dfc9421c0454963e781ee50/request.json b/python_app/chemba_single_images/2023-10-07/3a899f894dfc9421c0454963e781ee50/request.json deleted file mode 100644 index e8262bf..0000000 --- a/python_app/chemba_single_images/2023-10-07/3a899f894dfc9421c0454963e781ee50/request.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "request": { - "headers": { - "accept": "image/tiff", - "content-type": "application/json" - }, - "payload": { - "evalscript": "\n //VERSION=3\n\n function setup() {\n return {\n input: [{\n bands: [\"Blue\", \"Green\", \"Red\", \"NIR\", \"UDM\"]\n }],\n output: {\n bands: 5\n }\n };\n }\n\n function evaluatePixel(sample) {\n return [2.5 * sample.Blue / 10000, 2.5 * sample.Green / 10000, 2.5 * sample.Red / 10000, 2.5 * sample.NIR / 10000, sample.UDM];\n }\n", - "input": { - "bounds": { - "bbox": [ - 34.946, - -17.35, - 34.9839, - -17.311 - ], - "properties": { - "crs": "http://www.opengis.net/def/crs/EPSG/0/4326" - } - }, - "data": [ - { - "dataFilter": { - "timeRange": { - "from": "2023-10-07T00:00:00Z", - "to": "2023-10-07T23:59:59Z" - } - }, - "type": "byoc-c691479f-358c-46b1-b0f0-e12b70a9856c" - } - ] - }, - "output": { - "height": 1425, - "responses": [ - { - "format": { - "type": "image/tiff" - }, - "identifier": "default" - } - ], - "width": 1358 - } - }, - "timestamp": "2023-10-10T11:45:28.996066", - "url": "https://services.sentinel-hub.com/api/v1/process" - }, - "response": { - "elapsed": 1.55439, - "headers": { - "Connection": "keep-alive", - "Content-Type": "image/tiff", - "Date": "Tue, 10 Oct 2023 09:45:29 GMT", - "Transfer-Encoding": "chunked", - "access-control-allow-credentials": "true", - "access-control-allow-headers": "origin,content-type,accept,accept-crs,authorization,cache-control", - "access-control-allow-methods": "GET, POST, PUT, DELETE, OPTIONS, HEAD, PATCH", - "access-control-allow-origin": "*", - "access-control-max-age": "3600", - "x-processingunits-spent": "12.303352062622253" - }, - "status_code": 200 - } -} \ No newline at end of file diff --git a/python_app/chemba_single_images/2023-10-07/55237fa25a668d6bb2a5d64d3e15a25e/request.json b/python_app/chemba_single_images/2023-10-07/55237fa25a668d6bb2a5d64d3e15a25e/request.json deleted file mode 100644 index c6ab74d..0000000 --- a/python_app/chemba_single_images/2023-10-07/55237fa25a668d6bb2a5d64d3e15a25e/request.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "request": { - "headers": { - "accept": "image/tiff", - "content-type": "application/json" - }, - "payload": { - "evalscript": "\n //VERSION=3\n\n function setup() {\n return {\n input: [{\n bands: [\"Blue\", \"Green\", \"Red\", \"NIR\", \"UDM\"]\n }],\n output: {\n bands: 5\n }\n };\n }\n\n function evaluatePixel(sample) {\n return [2.5 * sample.Blue / 10000, 2.5 * sample.Green / 10000, 2.5 * sample.Red / 10000, 2.5 * sample.NIR / 10000, sample.UDM];\n }\n", - "input": { - "bounds": { - "bbox": [ - 34.883, - -17.3516, - 34.938, - -17.2917 - ], - "properties": { - "crs": "http://www.opengis.net/def/crs/EPSG/0/4326" - } - }, - "data": [ - { - "dataFilter": { - "timeRange": { - "from": "2023-10-07T00:00:00Z", - "to": "2023-10-07T23:59:59Z" - } - }, - "type": "byoc-c691479f-358c-46b1-b0f0-e12b70a9856c" - } - ] - }, - "output": { - "height": 2191, - "responses": [ - { - "format": { - "type": "image/tiff" - }, - "identifier": "default" - } - ], - "width": 1971 - } - }, - "timestamp": "2023-10-10T11:45:27.401614", - "url": "https://services.sentinel-hub.com/api/v1/process" - }, - "response": { - "elapsed": 4.002806, - "headers": { - "Connection": "keep-alive", - "Content-Type": "image/tiff", - "Date": "Tue, 10 Oct 2023 09:45:27 GMT", - "Transfer-Encoding": "chunked", - "access-control-allow-credentials": "true", - "access-control-allow-headers": "origin,content-type,accept,accept-crs,authorization,cache-control", - "access-control-allow-methods": "GET, POST, PUT, DELETE, OPTIONS, HEAD, PATCH", - "access-control-allow-origin": "*", - "access-control-max-age": "3600", - "x-processingunits-spent": "27.456034959410772" - }, - "status_code": 200 - } -} \ No newline at end of file diff --git a/python_app/chemba_single_images/2023-10-08/667654d090d9d364ba2503be89efd0e5/request.json b/python_app/chemba_single_images/2023-10-08/667654d090d9d364ba2503be89efd0e5/request.json deleted file mode 100644 index 514cad1..0000000 --- a/python_app/chemba_single_images/2023-10-08/667654d090d9d364ba2503be89efd0e5/request.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "request": { - "headers": { - "accept": "image/tiff", - "content-type": "application/json" - }, - "payload": { - "evalscript": "\n //VERSION=3\n\n function setup() {\n return {\n input: [{\n bands: [\"Blue\", \"Green\", \"Red\", \"NIR\", \"UDM\"]\n }],\n output: {\n bands: 5\n }\n };\n }\n\n function evaluatePixel(sample) {\n return [2.5 * sample.Blue / 10000, 2.5 * sample.Green / 10000, 2.5 * sample.Red / 10000, 2.5 * sample.NIR / 10000, sample.UDM];\n }\n", - "input": { - "bounds": { - "bbox": [ - 34.946, - -17.35, - 34.9839, - -17.311 - ], - "properties": { - "crs": "http://www.opengis.net/def/crs/EPSG/0/4326" - } - }, - "data": [ - { - "dataFilter": { - "timeRange": { - "from": "2023-10-08T00:00:00Z", - "to": "2023-10-08T23:59:59Z" - } - }, - "type": "byoc-c691479f-358c-46b1-b0f0-e12b70a9856c" - } - ] - }, - "output": { - "height": 1425, - "responses": [ - { - "format": { - "type": "image/tiff" - }, - "identifier": "default" - } - ], - "width": 1358 - } - }, - "timestamp": "2023-10-10T11:45:36.491864", - "url": "https://services.sentinel-hub.com/api/v1/process" - }, - "response": { - "elapsed": 3.551305, - "headers": { - "Connection": "keep-alive", - "Content-Type": "image/tiff", - "Date": "Tue, 10 Oct 2023 09:45:36 GMT", - "Transfer-Encoding": "chunked", - "access-control-allow-credentials": "true", - "access-control-allow-headers": "origin,content-type,accept,accept-crs,authorization,cache-control", - "access-control-allow-methods": "GET, POST, PUT, DELETE, OPTIONS, HEAD, PATCH", - "access-control-allow-origin": "*", - "access-control-max-age": "3600", - "x-processingunits-spent": "12.303352062622253" - }, - "status_code": 200 - } -} \ No newline at end of file diff --git a/python_app/chemba_single_images/2023-10-08/e529f48ef19175c434efd2631a2369e6/request.json b/python_app/chemba_single_images/2023-10-08/e529f48ef19175c434efd2631a2369e6/request.json deleted file mode 100644 index abe10f8..0000000 --- a/python_app/chemba_single_images/2023-10-08/e529f48ef19175c434efd2631a2369e6/request.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "request": { - "headers": { - "accept": "image/tiff", - "content-type": "application/json" - }, - "payload": { - "evalscript": "\n //VERSION=3\n\n function setup() {\n return {\n input: [{\n bands: [\"Blue\", \"Green\", \"Red\", \"NIR\", \"UDM\"]\n }],\n output: {\n bands: 5\n }\n };\n }\n\n function evaluatePixel(sample) {\n return [2.5 * sample.Blue / 10000, 2.5 * sample.Green / 10000, 2.5 * sample.Red / 10000, 2.5 * sample.NIR / 10000, sample.UDM];\n }\n", - "input": { - "bounds": { - "bbox": [ - 34.883, - -17.3516, - 34.938, - -17.2917 - ], - "properties": { - "crs": "http://www.opengis.net/def/crs/EPSG/0/4326" - } - }, - "data": [ - { - "dataFilter": { - "timeRange": { - "from": "2023-10-08T00:00:00Z", - "to": "2023-10-08T23:59:59Z" - } - }, - "type": "byoc-c691479f-358c-46b1-b0f0-e12b70a9856c" - } - ] - }, - "output": { - "height": 2191, - "responses": [ - { - "format": { - "type": "image/tiff" - }, - "identifier": "default" - } - ], - "width": 1971 - } - }, - "timestamp": "2023-10-10T11:45:32.725291", - "url": "https://services.sentinel-hub.com/api/v1/process" - }, - "response": { - "elapsed": 3.128947, - "headers": { - "Connection": "keep-alive", - "Content-Type": "image/tiff", - "Date": "Tue, 10 Oct 2023 09:45:32 GMT", - "Transfer-Encoding": "chunked", - "access-control-allow-credentials": "true", - "access-control-allow-headers": "origin,content-type,accept,accept-crs,authorization,cache-control", - "access-control-allow-methods": "GET, POST, PUT, DELETE, OPTIONS, HEAD, PATCH", - "access-control-allow-origin": "*", - "access-control-max-age": "3600", - "x-processingunits-spent": "27.456034959410772" - }, - "status_code": 200 - } -} \ No newline at end of file diff --git a/python_app/chemba_single_images/2023-10-09/52f91750075843995f2e04edfd234270/request.json b/python_app/chemba_single_images/2023-10-09/52f91750075843995f2e04edfd234270/request.json deleted file mode 100644 index a238ca2..0000000 --- a/python_app/chemba_single_images/2023-10-09/52f91750075843995f2e04edfd234270/request.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "request": { - "headers": { - "accept": "image/tiff", - "content-type": "application/json" - }, - "payload": { - "evalscript": "\n //VERSION=3\n\n function setup() {\n return {\n input: [{\n bands: [\"Blue\", \"Green\", \"Red\", \"NIR\", \"UDM\"]\n }],\n output: {\n bands: 5\n }\n };\n }\n\n function evaluatePixel(sample) {\n return [2.5 * sample.Blue / 10000, 2.5 * sample.Green / 10000, 2.5 * sample.Red / 10000, 2.5 * sample.NIR / 10000, sample.UDM];\n }\n", - "input": { - "bounds": { - "bbox": [ - 34.946, - -17.35, - 34.9839, - -17.311 - ], - "properties": { - "crs": "http://www.opengis.net/def/crs/EPSG/0/4326" - } - }, - "data": [ - { - "dataFilter": { - "timeRange": { - "from": "2023-10-09T00:00:00Z", - "to": "2023-10-09T23:59:59Z" - } - }, - "type": "byoc-c691479f-358c-46b1-b0f0-e12b70a9856c" - } - ] - }, - "output": { - "height": 1425, - "responses": [ - { - "format": { - "type": "image/tiff" - }, - "identifier": "default" - } - ], - "width": 1358 - } - }, - "timestamp": "2023-10-10T11:45:46.392453", - "url": "https://services.sentinel-hub.com/api/v1/process" - }, - "response": { - "elapsed": 3.275898, - "headers": { - "Connection": "keep-alive", - "Content-Type": "image/tiff", - "Date": "Tue, 10 Oct 2023 09:45:46 GMT", - "Transfer-Encoding": "chunked", - "access-control-allow-credentials": "true", - "access-control-allow-headers": "origin,content-type,accept,accept-crs,authorization,cache-control", - "access-control-allow-methods": "GET, POST, PUT, DELETE, OPTIONS, HEAD, PATCH", - "access-control-allow-origin": "*", - "access-control-max-age": "3600", - "x-processingunits-spent": "12.303352062622253" - }, - "status_code": 200 - } -} \ No newline at end of file diff --git a/python_app/chemba_single_images/2023-10-09/eb72f49b53caed085e0fb6b5e38b11aa/request.json b/python_app/chemba_single_images/2023-10-09/eb72f49b53caed085e0fb6b5e38b11aa/request.json deleted file mode 100644 index a615271..0000000 --- a/python_app/chemba_single_images/2023-10-09/eb72f49b53caed085e0fb6b5e38b11aa/request.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "request": { - "headers": { - "accept": "image/tiff", - "content-type": "application/json" - }, - "payload": { - "evalscript": "\n //VERSION=3\n\n function setup() {\n return {\n input: [{\n bands: [\"Blue\", \"Green\", \"Red\", \"NIR\", \"UDM\"]\n }],\n output: {\n bands: 5\n }\n };\n }\n\n function evaluatePixel(sample) {\n return [2.5 * sample.Blue / 10000, 2.5 * sample.Green / 10000, 2.5 * sample.Red / 10000, 2.5 * sample.NIR / 10000, sample.UDM];\n }\n", - "input": { - "bounds": { - "bbox": [ - 34.883, - -17.3516, - 34.938, - -17.2917 - ], - "properties": { - "crs": "http://www.opengis.net/def/crs/EPSG/0/4326" - } - }, - "data": [ - { - "dataFilter": { - "timeRange": { - "from": "2023-10-09T00:00:00Z", - "to": "2023-10-09T23:59:59Z" - } - }, - "type": "byoc-c691479f-358c-46b1-b0f0-e12b70a9856c" - } - ] - }, - "output": { - "height": 2191, - "responses": [ - { - "format": { - "type": "image/tiff" - }, - "identifier": "default" - } - ], - "width": 1971 - } - }, - "timestamp": "2023-10-10T11:45:42.824171", - "url": "https://services.sentinel-hub.com/api/v1/process" - }, - "response": { - "elapsed": 5.59089, - "headers": { - "Connection": "keep-alive", - "Content-Type": "image/tiff", - "Date": "Tue, 10 Oct 2023 09:45:42 GMT", - "Transfer-Encoding": "chunked", - "access-control-allow-credentials": "true", - "access-control-allow-headers": "origin,content-type,accept,accept-crs,authorization,cache-control", - "access-control-allow-methods": "GET, POST, PUT, DELETE, OPTIONS, HEAD, PATCH", - "access-control-allow-origin": "*", - "access-control-max-age": "3600", - "x-processingunits-spent": "27.456034959410772" - }, - "status_code": 200 - } -} \ No newline at end of file diff --git a/python_app/chemba_single_images/2023-10-10/7f67b5dfc2f37c26b0307e14259610ce/request.json b/python_app/chemba_single_images/2023-10-10/7f67b5dfc2f37c26b0307e14259610ce/request.json deleted file mode 100644 index 9c2eaca..0000000 --- a/python_app/chemba_single_images/2023-10-10/7f67b5dfc2f37c26b0307e14259610ce/request.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "request": { - "headers": { - "accept": "image/tiff", - "content-type": "application/json" - }, - "payload": { - "evalscript": "\n //VERSION=3\n\n function setup() {\n return {\n input: [{\n bands: [\"Blue\", \"Green\", \"Red\", \"NIR\", \"UDM\"]\n }],\n output: {\n bands: 5\n }\n };\n }\n\n function evaluatePixel(sample) {\n return [2.5 * sample.Blue / 10000, 2.5 * sample.Green / 10000, 2.5 * sample.Red / 10000, 2.5 * sample.NIR / 10000, sample.UDM];\n }\n", - "input": { - "bounds": { - "bbox": [ - 34.946, - -17.35, - 34.9839, - -17.311 - ], - "properties": { - "crs": "http://www.opengis.net/def/crs/EPSG/0/4326" - } - }, - "data": [ - { - "dataFilter": { - "timeRange": { - "from": "2023-10-10T00:00:00Z", - "to": "2023-10-10T23:59:59Z" - } - }, - "type": "byoc-c691479f-358c-46b1-b0f0-e12b70a9856c" - } - ] - }, - "output": { - "height": 1425, - "responses": [ - { - "format": { - "type": "image/tiff" - }, - "identifier": "default" - } - ], - "width": 1358 - } - }, - "timestamp": "2023-10-10T11:45:51.259003", - "url": "https://services.sentinel-hub.com/api/v1/process" - }, - "response": { - "elapsed": 1.552932, - "headers": { - "Connection": "keep-alive", - "Content-Type": "image/tiff", - "Date": "Tue, 10 Oct 2023 09:45:51 GMT", - "Transfer-Encoding": "chunked", - "access-control-allow-credentials": "true", - "access-control-allow-headers": "origin,content-type,accept,accept-crs,authorization,cache-control", - "access-control-allow-methods": "GET, POST, PUT, DELETE, OPTIONS, HEAD, PATCH", - "access-control-allow-origin": "*", - "access-control-max-age": "3600", - "x-processingunits-spent": "12.303352062622253" - }, - "status_code": 200 - } -} \ No newline at end of file diff --git a/python_app/chemba_single_images/2023-10-10/86fab75f716b316a0de019f95a7cf713/request.json b/python_app/chemba_single_images/2023-10-10/86fab75f716b316a0de019f95a7cf713/request.json deleted file mode 100644 index b4f5ffe..0000000 --- a/python_app/chemba_single_images/2023-10-10/86fab75f716b316a0de019f95a7cf713/request.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "request": { - "headers": { - "accept": "image/tiff", - "content-type": "application/json" - }, - "payload": { - "evalscript": "\n //VERSION=3\n\n function setup() {\n return {\n input: [{\n bands: [\"Blue\", \"Green\", \"Red\", \"NIR\", \"UDM\"]\n }],\n output: {\n bands: 5\n }\n };\n }\n\n function evaluatePixel(sample) {\n return [2.5 * sample.Blue / 10000, 2.5 * sample.Green / 10000, 2.5 * sample.Red / 10000, 2.5 * sample.NIR / 10000, sample.UDM];\n }\n", - "input": { - "bounds": { - "bbox": [ - 34.883, - -17.3516, - 34.938, - -17.2917 - ], - "properties": { - "crs": "http://www.opengis.net/def/crs/EPSG/0/4326" - } - }, - "data": [ - { - "dataFilter": { - "timeRange": { - "from": "2023-10-10T00:00:00Z", - "to": "2023-10-10T23:59:59Z" - } - }, - "type": "byoc-c691479f-358c-46b1-b0f0-e12b70a9856c" - } - ] - }, - "output": { - "height": 2191, - "responses": [ - { - "format": { - "type": "image/tiff" - }, - "identifier": "default" - } - ], - "width": 1971 - } - }, - "timestamp": "2023-10-10T11:45:49.667010", - "url": "https://services.sentinel-hub.com/api/v1/process" - }, - "response": { - "elapsed": 2.734391, - "headers": { - "Connection": "keep-alive", - "Content-Type": "image/tiff", - "Date": "Tue, 10 Oct 2023 09:45:49 GMT", - "Transfer-Encoding": "chunked", - "access-control-allow-credentials": "true", - "access-control-allow-headers": "origin,content-type,accept,accept-crs,authorization,cache-control", - "access-control-allow-methods": "GET, POST, PUT, DELETE, OPTIONS, HEAD, PATCH", - "access-control-allow-origin": "*", - "access-control-max-age": "3600", - "x-processingunits-spent": "27.456034959410772" - }, - "status_code": 200 - } -} \ No newline at end of file diff --git a/runpython.sh b/runpython.sh new file mode 100755 index 0000000..2654b48 --- /dev/null +++ b/runpython.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# Standaardwaarde voor days +days=7 + +# Loop door alle argumenten +for arg in "$@" +do + case $arg in + --days=*) + days="${arg#*=}" + shift # Verwijder --days=5 van $@ + ;; + *) + # Andere argumenten die je wilt verwerken + shift + ;; + esac +done + +# Gebruik de variabele in je script +echo "Aantal dagen: $days" + +# Activeer de virtuele omgeving +script_dir="$(dirname "$0")" +source "$script_dir/python_app/myenv/bin/activate" + +export DAYS=$days + +# Hier kan je verdere stappen toevoegen, zoals het uitvoeren van je Python-script of Jupyter Notebook +jupyter nbconvert --execute --to script --stdout "$script_dir/python_app/Chemba_download.ipynb" + +# Deactiveer de virtuele omgeving (optioneel) +deactivate diff --git a/smartcane.sh b/smartcane.sh index 2bf8b26..992253b 100755 --- a/smartcane.sh +++ b/smartcane.sh @@ -3,23 +3,24 @@ # Definieer de directories die aangemaakt moeten worden declare -a dirs=( - "laravel_app/storage/app/extracted_ci/cumulative_vals" - "laravel_app/storage/app/chemba/merged_tif" - "laravel_app/storage/app/chemba/merged_virtual" - "laravel_app/storage/app/chemba/single_images" + "./laravel_app/storage/app/extracted_ci/cumulative_vals" + "./laravel_app/storage/app/chemba/merged_tif" + "./laravel_app/storage/app/chemba/merged_virtual" + "./laravel_app/storage/app/chemba/single_images" ) # ## Loop door de directories en maak ze aan als ze nog niet bestaan, ## of maak ze leeg als ze al bestaan for dir in "${dirs[@]}"; do - if [ ! -d "$dir" ]; then + if [ ! file -d "$dir" ]; then mkdir -p "$dir" chmod -R 775 "$dir" echo "Directory $dir is aangemaakt en bijgewerkt." else # Verwijder alle inhoud binnen de bestaande directory - find "$dir" -mindepth 1 -delete - echo "Inhoud van directory $dir is verwijderd." + # find "$dir" -mindepth 1 -delete + #echo "Inhoud van directory $dir is verwijderd." + echo "Directory $dir bestaat al." fi done ## Runnen van Jupyter Notebook @@ -38,13 +39,16 @@ fi source "$VENV_DIR/bin/activate" # Installeer of update de benodigde pakketten -if [ -f "python_app/requirements.txt" ]; then - echo "Requirements aan het installeren of bijwerken..." - pip install --upgrade -r python_app/requirements.txt -else - echo "Geen requirements.txt bestand gevonden." +OS=$(uname | tr '[:upper:]' '[:lower:]') # Dit zet de uitvoer om naar lowercase +REQUIREMENTS_PATH="python_app/requirements_${OS}.txt" + +if [[ ! -f $REQUIREMENTS_PATH ]]; then + echo "Requirements bestand niet gevonden voor besturingssysteem: $OS" + exit 1 fi +pip install --upgrade -r $REQUIREMENTS_PATH + # Hier kan je verdere stappen toevoegen, zoals het uitvoeren van je Python-script of Jupyter Notebook # Deactiveer de virtuele omgeving (optioneel) deactivate