@@ -105,57 +105,57 @@ pressure_from_elevation(500.0, 25.0) # elev, Tair
105105
106106There are several formulations describing the empirical function ` Esat(Tair) ` .
107107The following figure compares them at absole scale and as difference to the
108- default method. The differences are small.
108+ # default method. The differences are small.
109109
110110``` @setup doc
111- using DataFrames
112- Tair = 0:0.25:12
113- #Tair = [10.0,20.0]
114- eform_def = Val(:Sonntag_1990)
115- Esat_def = Esat_from_Tair.(Tair; formula = eform_def)
116- eforms = (Val(:Sonntag_1990), Val(:Alduchov_1996), Val(:Allen_1998))
117- eform = eforms[2]
118- string.(eforms)
119- df = mapreduce(vcat, eforms) do eform
120- Esat = Esat_from_Tair.(Tair; formula = eform)
121- local dff # make sure to not override previous results
122- dff = DataFrame(
123- formula = eform, Tair = Tair,
124- Esat = Esat,
125- dEsat = Esat - Esat_def,
126- )
127- end;
128- #using Chain
129- using Pipe
130- using Plots, StatsPlots
131- dfw = @pipe df |> select(_, 1,2, :Esat) |> unstack(_, :formula, 3)
132- dfws = @pipe df |> select(_, 1,2, :dEsat) |> unstack(_, :formula, 3)
133- @df dfw plot(:Tair, cols(2:4), legend = :topleft, xlab="Tair (degC)", ylab="Esat (kPa)")
134- savefig("Esat_abs.svg")
135- @df dfws plot(:Tair, cols(2:4), legend = :topleft, xlab="Tair (degC)", ylab="Esat -ESat_Sonntag_1990 (kPa)")
136- savefig("Esat_rel.svg")
137- ```
138-
139- ![ ] ( Esat_abs.svg )
140-
141- ![ ] ( Esat_rel.svg )
111+ # using DataFrames
112+ # Tair = 0:0.25:12
113+ ## Tair = [10.0,20.0]
114+ # eform_def = Val(:Sonntag_1990)
115+ # Esat_def = Esat_from_Tair.(Tair; formula = eform_def)
116+ # eforms = (Val(:Sonntag_1990), Val(:Alduchov_1996), Val(:Allen_1998))
117+ # eform = eforms[2]
118+ # string.(eforms)
119+ # df = mapreduce(vcat, eforms) do eform
120+ # Esat = Esat_from_Tair.(Tair; formula = eform)
121+ # local dff # make sure to not override previous results
122+ # dff = DataFrame(
123+ # formula = eform, Tair = Tair,
124+ # Esat = Esat,
125+ # dEsat = Esat - Esat_def,
126+ # )
127+ # end;
128+ ## using Chain
129+ # using Pipe
130+ # using Plots, StatsPlots
131+ # dfw = @pipe df |> select(_, 1,2, :Esat) |> unstack(_, :formula, 3)
132+ # dfws = @pipe df |> select(_, 1,2, :dEsat) |> unstack(_, :formula, 3)
133+ # @df dfw plot(:Tair, cols(2:4), legend = :topleft, xlab="Tair (degC)", # ylab="Esat (kPa)")
134+ # savefig("Esat_abs.svg")
135+ # @df dfws plot(:Tair, cols(2:4), legend = :topleft, xlab="Tair (degC)", # ylab="Esat -ESat_Sonntag_1990 (kPa)")
136+ # savefig("fig/ Esat_rel.svg")
137+ ```
138+
139+ ![ ] ( fig/ Esat_abs.svg)
140+
141+ ![ ] ( fig/ Esat_rel.svg)
142142
143143## Global radiation
144144
145145Computing solar position in horizontal coordinates
146146``` @example doc
147- using Plots, StatsPlots, DataFrames, Dates, Suppressor
147+ using Plots, StatsPlots, DataFrames, Dates, Pipe, Suppressor
148148hours = 0:24
149149lat,long = 51.0, 13.6 # Dresden Germany
150150#deg2second = 24*3600/360
151151doy = 160
152152datetimes = DateTime(2021) .+Day(doy-1) .+ Hour.(hours) #.- Second(round(long*deg2second))
153153res3 = @suppress_err @pipe calc_sun_position_hor.(datetimes, lat, long) |> toDataFrame(_)
154154@df res3 scatter(datetimes, cols([:altitude,:azimuth]), legend = :topleft, xlab="Date and Time", ylab = "rad")
155- savefig("globrad.svg")
155+ savefig("fig/ globrad.svg")
156156```
157157
158- ![ ] ( globrad.svg )
158+ ![ ] ( fig/ globrad.svg)
159159
160160The hour-angle at noon represents the difference to
161161local time. In the following example solar time is
0 commit comments