-
Notifications
You must be signed in to change notification settings - Fork 0
/
updateSSTGlobal.sh
executable file
·68 lines (52 loc) · 2.25 KB
/
updateSSTGlobal.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#! /bin/zsh
source $HOME/.zshrc
source $HOME/.env
## Settings based on computer
strval=$(uname -a)
if [[ $strval == *EemmMBP* ]];
then
analisisDir=$HOME/Dropbox/Oceanografia/Analisis/SSTGlobalAnalysis
pythonDir=$HOME/miniconda3/envs/ocean/bin/python
fi
if [[ $strval == *rossby* ]];
then
analisisDir=$HOME/Analisis/SSTGlobalAnalysis
pythonDir=/opt/conda/envs/ocean/bin/python
fi
/bin/rm $analisisDir/updateSSTGlobal.log
/bin/touch $analisisDir/updateSSTGlobal.log
printf ">>>> Updating analisis global SSTs \n"
printf " > $strval\n"
#------------------------------------
#Inicio
#------------------------------------
printf " > Directorio $analisisDir \n"
printf " > Download data from current year SSTs \n"
$pythonDir $analisisDir/downloadData.py
printf " > Update data SSTs \n"
/bin/rm $analisisDir/data/sst*.nc
$pythonDir $analisisDir/analysisData.py
printf " > Update data SSTs demarcaciones\n"
$pythonDir $analisisDir/analysisDataiDemarcaciones.py
printf " > Plots SSTs \n"
/bin/rm $analisisDir/images/*.png
$pythonDir $analisisDir/plotsTimeSeries.py
printf " > Plots Mapa anomalia \n"
$pythonDir $analisisDir/plotsMapAnomalies.py
$pythonDir $analisisDir/plotsMapAnomaliesDemarcaciones.py
printf " > Plots comparacionHS \n"
$pythonDir $analisisDir/plotsComparaHemispheres.py
printf " > Upload Plots \n"
$pythonDir $analisisDir/uploadImages.py
#------------------------------------
#TelegramBot
#------------------------------------
URL="https://api.telegram.org/bot$ArgoEsBotTOKEN/sendMessage"
URLimg="https://api.telegram.org/bot$ArgoEsBotTOKEN/sendphoto?chat_id=$ArgoEsChannel"
URLdoc="https://api.telegram.org/bot$ArgoEsBotTOKEN/sendDocument?chat_id=$ArgoEsChannel"
curl -s -X POST $URL -d chat_id=$ArgoEsChannel -d text="Global Analisis SST" -d parse_mode=html
curl -F "photo=@$analisisDir/images/map_sstd_anom_GO.png" $URLimg -F caption="Map Anomalia SST"
curl -F "photo=@$analisisDir/images/sstd_GO.png" $URLimg -F caption="Global SST"
curl -F "photo=@$analisisDir/images/sstd_anom_mean_GO_HN_HS.png" $URLimg -F caption="Compare HGlobal SST"
curl -F "photo=@$analisisDir/images/sstd_anom_mean_NAtl.png" $URLimg -F caption="Atlantico Norte promedio SST"
curl -F "photo=@$analisisDir/images/sstd_anom_NAtl.png" $URLimg -F caption="Atlantico Norte SST"