@@ -183,7 +183,7 @@ impl<T: TimeScale> Pass<T> {
183183 if times. is_empty ( ) {
184184 // Create default points at window start and end
185185 let start_seconds = 0.0 ;
186- let end_seconds = window. duration ( ) . to_decimal_seconds ( ) ;
186+ let end_seconds = window. duration ( ) . as_seconds_f64 ( ) ;
187187 let default_obs = observables
188188 . first ( )
189189 . cloned ( )
@@ -197,7 +197,7 @@ impl<T: TimeScale> Pass<T> {
197197 )
198198 } else {
199199 // Duplicate the single point
200- let time_sec = ( times[ 0 ] . clone ( ) - window. start ( ) ) . to_decimal_seconds ( ) ;
200+ let time_sec = ( times[ 0 ] . clone ( ) - window. start ( ) ) . as_seconds_f64 ( ) ;
201201 let obs = & observables[ 0 ] ;
202202 (
203203 vec ! [ time_sec, time_sec + 1.0 ] , // Add 1 second offset for second point
@@ -211,7 +211,7 @@ impl<T: TimeScale> Pass<T> {
211211 // Normal case with multiple points
212212 let time_seconds: Vec < f64 > = times
213213 . iter ( )
214- . map ( |t| ( t. clone ( ) - window. start ( ) ) . to_decimal_seconds ( ) )
214+ . map ( |t| ( t. clone ( ) - window. start ( ) ) . as_seconds_f64 ( ) )
215215 . collect ( ) ;
216216
217217 // Extract observable arrays
@@ -267,7 +267,7 @@ impl<T: TimeScale> Pass<T> {
267267 }
268268
269269 // Convert time to seconds since window start for interpolation
270- let target_seconds = ( time - self . window . start ( ) ) . to_decimal_seconds ( ) ;
270+ let target_seconds = ( time - self . window . start ( ) ) . as_seconds_f64 ( ) ;
271271
272272 // Use Series interpolation for each observable
273273 let azimuth = self . azimuth_series . interpolate ( target_seconds) ;
@@ -309,18 +309,11 @@ pub fn visibility_dyn(
309309 let end = * times. last ( ) . unwrap ( ) ;
310310 let times: Vec < f64 > = times
311311 . iter ( )
312- . map ( |t| ( * t - start) . to_decimal_seconds ( ) )
312+ . map ( |t| ( * t - start) . as_seconds_f64 ( ) )
313313 . collect ( ) ;
314314 let root_finder = Brent :: default ( ) ;
315315 find_windows (
316- |t| {
317- elevation_dyn (
318- start + TimeDelta :: try_from_decimal_seconds ( t) . unwrap ( ) ,
319- gs,
320- mask,
321- sc,
322- )
323- } ,
316+ |t| elevation_dyn ( start + TimeDelta :: from_seconds_f64 ( t) , gs, mask, sc) ,
324317 start,
325318 end,
326319 & times,
@@ -342,12 +335,12 @@ pub fn visibility_los(
342335 let end = * times. last ( ) . unwrap ( ) ;
343336 let times: Vec < f64 > = times
344337 . iter ( )
345- . map ( |t| ( * t - start) . to_decimal_seconds ( ) )
338+ . map ( |t| ( * t - start) . as_seconds_f64 ( ) )
346339 . collect ( ) ;
347340 let root_finder = Brent :: default ( ) ;
348341 find_windows (
349342 |t| {
350- let time = start + TimeDelta :: from_decimal_seconds ( t) ;
343+ let time = start + TimeDelta :: from_seconds_f64 ( t) ;
351344 let epoch = time
352345 . try_to_scale ( Tdb , & DefaultOffsetProvider )
353346 . unwrap ( )
@@ -400,8 +393,7 @@ pub fn visibility_combined<E: Ephemeris + Send + Sync>(
400393 let time_resolution = if times. len ( ) >= 2 {
401394 times[ 1 ] - times[ 0 ]
402395 } else {
403- // Default to 60 seconds if we don't have enough times
404- TimeDelta :: try_from_decimal_seconds ( 60.0 ) . expect ( "60 seconds should be valid" )
396+ TimeDelta :: from_seconds_f64 ( 60.0 )
405397 } ;
406398
407399 for window in windows {
@@ -457,13 +449,13 @@ where
457449 let end = * times. last ( ) . unwrap ( ) ;
458450 let times: Vec < f64 > = times
459451 . iter ( )
460- . map ( |t| ( * t - start) . to_decimal_seconds ( ) )
452+ . map ( |t| ( * t - start) . as_seconds_f64 ( ) )
461453 . collect ( ) ;
462454 let root_finder = Brent :: default ( ) ;
463455 find_windows (
464456 |t| {
465457 elevation (
466- start + TimeDelta :: try_from_decimal_seconds ( t ) . unwrap ( ) ,
458+ start + TimeDelta :: from_seconds_f64 ( t ) ,
467459 gs,
468460 mask,
469461 sc,
0 commit comments