Skip to content

Commit 5b75032

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents 4800fb7 + a31700b commit 5b75032

File tree

3 files changed

+61
-1
lines changed

3 files changed

+61
-1
lines changed
File renamed without changes.

scripts/r/get_historical_data.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ lapply(seq(1, length(these_dates), chunksize), function(j){
213213

214214
print(paste0("writing chunk with ", nrow(weather_daily), " records"))
215215

216-
fwrite(weather_daily, "data/output/daily_station_historical.csv.gz")
216+
fwrite(weather_daily, output_data_file_path)
217217

218218
# print("pausing 60 seconds")
219219
# Sys.sleep(60) # Increased pause between chunks

update_weather.sh

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/bin/bash
2+
# filepath: scripts/update_weather.sh
3+
4+
#SBATCH --partition=ceab
5+
#SBATCH --cpus-per-task=1
6+
#SBATCH --mem=8G
7+
#SBATCH --time=06:00:00
8+
#SBATCH --mail-type=BEGIN,END,FAIL
9+
10+
#SBATCH --job-name=update_weather
11+
12+
# Load required modules
13+
module load GDAL/3.10.0-foss-2024a
14+
module load R/4.4.2-gfbf-2024a
15+
16+
# Change to project directory
17+
cd /home/j.palmer/research/weather-data-collector-spain
18+
19+
cat "=== Collecting Three Datasets ==="
20+
cat "Starting: $(date)"
21+
22+
# Dataset 1: Historical daily stations (original AEMET names)
23+
echo "Dataset 1: Historical daily stations..."
24+
srun Rscript scripts/r/get_historical_data.R
25+
if [ $? -eq 0 ]; then
26+
echo "✅ Historical collection completed"
27+
else
28+
echo "❌ Historical collection failed"
29+
fi
30+
31+
# Dataset 2: Current daily stations (gap between historical and present)
32+
echo "Dataset 2: Current daily stations..."
33+
srun Rscript scripts/r/aggregate_current_daily_stations.R
34+
if [ $? -eq 0 ]; then
35+
echo "✅ Current daily collection completed"
36+
else
37+
echo "❌ Current daily collection failed"
38+
fi
39+
40+
# Dataset 3: Hourly station ongoing
41+
echo "Dataset 3: Hourly station ongoing..."
42+
srun Rscript scripts/r/get_latest_data.R
43+
if [ $? -eq 0 ]; then
44+
echo "✅ Hourly collection completed"
45+
else
46+
echo "❌ Hourly collection failed"
47+
fi
48+
49+
# Dataset 4: Municipal forecasts
50+
echo "Dataset 4: Municipal forecasts..."
51+
srun Rscript scripts/r/get_forecast_data_hybrid.R
52+
if [ $? -eq 0 ]; then
53+
echo "✅ Forecast collection completed"
54+
else
55+
echo "❌ Forecast collection failed"
56+
fi
57+
58+
echo "=== Collection Summary ==="
59+
echo "Completed: $(date)"
60+
ls -la data/output/*.csv.gz

0 commit comments

Comments
 (0)