Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cube mosaicing: Expand capabilities substantially #868

Open
wants to merge 36 commits into
base: master
Choose a base branch
from

Conversation

keflavich
Copy link
Contributor

the cube utils mosaic header maker wasn't checking the spectral dimension before

@keflavich
Copy link
Contributor Author

Now branched off of #854

@keflavich keflavich changed the title Cube mosaicing: check spectral dimension Cube mosaicing: Expand capabilities substantially Mar 13, 2023
@keflavich keflavich mentioned this pull request Mar 13, 2023
@keflavich
Copy link
Contributor Author

This is largely reimplementing reproject/mosaicking/coadd.py, which is not good.

@keflavich
Copy link
Contributor Author

Some of the functionality I want here needs to be pushed into coadd. Will split this into another PR.

@keflavich
Copy link
Contributor Author

Dang, I thought I was getting somewhere.

Traceback (most recent call last):
  File "<ipython-input-1-349e0fbab013>", line 1, in <module>
    from aces.imaging.mosaic_12m import cs21_cube_mosaicing_minimal_test; cs21_cube_mosaicing_minimal_test()
  File "/orange/adamginsburg/ACES/reduction_ACES/aces/imaging/mosaic_12m.py", line 288, in cs21_cube_mosaicing_minimal_test
    result,_ = mosaic_cubes(cubes,
  File "/blue/adamginsburg/adamginsburg/repos/spectral-cube/spectral_cube/cube_utils.py", line 914, in mosaic_cubes
    output_array, output_footprint = reproject_and_coadd(
  File "/blue/adamginsburg/adamginsburg/repos/reproject/reproject/mosaicking/coadd.py", line 223, in reproject_and_coadd
    array, footprint = reproject_function(
  File "/blue/adamginsburg/adamginsburg/repos/astropy/astropy/utils/decorators.py", line 604, in wrapper
    return function(*args, **kwargs)
  File "/blue/adamginsburg/adamginsburg/repos/reproject/reproject/interpolation/high_level.py", line 121, in reproject_interp
    return _reproject_blocked(
  File "/blue/adamginsburg/adamginsburg/repos/reproject/reproject/utils.py", line 297, in _reproject_blocked
    output_array_dask = da.empty(shape_out, chunks=block_size or "auto")
  File "/blue/adamginsburg/adamginsburg/repos/dask/dask/array/wrap.py", line 60, in wrap_func_shape_as_first_arg
    parsed = _parse_wrap_args(func, args, kwargs, shape)
  File "/blue/adamginsburg/adamginsburg/repos/dask/dask/array/wrap.py", line 30, in _parse_wrap_args
    chunks = normalize_chunks(chunks, shape, dtype=dtype)
  File "/blue/adamginsburg/adamginsburg/repos/dask/dask/array/core.py", line 3106, in normalize_chunks
    raise ValueError(
ValueError: Chunks do not add up to shape. Got chunks=((4,), (5, 80, 101), (5, 100, 101)), shape=(4, 161, 152)

@keflavich
Copy link
Contributor Author

It works with a simple test - but not with blocks yet
image

@keflavich
Copy link
Contributor Author

I've been using this in production for a while. @e-koch, want to give it a once-over? Looks like I have some failing tests to fix, but I'm not sure if they're also failing on master

@codecov
Copy link

codecov bot commented Sep 3, 2023

Codecov Report

Patch has no changes to coverable lines.

❗ Current head e8083b7 differs from pull request most recent head 0cfcd02. Consider uploading reports for the commit 0cfcd02 to get more accurate results

Files Changed Coverage
spectral_cube/cube_utils.py 0.00%

📢 Thoughts on this report? Let us know!.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant