@@ -25,9 +25,9 @@ Helper function to get the parameters for the Quan & Fry formula as function of
25
25
salinity, temperature and pressure.
26
26
"""
27
27
function calc_quan_fry_params (
28
- salinity:: Real ,
29
- temperature:: Real ,
30
- pressure:: Real )
28
+ salinity:: T ,
29
+ temperature:: T ,
30
+ pressure:: T ) where {T <: Real }
31
31
32
32
n0 = 1.31405
33
33
n1 = 1.45e-5
@@ -54,11 +54,12 @@ function calc_quan_fry_params(
54
54
a3 = - n9
55
55
a4 = n10
56
56
57
- return a01, a2, a3, a4
57
+ return T ( a01), T (a2), T (a3), T (a4)
58
58
end
59
59
60
+
60
61
"""
61
- refractive_index_fry (wavelength, salinity, temperature, pressure )
62
+ _refractive_index_fry (wavelength, quan_fry_params )
62
63
63
64
The phase refractive index of sea water according to a model
64
65
from Quan & Fry.
@@ -76,14 +77,6 @@ downloaded Jan 2011 from: http://www.physics.ox.ac.uk/Users/schuster/thesis0098m
76
77
77
78
Adapted from clsim (https://github.com/claudiok/clsim)
78
79
"""
79
- function _refractive_index_fry (
80
- wavelength:: T ;
81
- salinity:: Real ,
82
- temperature:: Real ,
83
- pressure:: Real ) where {T<: Real }
84
- refractive_index_fry (wavelength, T .(calc_quan_fry_params (salinity, temperature, pressure)))
85
- end
86
-
87
80
function _refractive_index_fry (
88
81
wavelength:: Real ,
89
82
quan_fry_params:: Tuple{U,U,U,U}
@@ -94,26 +87,10 @@ function _refractive_index_fry(
94
87
end
95
88
96
89
"""
97
- dispersion_fry(
98
- wavelength::T;
99
- salinity::Real,
100
- temperature::Real,
101
- pressure::Real) where {T <: Real}
90
+ dispersion_fry(wavelength, a2, a3, a4)
102
91
103
- Calculate the dispersion (dn/dλ) for the Quan & Fry model.
104
- Wavelength is given in nm, salinity in permille, temperature in °C and pressure in atm
92
+ Calculate the dispersion for the Quan & Fry dispersion model.
105
93
"""
106
- function dispersion_fry (
107
- wavelength:: T ;
108
- salinity:: Real ,
109
- temperature:: Real ,
110
- pressure:: Real ) where {T<: Real }
111
-
112
- quan_fry_params = T .(calc_quan_fry_params (salinity, temperature, pressure))
113
-
114
- dispersion_fry (wavelength, quan_fry_params[2 ], quan_fry_params[3 ], quan_fry_params[4 ])
115
- end
116
-
117
94
function dispersion_fry (wavelength:: T , a2, a3, a4) where {T<: Number }
118
95
x = one (T) / wavelength
119
96
0 commit comments