@@ -62,3 +62,113 @@ Base.:(==)(a::Climate2D, b::Climate2D) = a.raw_climate == b.raw_climate && a.cli
62
62
a. climate_step == b. climate_step && a. climate_2D_step == b. climate_2D_step &&
63
63
a. longterm_temps == b. longterm_temps && a. avg_temps == b. avg_temps &&
64
64
a. avg_gradients == b. avg_gradients
65
+
66
+ # Display setup
67
+ function Base. show (io:: IO , climate:: Climate2D )
68
+ printstyled (" Climate2D\n " ;color= :yellow )
69
+
70
+ print (" avg_gradients = " )
71
+ printstyled (round (climate. avg_gradients; digits= 4 ); color= :blue )
72
+ println (" °C/m" )
73
+
74
+ print (" avg_temps = " )
75
+ printstyled (round (climate. avg_temps; digits= 2 );color= :blue )
76
+ println (" °C" )
77
+
78
+ print (" climate_2D_step: " )
79
+ printstyled (" Climate2Dstep" ;color= :yellow )
80
+ print (" with a " )
81
+ printstyled (size (climate. climate_2D_step. temp); color= :red )
82
+ println (" grid" )
83
+
84
+ print (" climate_raw_step: " )
85
+ printstyled (" RasterStack" ;color= :yellow )
86
+ print (" with " )
87
+ printstyled (length (climate. climate_raw_step);color= :red )
88
+ print (" time steps [ " )
89
+ printstyled (Dates. format (dims (climate. climate_raw_step, Ti)[begin ], " yyyy-mm-dd" );color= :green )
90
+ print (" → " )
91
+ printstyled (Dates. format (dims (climate. climate_raw_step, Ti)[end ], " yyyy-mm-dd" );color= :green )
92
+ println (" ]" )
93
+
94
+ println (" climate_step:" )
95
+ print (" gradient = " )
96
+ printstyled (round (climate. climate_step[" gradient" ];digits= 3 );color= :blue )
97
+ println (" °C/m (sum of clipped gradients)" )
98
+ print (" temp = " )
99
+ printstyled (round (climate. climate_step[" temp" ];digits= 3 );color= :blue )
100
+ println (" °C (sum of positive temperatures)" )
101
+ print (" avg_temp = " )
102
+ printstyled (round (climate. climate_step[" avg_temp" ];digits= 3 );color= :blue )
103
+ println (" °C" )
104
+ print (" avg_gradient = " )
105
+ printstyled (round (climate. climate_step[" avg_gradient" ];digits= 3 );color= :blue )
106
+ println (" °C/m" )
107
+ print (" ref_hgt = " )
108
+ printstyled (round (climate. climate_step[" ref_hgt" ];digits= 1 );color= :blue )
109
+ println (" m" )
110
+ print (" prcp = " )
111
+ printstyled (round (climate. climate_step[" prcp" ];digits= 1 );color= :blue )
112
+ println (" kg/m²" )
113
+
114
+ print (" longterm_temps: " )
115
+ printstyled (" $(typeof (climate. longterm_temps)) " ;color= :yellow )
116
+ print (" with " )
117
+ printstyled (" $(length (climate. longterm_temps)) " ;color= :red )
118
+ println (" elements" )
119
+
120
+ print (" raw_climate: " )
121
+ printstyled (" RasterStack" ;color= :yellow )
122
+ print (" with " )
123
+ printstyled (" $(length (climate. raw_climate)) " ;color= :red )
124
+ print (" time steps [ " )
125
+ printstyled (Dates. format (dims (climate. raw_climate, Ti)[begin ], " yyyy-mm-dd" );color= :green )
126
+ print (" → " )
127
+ printstyled (Dates. format (dims (climate. raw_climate, Ti)[end ], " yyyy-mm-dd" );color= :green )
128
+ print (" ]" )
129
+ end
130
+
131
+ function Base. show (io:: IO , climate_step:: Climate2Dstep )
132
+ printstyled (" Climate2Dstep" ;color= :yellow )
133
+ print (" with a " )
134
+ printstyled (size (climate_step. temp); color= :red )
135
+ println (" grid" )
136
+
137
+ print (" avg_gradient = " )
138
+ printstyled (round (climate_step. avg_gradient; digits= 4 ); color= :blue )
139
+ println (" °C/m" )
140
+
141
+ print (" gradient = " )
142
+ printstyled (round (climate_step. gradient; digits= 4 ); color= :blue )
143
+ println (" °C/m (sum of clipped gradients)" )
144
+
145
+ print (" ref_hgt = " )
146
+ printstyled (round (climate_step. ref_hgt; digits= 1 ); color= :blue )
147
+ println (" m" )
148
+
149
+ print (" x: " )
150
+ printstyled (typeof (climate_step. x);color= :yellow )
151
+ print (" in [ " )
152
+ printstyled (" $(round (minimum (climate_step. x);digits= 6 )) ° → $(round (maximum (climate_step. x);digits= 6 )) °" ; color= :blue )
153
+ println (" ]" )
154
+
155
+ print (" y: " )
156
+ printstyled (typeof (climate_step. y);color= :yellow )
157
+ print (" in [ " )
158
+ printstyled (" $(round (minimum (climate_step. y);digits= 6 )) ° → $(round (maximum (climate_step. y);digits= 6 )) °" ; color= :blue )
159
+ println (" ]" )
160
+
161
+ println (" min,mean,max:" )
162
+
163
+ print (" PDD: " )
164
+ printstyled (" $(round (minimum (climate_step. PDD); digits= 1 )) $(round (mean (climate_step. PDD); digits= 1 )) $(round (maximum (climate_step. PDD); digits= 1 )) \n " ; color= :blue )
165
+
166
+ print (" rain: " )
167
+ printstyled (" $(round (minimum (climate_step. rain); digits= 1 )) $(round (mean (climate_step. rain); digits= 1 )) $(round (maximum (climate_step. rain); digits= 1 )) \n " ; color= :blue )
168
+
169
+ print (" snow: " )
170
+ printstyled (" $(round (minimum (climate_step. snow); digits= 1 )) $(round (mean (climate_step. snow); digits= 1 )) $(round (maximum (climate_step. snow); digits= 1 )) \n " ; color= :blue )
171
+
172
+ print (" temp: " )
173
+ printstyled (" $(round (minimum (climate_step. temp); digits= 1 )) $(round (mean (climate_step. temp); digits= 1 )) $(round (maximum (climate_step. temp); digits= 1 )) \n " ; color= :blue )
174
+ end
0 commit comments