@@ -160,22 +160,23 @@ def get_nonwear_measurements(
160160 return results [0 ]
161161
162162
163- def nonwear_array_cleanup (
164- nonwear_array : models .Measurement ,
163+ def synchronize_measurements (
164+ data_measurement : models .Measurement ,
165165 reference_measurement : models .Measurement ,
166166 epoch_length : float = 5.0 ,
167167) -> models .Measurement :
168- """This function is used to match the nonwear array to a reference Measurement.
168+ """This function is used to match a Measurement object to a reference Measurement.
169169
170- This function ensures that the nonwear array and reference Measurement times
171- are synced up. This is accomplished by first resampling the nonwear array to
170+ This function ensures that a Measurement object and reference Measurement times
171+ are synced up. This is accomplished by first resampling a Measurement object to
172172 the specified temporal resolution.
173- It also ensures that the nonwear array is a binary array, where 1 indicates
173+ It also ensures that a Measurement object is a binary array, where 1 indicates
174174 nonwear and 0 indicates wear.
175- It then truncates the nonwear array to match the reference Measurement time points.
175+ It then truncates a Measurement object to match the reference
176+ Measurement time points.
176177
177178 Args:
178- nonwear_array : The nonwear array to clean up.
179+ data_measurement : The nonwear array to clean up.
179180 reference_measurement: The reference measurement to use for resampling.
180181 epoch_length: The temporal resolution of the output, in seconds.
181182 Defaults to 5.0.
@@ -185,7 +186,7 @@ def nonwear_array_cleanup(
185186 returned as a boolean (True == nonwear).
186187 """
187188 time_fix_nonwear = _time_fix (
188- nonwear_array , reference_measurement .time [- 1 ], reference_measurement .time [0 ]
189+ data_measurement , reference_measurement .time [- 1 ], reference_measurement .time [0 ]
189190 )
190191 resampled_nonwear = computations .resample (time_fix_nonwear , epoch_length )
191192 binary_nonwear = np .where (resampled_nonwear .measurements >= 0.5 , 1 , 0 )
0 commit comments