@@ -61,10 +61,9 @@ def toL1(L0, vars_df, T_0=273.15, tilt_threshold=-100):
6161 ds ['z_boom_u' ] = _reformatArray (ds ['z_boom_u' ]) # Reformat boom height
6262
6363 # Find range threshold and use it to clip and interpolate temperature measurements
64- variable_limits = vars_df [["lo" , "hi" , "OOL" ]].dropna (how = "all" )
65- t_lo = variable_limits .loc ["t_u" ,"lo" ]
66- t_hi = variable_limits .loc ["t_u" ,"hi" ]
67- ds ["t_u_interp" ] = air_temperature .clip_and_interpolate (ds ["t_u" ], t_lo , t_hi )
64+ tu_lo = vars_df .loc ["t_u" ,"lo" ]
65+ tu_hi = vars_df .loc ["t_u" ,"hi" ]
66+ ds ["t_u_interp" ] = air_temperature .clip_and_interpolate (ds ["t_u" ], tu_lo , tu_hi )
6867
6968 ds ['z_boom_u' ] = ds ['z_boom_u' ] * ((ds ['t_u_interp' ] + T_0 )/ T_0 )** 0.5 # Adjust sonic ranger readings for sensitivity to air temperature
7069
@@ -157,10 +156,9 @@ def toL1(L0, vars_df, T_0=273.15, tilt_threshold=-100):
157156 ds ['z_boom_l' ] = _reformatArray (ds ['z_boom_l' ]) # Reformat boom height
158157
159158 # Find range threshold and use it to clip and interpolate temperature measurements
160- variable_limits = vars_df ["lo" , "hi" , "OOL" ].dropna (how = "all" )
161- t_lo = variable_limits .loc ["t_l" , "lo" ]
162- t_hi = variable_limits .loc ["t_l" , "hi" ]
163- ds ["t_l_interp" ] = air_temperature .clip_and_interpolate (ds ["t_l" ], t_lo , t_hi )
159+ tl_lo = vars_df .loc ["t_l" , "lo" ]
160+ tl_hi = vars_df .loc ["t_l" , "hi" ]
161+ ds ["t_l_interp" ] = air_temperature .clip_and_interpolate (ds ["t_l" ], tl_lo , tl_hi )
164162
165163 ds ['z_boom_l' ] = ds ['z_boom_l' ] * ((ds ['t_l_interp' ]+ T_0 )/ T_0 )** 0.5 # Adjust sonic ranger readings for sensitivity to air temperature
166164
0 commit comments