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

TiledDataset.plot() requires a slice_index even when it shouldn't #495

Open
Cadair opened this issue Jan 16, 2025 · 1 comment
Open

TiledDataset.plot() requires a slice_index even when it shouldn't #495

Cadair opened this issue Jan 16, 2025 · 1 comment

Comments

@Cadair
Copy link
Member

Cadair commented Jan 16, 2025

Take this setup:

import dkist
from dkist.data.sample import VBI_AJQWW
ds = dkist.load_dataset(VBI_AJQWW)

first_tiles = ds.slice_tiles[0]
first_tiles
<dkist.dataset.tiled_dataset.TiledDataset object at 0x7fdfe527c2d0>
This VBI Dataset AJQWW is an array of (3, 3) Dataset objects and
consists of 9 frames.
Files are stored in /home/stuart/.local/share/dkist/VBI_AJQWW

Each Dataset has 2 pixel and 2 world dimensions.

The data are represented by a <class 'dask.array.core.Array'> object:
dask.array<getitem, shape=(4096, 4096), dtype=float32, chunksize=(4096, 4096), chunktype=numpy.ndarray>

Array Dim  Axis Name                  Data size  Bounds
        0  helioprojective latitude        4096  None
        1  helioprojective longitude       4096  None

World Dim  Axis Name                  Physical Type                   Units
        1  helioprojective latitude   custom:pos.helioprojective.lat  arcsec
        0  helioprojective longitude  custom:pos.helioprojective.lon  arcsec

Correlation between pixel and world axes:

                          |          PIXEL DIMENSIONS
                          | helioprojective | helioprojective
         WORLD DIMENSIONS |    longitude    |     latitude
------------------------- | --------------- | ---------------
helioprojective longitude |        x        |        x
 helioprojective latitude |        x        |        x

This dataset does not need any further slicing to be able to plot it.

In fact if you slice it it breaks horribly:

Image

And passing what otherwise would be a valid slice breaks the logic for the title:

Image

@Cadair
Copy link
Member Author

Cadair commented Jan 16, 2025

We should probably call fig.tight_layout() or something at the end of .plot as well.

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

No branches or pull requests

1 participant