1010from geodepy .convert import rect2polar , polar2rect
1111
1212
13- def first_vel_params (wavelength , temp = 12 , pressure = 1013.25 , rel_humidity = 60 ):
13+ def first_vel_params (wavelength , frequency , n_REF = None , unit_length = None ):
1414 """
1515 Calculates the constant First Velocity Correction Parameters C and D
1616 for a given set of standard instrument settings
17- :param wavelength: Instrument Carrier Wavelength (micrometres)
18- :param temp: Standard Temperature (degrees Celsius)
19- :param pressure: Standard Pressure (hectopascals or millibars)
20- :param rel_humidity: Standard Relative Humidity (percentage)
17+ :param wavelength: Instrument Carrier Wavelength (Nanometers) - Mandatory
18+ :param frequency: Instrument modulation frequency (Hz) - Mandatory
19+ :param n_REF: manufacturers reference refractive index - Recommended
20+ :param unit_length: unit length of instrument - Optional
2121 :return: First Velocity Correction Parameters C and D
22+ Reference Rueger, J.M., 2012, Electronic Distance Measurement – An Introduction, 4rd edition, Springer, Berlin
2223 """
23- group_refractivity = 287.6155 + (4.8866 / wavelength ** 2 ) + (0.068 / wavelength ** 4 )
24- param_d = (273.15 / 1013.25 ) * group_refractivity
25- saturation_pressure = ((1.0007 + ((3.46 * pressure ) * (10 ** - 6 )))
26- * 6.1121 * exp ((17.502 * temp ) / (240.94 + temp )))
27- param_c = ((((group_refractivity * pressure ) / (273.15 + temp )) * (273.15 / 1013.25 ))
28- - (11.27 * ((saturation_pressure * (rel_humidity / 100 )) / (273.15 + temp ))))
24+
25+ if not n_REF and not unit_length :
26+ raise ValueError ('Error - n_REF and unit_length cannot both be None' )
27+
28+ if not n_REF :
29+ # Rueger eq 6.3
30+ n_REF = 299792458 / (2 * unit_length * frequency )
31+
32+ # Rueger eq 6.12
33+ param_c = (n_REF - 1 )* 10 ** 6
34+
35+ # Rueger eq 5.12
36+ # https://office.iag-aig.org/doc/5d7b8fda0c032.pdf Resolution 3
37+ nG_1_10_6 = 287.6155 + (4.8866 / wavelength ** 2 ) + (0.068 / wavelength ** 4 )
38+ # Rueger eq 6.13
39+ param_d = (273.15 / 1013.25 ) * nG_1_10_6
40+
2941 return param_c , param_d
3042
3143
32- def first_vel_corrn (dist , first_vel_param , temp , pressure , rel_humidity ):
44+ def part_h2o_vap_press (dry_temp , pressure , rel_humidity = None , wet_temp = None ):
45+ """
46+ :param dry_temp: Observed Dry Temperature (degrees Celsius)
47+ :param pressure: Observed Pressure (hectopascals or millibars)
48+ :param rel_humidity: Observed Relative Humidity (percentage) - Optional if wet_temp supplied
49+ :param wet_temp: Observed Wet Temperature (degrees Celsius) - Optional if rel_humidity supplied
50+ Reference Rueger, J.M., 2012, Electronic Distance Measurement – An Introduction, 4rd edition, Springer, Berlin
51+ """
52+
53+ if not rel_humidity and not wet_temp :
54+ raise ValueError ('Error - rel_humidity and wet_temp cannot both be None' )
55+
56+ if rel_humidity :
57+ wet_temp = dry_temp
58+ # Rueger eq 5.27
59+ E_w = ((1.0007 + ((3.46 * pressure ) * (10 ** - 6 )))
60+ * 6.1121 * exp ((17.502 * wet_temp ) / (240.94 + wet_temp )))
61+
62+ if rel_humidity :
63+ # Rueger eq 5.29
64+ e = (E_w * rel_humidity )/ 100
65+ else :
66+ e = E_w - 0.000662 * pressure * (dry_temp - wet_temp )
67+
68+ return e
69+
70+
71+ def first_vel_corrn (dist , first_vel_param , temp , pressure ,
72+ rel_humidity = None , wet_temp = None ):
3373 """
3474 Carries out First Velocity Correction of Electronic Distance Measurement,
3575 given correction parameters and atmospheric observations
@@ -42,14 +82,44 @@ def first_vel_corrn(dist, first_vel_param, temp, pressure, rel_humidity):
4282 """
4383 param_c = first_vel_param [0 ]
4484 param_d = first_vel_param [1 ]
45- part_h2o_press = exp ((17.269 * temp ) / (237.3 + temp ))
46- first_vel_corrn_ppm = param_c - (
47- (param_d * pressure ) / (273.15 + temp ) + ((11.27 * part_h2o_press ) * (0.061078 * rel_humidity )) / (
48- 273.15 + temp ))
85+ e = part_h2o_vap_press (temp , pressure , rel_humidity , wet_temp )
86+
87+ # Rueger eq 6.11
88+ t_273_15 = temp + 273.15
89+ first_vel_corrn_ppm = (param_c - ((param_d * pressure )/ t_273_15 )+ ((11.27 * e )/ t_273_15 ))
4990 first_vel_corrn_metres = dist * first_vel_corrn_ppm * (10 ** - 6 )
91+
5092 return first_vel_corrn_metres
5193
5294
95+ def mets_partial_differentials (group_ref_Index = 1.00028 ,
96+ temp = 15 ,
97+ pressure = 1013.25 ,
98+ rel_humidity = 60 ):
99+ """ Returns the sensitivity coefficients for temp, pressure and humidity in ppm
100+ :param group_ref_Index: manufacturers group refractive index of light
101+ :param temp: Observed Dry Temperature (degrees Celsius)
102+ :param pressure: Observed Pressure (hectopascals or millibars)
103+ :param rel_humidity: Observed Relative Humidity (percentage) - Optional if wet_temp supplied
104+ """
105+ ng_1 = group_ref_Index - 1
106+ t_273_15 = temp + 273.15
107+ e = part_h2o_vap_press (temp , pressure , rel_humidity )
108+
109+ param_k = (((((ng_1 * 273.15 * pressure )
110+ / 1013.25 )
111+ - (11.27 * e * 10 ** - 6 ))
112+ / t_273_15 ** 2 )
113+ * (10 ** 6 ))
114+ param_l = (0.26957809 * (ng_1 / t_273_15 )
115+ * (10 ** 6 ))
116+ param_m = (((11.27 * 10 ** - 6 )
117+ / t_273_15 )
118+ * (10 ** 6 ))
119+
120+ return param_k , param_l , param_m
121+
122+
53123def precise_inst_ht (vert_list , spacing , offset ):
54124 """
55125 Uses a set of Vertical Angle Observations taken to a
0 commit comments