@@ -349,13 +349,13 @@ def _pixel_index_block(
349349 scale : np .ndarray ,
350350 ) -> np .ndarray :
351351 """Compute fractional source indices for a single target tile."""
352- target_x = tgt_x_block [0 , :].astype (np .float64 )
353- target_y = tgt_y_block [:, 0 ].astype (np .float64 )
352+ target_x = tgt_x_block [0 , :].astype (np .float32 )
353+ target_y = tgt_y_block [:, 0 ].astype (np .float32 )
354354
355355 nx_tgt = target_x .size
356356 ny_tgt = target_y .size
357357
358- idx_frac = np .full ((2 , ny_tgt , nx_tgt ), np .nan , dtype = np .float64 )
358+ idx_frac = np .full ((2 , ny_tgt , nx_tgt ), np .nan , dtype = np .float32 )
359359
360360 ny_src , nx_src = src_x_block .shape
361361
@@ -365,7 +365,7 @@ def _pixel_index_block(
365365 quad_ij0 = np .stack ((ix0 , iy0 )).astype (np .int32 )
366366
367367 # Quad corner coordinates
368- src_coords = np .stack ((src_x_block , src_y_block )).astype (np .float64 )
368+ src_coords = np .stack ((src_x_block , src_y_block )).astype (np .float32 )
369369 quad_corners = np .stack (
370370 (
371371 src_coords [:, quad_ij0 [1 ], quad_ij0 [0 ]],
@@ -384,7 +384,7 @@ def _pixel_index_block(
384384 return idx_frac
385385
386386 # Bounding target pixel indices per quad
387- offset = np .array ([target_x [0 ], target_y [0 ]], dtype = np .float64 )
387+ offset = np .array ([target_x [0 ], target_y [0 ]], dtype = np .float32 )
388388 tgt_bbox = np .floor (
389389 (quad_corners - offset [:, None , None ]) / scale [:, None , None ]
390390 ).astype (np .int32 )
@@ -422,7 +422,7 @@ def _pixel_index_block(
422422 # Build block-aligned target coordinate views
423423 tgt_x = target_gm .x_coords .data
424424 tgt_y = target_gm .y_coords .data
425- scale = np .array ([tgt_x [1 ] - tgt_x [0 ], tgt_y [1 ] - tgt_y [0 ]], dtype = np .float64 )
425+ scale = np .array ([tgt_x [1 ] - tgt_x [0 ], tgt_y [1 ] - tgt_y [0 ]], dtype = np .float32 )
426426 tgt_x = da .stack ([tgt_x ] * len (tgt_y .chunks [0 ]), axis = 0 )
427427 tgt_y = da .stack ([tgt_y ] * len (tgt_x .chunks [1 ]), axis = 1 )
428428
@@ -433,7 +433,7 @@ def _pixel_index_block(
433433 src_x_coords ,
434434 src_y_coords ,
435435 scale ,
436- dtype = np .float64 ,
436+ dtype = np .float32 ,
437437 chunks = (2 , tgt_y .chunks [0 ], tgt_x .chunks [1 ]),
438438 )
439439
@@ -539,7 +539,7 @@ def _xy_bbox_block(x_coords: np.ndarray, y_coords: np.ndarray):
539539 x_edges .max (),
540540 y_edges .max (),
541541 ],
542- dtype = np .float64 ,
542+ dtype = np .float32 ,
543543 )
544544 return bbox [:, None , None ]
545545
@@ -549,7 +549,7 @@ def _get_xy_bboxes(gm_2d: GridMapping):
549549 _xy_bbox_block ,
550550 gm_2d .x_coords .data ,
551551 gm_2d .y_coords .data ,
552- dtype = np .float64 ,
552+ dtype = np .float32 ,
553553 chunks = (4 , 1 , 1 ),
554554 )
555555
0 commit comments