-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathazmp_genReport2019.py
167 lines (130 loc) · 7.28 KB
/
azmp_genReport2019.py
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# Preliminary attempt to build an "all inclusive" function
# that would generate all figures for AZMP resDoc.
import os
import matplotlib.pyplot as plt
import numpy as np
import azmp_sections_tools as azst
import azmp_report_tools as azrt
## ---------- BOTTOM TEMPERATURE ---------- ##
## %my_run azmp_bottomT.py # <--- should make a function taking spring/fall and year as input (must run twice now)
## os.system('cp bottomT_fall2017.png bottomT_spring2017.png ~/to_windows/')
## os.system('cp bottomT_fall2017_FR.png bottomT_spring2017_FR.png ~/to_windows/')
## %my_run azmp_bottomS.py # <--- Now climato is 1981-2010 while Eugene uses 2000-2015
## os.system('cp bottomS_fall2017.png bottomS_spring2017.png ~/to_windows/')
## os.system('cp bottomS_fall2017_FR.png bottomS_spring2017_FR.png ~/to_windows/')
## %my_run azmp_bottom_stats.py # <--- should make a function taking spring/fall as input (must run twice now)
## %my_run azmp_bottomT_scorecards.py
## os.system('cp scorecards_botT_spring.png scorecards_botT_fall.png ~/to_windows/')
## os.system('cp scorecards_botT_spring_FR.png scorecards_botT_fall_FR.png ~/to_windows/')
## ---- New for 2019 ---- ##
# 1. NAO (should be a function with year as input)
%my_run azmp_nao.py
%my_run azmp_ao.py
%my_run azmp_amo.py
# 2. Air temperature (need to update Excel files and download NUUK update)
%my_run azmp_dmi_nuukAirT.py
%my_run azmp_airTemp_fromExcel.py
os.system('cp air_temp_2019.png air_temp_2019_FR.png air_temp_anom.png air_temp_anom_FR.png ../2019/')
%my_run azmp_air_scorecards.py
os.system('cp scorecards_air.png scorecards_air_FR.png ../2019/')
# 3. SSTs
# wget -m ftp://ftp.dfo-mpo.gc.ca/bometrics/noaa/stats/boxes/*.stat
# (in /home/cyrf0006/data/BIO_remote/bometrics/noaa/stats/boxes)
%my_run azmp_SSTs.py # to update bometrics data
%my_run azmp_SSTs_fromExcel.py # To merge with Eugene's historical Excel data
os.system('cp SST_index.png ../2019/')
%my_run azmp_SSTs_scorecards.py # to generate monthly anom, scorecards, etc.
os.system('cp scorecards_sst_yearly.png scorecards_sst_monthly.png ../2019/')
# 4. Station 27
%my_run viking2019.py
os.system('cp Viking2019.png Viking2019_FR.png ../2019')
# 5. Sea Ice (/home/cyrf0006/AZMP/state_reports/ice)
%my_run azmp_ice_index.py
os.system('cp ice_index.png ice_index_FR.png ../2019/')
# 5. bottom temperature maps
azrt.bottom_temperature(season='spring', year='2019')
azrt.bottom_temperature(season='fall', year='2019')
# For NAFO STACFEN and STACFIS input:
azrt.bottom_temperature(season='summer', year='2019', climato_file='Tbot_climato_SA4_summer_0.10.h5')
# bottom salinity maps
azrt.bottom_salinity(season='spring', year='2019')
azrt.bottom_salinity(season='fall', year='2019')
# bottom stats and scorecards
azrt.bottom_stats(years=np.arange(1980, 2020), season='spring')
azrt.bottom_stats(years=np.arange(1980, 2020), season='fall')
azrt.bottom_stats(years=np.arange(1980, 2020), season='summer')
azrt.bottom_scorecards(years=[1980, 2019])
os.system('cp scorecards_botT_spring.png scorecards_botT_spring_FR.png scorecards_botT_fall_FR.png scorecards_botT_fall.png ../2019')
# For NAFO STACFEN and STACFIS input (for azmp_composite_index.py):
azrt.bottom_stats(years=np.arange(1980, 2020), season='summer', climato_file='Tbot_climato_SA4_summer_0.10.h5')
# bottom temperature bar plots
%my_run azmp_bottomT_mean_anomaly.py # same as previous
os.system('cp mean_anomalies_fall.png mean_anomalies_spring.png ../2019')
os.system('cp mean_anomalies_fall_FR.png mean_anomalies_spring_FR.png ../2019')
# Sections plots
year = 2019
sections = ['FC']
seasons = ['summer']
variables = ['temperature', 'salinity']
for section in sections:
for season in seasons:
for var in variables:
azst.seasonal_section_plot(VAR=var, SECTION=section, SEASON=season, YEAR=year, ZMAX=500, STATION_BASED=True)
plt.close('all')
command = 'montage temperature_' + section + '_' + season + '_' + str(year) + '.png salinity_' + section + '_' + season + '_' + str(year) + '.png -tile 2x1 -geometry +10+10 -background white ' + section + '_stn_' + season + '_' + str(year) + '.png'
os.system(command)
command = 'montage temperature_' + section + '_' + season + '_' + str(year) + '_FR.png salinity_' + section + '_' + season + '_' + str(year) + '_FR.png -tile 2x1 -geometry +10+10 -background white ' + section + '_stn_' + season + '_' + str(year) + '_FR.png'
os.system(command)
os.system('rm temperature*.png salinity*.png')
os.system('cp ' + section + '_stn_' + season + '_' + str(year) + '.png ../2019')
os.system('cp ' + section + '_stn_' + season + '_' + str(year) + '_FR.png ../2019')
## ----------- CSAS DATA ---------------- ##
%my_run csas_crab_stats.py
%my_run azmp_bottomT_habitat.py
%my_run NSRF_bottomT.py
%my_run NSRF_bottomS.py
%my_run NSRF_bottomT_habitat.py
%my_run azmp_bottomT_shrimp_habitat.py
#azrt.bottom_stats(years=np.arange(1980, 2020), season='summer') # for crab 4R
azrt.bottom_temperature(season='summer', year='2019') # for crab 4R
## ----------- VIKING BUOY ---------------- ##
%my_run viking2017.py # <--- should make a function taking spring/fall and year as input (must run twice now)
os.system('cp Viking2017_sal.png Viking2017_temp.png ~/to_windows/')
os.system('cp Viking2017_sal_FR.png Viking2017_temp_FR.png ~/to_windows/')
## ----------- SECTION PLOT ---------------- ##
# (** or look at azmp_section_report_plot.py)
years = np.arange(1980, 2019)
sections = ['SI', 'BB', 'WB', 'FC', 'SEGB', 'SESPB']
seasons = ['spring', 'summer', 'fall']
variables = ['temperature', 'salinity']
# For MB/BI:
years = np.arange(2000, 2019)
sections = ['MB', 'BI']
seasons = ['summer']
variables = ['temperature', 'salinity']
for year in years:
for section in sections:
for season in seasons:
for var in variables:
azst.seasonal_section_plot(VAR=var, SECTION=section, SEASON=season, YEAR=year, ZMAX=500, STATION_BASED=True)
plt.close('all')
command = 'montage temperature_' + section + '_' + season + '_' + str(year) + '.png salinity_' + section + '_' + season + '_' + str(year) + '.png -tile 2x1 -geometry +10+10 -background white ' + section + '_stn_' + season + '_' + str(year) + '.png'
os.system(command)
os.system('rm temperature*.png salinity*.png')
for var in variables:
azst.seasonal_section_plot(VAR=var, SECTION=section, SEASON=season, YEAR=year, ZMAX=500, STATION_BASED=False)
plt.close('all')
command = 'montage temperature_' + section + '_' + season + '_' + str(year) + '.png salinity_' + section + '_' + season + '_' + str(year) + '.png -tile 2x1 -geometry +10+10 -background white ' + section + '_itp_' + season + '_' + str(year) + '.png'
os.system(command)
os.system('rm temperature*.png salinity*.png')
## ----------- DENSITY SECTION PLOT ---------------- ##
years = np.arange(1999, 2020)
sections = ['BB']
seasons = ['summer']
variables = ['sigma-t']
for year in years:
for section in sections:
for season in seasons:
for var in variables:
azst.seasonal_section_plot(VAR=var, SECTION=section, SEASON=season, YEAR=year, ZMAX=2000, STATION_BASED=True)
plt.close('all')