|
1 | | -import astropy.nddata |
2 | 1 | import numpy as np |
3 | 2 |
|
4 | | -from ndcube import utils |
| 3 | +import astropy.nddata |
| 4 | + |
| 5 | +from ndcube import ExtraCoords, utils |
5 | 6 | from ndcube.utils.exceptions import warn_user |
6 | 7 | from ndcube.wcs.wrappers import ResampledLowLevelWCS |
7 | 8 |
|
@@ -277,12 +278,12 @@ def rebin_by_edges( |
277 | 278 | orig_wcs = cube.combined_wcs |
278 | 279 | new_coord_values = list(cube.axis_world_coords_values(wcs=orig_wcs)) |
279 | 280 | new_coord_physical_types = orig_wcs.world_axis_physical_types[::-1] |
280 | | - new_coord_pix_idxs = [physical_type_to_pixel_axes(phys_type, orig_wcs) for phys_type in new_coord_physical_types] |
| 281 | + new_coord_pix_idxs = [utils.wcs.physical_type_to_pixel_axes(phys_type, orig_wcs) for phys_type in new_coord_physical_types] |
281 | 282 | new_coord_names = ( |
282 | 283 | name if name else phys_type |
283 | 284 | for name, phys_type in zip(orig_wcs.world_axis_names[::-1], new_coord_physical_types) |
284 | 285 | ) |
285 | | - wc_arr_idxs = [convert_between_array_and_pixel_axes(idx, ndim) for idx in new_coord_pix_idxs] |
| 286 | + wc_arr_idxs = [utils.wcs.convert_between_array_and_pixel_axes(idx, ndim) for idx in new_coord_pix_idxs] |
286 | 287 |
|
287 | 288 | # Combine data and mask and determine whether mask also needs rebinning. |
288 | 289 | new_data = _create_masked_array_for_rebinning(cube.data, cube.mask, operation_ignores_mask) |
@@ -328,7 +329,7 @@ def rebin_by_edges( |
328 | 329 | ) |
329 | 330 | data_unc = np.moveaxis(data_chunk, i, 0) |
330 | 331 | mask_unc = np.moveaxis(mask_chunk, i, 0) if rebin_mask else new_mask |
331 | | - tmp_uncertainty = propagate_rebin_uncertainties( |
| 332 | + tmp_uncertainty = utils.cube.propagate_rebin_uncertainties( |
332 | 333 | uncertainty_chunk, |
333 | 334 | data_unc, |
334 | 335 | mask_unc, |
|
0 commit comments