Skip to content

Commit

Permalink
There's still some hardcoding of coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
jgomezdans committed Sep 3, 2024
1 parent 3c29c02 commit 5f130db
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
# Canada datastore

An example crontab call for the script is:

```bash
SHELL=/bin/bash
BASH_ENV=~/.bashrc_conda
LOC=/home/jose/data/Canada_datastore_2024
EUMETSAT_KEY=wZbhgx5sf1qMYKsCpJ9Bf8lE7Aga
EUMETSAT_SECRET=DrBYHdM3AQwhxFiMaR0MIRbbX48a
QT_QPA_PLATFORM=offscreen
PATH=/bin:/usr/bin:/home/jose/mamba/bin/
MAILTO=jose.gomez-dans@kcl.ac.uk

0 3 * * * conda activate py312 ; get_arable -f /home/jose/data/KCL_Arable/raw_data/ >> /home/jose/data/KCL_Arable/logs/logfile.$(date +\%Y-\%m-\%d).log 2>&1
0 6 * * * conda activate py312 ; get_sentinel3 -f1 ${LOC}/Sentinel3 -ff ${LOC}/FIRMS/ >> ${LOC}/logs/logfile.$(date +\%Y-\%m-\%d-\%H-\%M).log 2>&1
0 12 * * * conda activate py312 ; get_sentinel3 -f1 ${LOC}/Sentinel3 -ff ${LOC}/FIRMS/ >> ${LOC}/logs/logfile.$(date +\%Y-\%m-\%d-\%H-\%M).log 2>&1
45 17 * * * conda activate py312 ; get_sentinel3 -f1 ${LOC}/Sentinel3 -ff ${LOC}/FIRMS/ >> ${LOC}/logs/logfile.$(date +\%Y-\%m-\%d-\%H-\%M).log 2>&1

```
11 changes: 4 additions & 7 deletions src/canada_datastore/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
logger = logging.getLogger("canada_datastore")

# URL = "http://10.81.205.13:3333/Canada_datastore/"
URL = "https://gws-access.jasmin.ac.uk/public/global_fire_models/"
URL = "https://gws-access.jasmin.ac.uk/public/global_fire_models/Canada_datastore_2024/"
# URL = "/home/jose/data/"


Expand Down Expand Up @@ -113,8 +113,7 @@ def add_layers_to_project(
layer = QgsVectorLayer(the_url, f"FIRMS {label}", "ogr")
layerz.append(layer)
if layer.isValid():
print(f"Adding {label}")
print(the_url)
print(f"Adding {label} <> {the_url}")
project.addMapLayer(
layer, False
) # Add the layer without adding it to the layer tree
Expand All @@ -126,6 +125,7 @@ def add_layers_to_project(
# Add layers to the group based on their type (raster or vector)
for group_label, [label, the_url] in layer_files.items():
if label.find("F1") >= 0:
print(f"Adding {label} <> {the_url}")
layer = add_qgis_raster_layer(the_url, label)
layerz.append(layer)
project.addMapLayer(layer, False)
Expand All @@ -139,7 +139,7 @@ def add_layers_to_project(
print(the_url, label)
layerz.append(layer)
if layer.isValid():
print(f"Adding {label}")
print(f"Adding {label} <> {the_url}")
project.addMapLayer(
layer, False
) # Add the layer without adding it to the layer tree
Expand Down Expand Up @@ -233,9 +233,6 @@ def create_all_project_files(
l1_today = {k: v for k, v in l1.items() if k.date() == today}
l2_today = {k: v for k, v in l2.items() if k.date() == today}
firms_today = {k: v for k, v in f1.items() if k.date() == today}
import pdb

pdb.set_trace()
add_layers_to_project(l1_today, l2_today, firms_today, output_fname)

qgs.exit()
Expand Down

0 comments on commit 5f130db

Please sign in to comment.