There is a newer version of the record available.

Published November 19, 2021 | Version v2.0.0

sunpy/ndcube: v2.0.0

Description

2.0.0 (2021-10-29) Backwards Incompatible Changes
  • Remove unused util functions and the ndcube WCS class. Refactor util functions for converting between between data and WCS indices to reflect the APE14 nomenclature that distinguishes between array, pixel and world axes. (#280)
  • NDCubeSequence animation axes can no longer be set by extra coords. (#294)
  • ImageAnimatorNDCubeSequence, ImageAnimatorCubeLikeNDCubeSequence, LineAnimatorNDCubeSequence and LineAnimatorCubeLikeNDCubeSequence have been removed and replaced by NDCubeSequenceAnimator. (#294)
  • Change type of output of <span class="title-ref">.NDCollection.aligned\_world\_axis\_physical\_types</span> from tuple to list. This is to be consistent with output of <span class="title-ref">astropy.wcs.WCS.world\_axis\_physical\_types</span>. (#302)
  • Change output type when common axis item is a slice that covers only one subcube. Previously this would return an NDCube. Now an NDCubeSequence is always returned unless the common axis item is an integer. Also, refactor NDCubeSequence.index_as_cube so codebase is simpler. (#311)
  • Replace NDCube.crop_by_coords and NDCube.crop_by_extra_coords with new method, NDCube.crop (#316)
  • Remove NDCubeSequence plotting. (#322)
  • Update <span class="title-ref">.NDCube.array\_axis\_physical\_types</span> return physical types from extra coords as well as the WCS. (#338)
  • Rename <span class="title-ref">.ExtraCoords.add</span> method from previous name "add_coordinate". (#394)
  • The <span class="title-ref">~.NDcube</span> object no longer inherits from <span class="title-ref">astropy.nddata.NDArithmeticMixin</span> as the methods were not coordinate aware. (#457)
Deprecations and Removals
  • Remove <span class="title-ref">NDCube.pixel\_to\_world</span> and <span class="title-ref">NDCube.world\_to\_pixel</span>. (#300)
  • Remove world_axis_physical_types methods from <span class="title-ref">.NDCube</span> and <span class="title-ref">.NDCubeSequence</span>. (#302)
  • Remove NDCubeSequence.sequence_axis_extra_coords. This is replaced by NDCubeSequence.sequence_axis_coords. (#335)
  • Remove <span class="title-ref">ndcube.NDCubeSequence.common\_axis\_extra\_coords</span>. Will be replaced by <span class="title-ref">ndcube.NDCubeSequence.common\_axis\_coords</span>. (#344)
  • Remove NDCollection.aligned_world_axis_physical_types. It will be replaced by <span class="title-ref">~ndcube.NDCollection.aligned\_axis\_physical\_types</span>. (#347)
Features
  • Implement a new <span class="title-ref">.ExtraCoords</span> class which allows the specification of extra coordinates via lookup tables or WCS. This class exposes the extra coords as an APE 14 WCS object. (#271)

  • Add new method, <span class="title-ref">~ndcube.NDCube.axis\_world\_coord\_values</span>, to return world coords for all pixels for all axes in WCS as quantity objects. (#279)

  • Added a new method <span class="title-ref">ndcube.NDCube.array\_axis\_physical\_types</span> to show which physical types are associated with each array axis. (#281)

  • Add properties to NDCubeSequence giving the world physical types for each array axis. (#301)

  • Add as_mpl_axes method to NDCube plotting mixin so the an NDCube can be provided to astropy WCSAxes as a projection. (#314)

  • Make pyplot colorbar work with the output on NDCube.plot when it is a 2D image. (#314)

  • Introduce a new class, <span class="title-ref">~ndcube.global\_coords.GlobalCoords</span>, for holding scalar coordinates that don't apply to any pixel axes. (#323)

  • Implement <span class="title-ref">.NDCube.world\_axis\_coords</span> which returns high level coordinate objects for all, or a subset of, axes. (#327)

  • New property, NDCubeSequence.sequence_axis_coords creates lists of GlobalCoords from each NDCube in the sequence. This replaces NDCubeSequence.sequence_axis_extra_coords, but because it uses the GlobaCoords infrastructure, can handle more than just coords that began as extra coords. (#335)

  • Implement <span class="title-ref">ndcube.NDCubeSequence.common\_axis\_coords</span> to replace <span class="title-ref">~ndcube.NDCubeSequence.common\_axis\_extra\_coords</span>. In contrast to old property, this new property collates coordinates from the wcs as well as extra_coords. (#344)

  • New property, <span class="title-ref">ndcube.NDCollection.aligned\_axis\_physical\_types</span>. This replaces <span class="title-ref">~ndcube.NDCollection.aligned\_world\_axis\_physical\_types</span> and returns a list of tuples, where each tuple gives the physical types common between all memebers of the collection for a given aligned axis. (#347)

  • Allow <span class="title-ref">ndcube.NDCubeSequence.explode\_along\_axis</span> to explode sequence along any axis, not just the common axis. (#358)

  • Plotting functionality on <span class="title-ref">NDCube</span> has been refactored to use pluggable "plotter" classes. All plotting functionality can now be accessed via the <span class="title-ref">.NDCube.plotter</span> attribute, with <span class="title-ref">.NDCube.plot</span> becoming an alias for <span class="title-ref">.NDCube.plotter.plot</span>.

    Advanced users, or package maintainers that which to customise the plotting functionality of an NDCube instance can set the .plotter attribute of a cube to be a subclass of <span class="title-ref">ndcube.visualization.BasePlotter</span> which then customises the behaviour of the NDCube.plot() method and provides any other methods implemented on the plotter. (#401)

  • Preserve sliced-out coordinates from WCS in the GlobalCoords instance. (#402)

  • Enable instantiating an NDCube from an existing NDCube by copying extra/global coords. (#404)

  • Support exposing dropped dimensions when <span class="title-ref">.ExtraCoords</span> is sliced. (#411)

  • <span class="title-ref">~ExtraCoords</span> is now explicitly limited to one dimensional tables because of a limitation in our use of <span class="title-ref">astropy.modeling</span>. (#414)

  • Adds functionality to reproject an <span class="title-ref">~.NDCube</span> object to coordinates described by another WCS or FITS Header by calling the new <span class="title-ref">~.NDCube.reproject\_to</span> method. (#434)

  • Change the edges= keyword to pixel_corners= in <span class="title-ref">NDCube.axis\_world\_coords</span> and <span class="title-ref">NDCube.axis\_world\_coords\_values</span> to make its meaning clearer based on SEP feedback. (#437)

  • <span class="title-ref">~.NDCube.axis\_world\_coords</span> and <span class="title-ref">~.NDCube.axis\_world\_coords\_values</span> now use a different, substantially faster and more memory efficient algorithm to generate the coordinates along all axes. (#442)

  • Extends <span class="title-ref">~.NDCube.reproject\_to</span> functionality by supporting adaptive and exact algorithms for an <span class="title-ref">~NDCube</span> with 2D celestial WCS. (#448)

  • Introduce optional offset between old and new pixel grids in <span class="title-ref">~ndcube.wcs.wrappers.resampled\_wcs.ResampledLowLevelWCS</span>. (#449)

  • <span class="title-ref">.ExtraCoords.from\_lookup\_table</span> accepts (a seqence of) physical_types as kwarg to set the types of its lookup_tables. (#451)

  • Create new plotter class for animating <span class="title-ref">~ndcube.NDCubeSequence</span> is the 2.0 framework. This class always sets the sequence axis as a slider and leverages <span class="title-ref">ndcube.NDCube.plot</span>. (#456)

  • Add __len__ method to <span class="title-ref">~ndcube.NDCubeSequence</span> which makes len(sequence) return the number of cubes in the sequence. (#464)

  • Add __iter__ method to <span class="title-ref">~ndcube.NDCubeSequence</span> which iterates through the cubes within the sequence. (#465)

  • Add property to <span class="title-ref">~ndcube.extra\_coords.ExtraCoords</span> that returns a WCS of extra coords that describes all axes of associated cube. (#472)

Bug Fixes
  • Fix NDCollection.aligned_dimensions so it doesnt crash when components of collection are NDCubeSequences. (#264)

  • Generalize int type checking so it is independent of the bit-type of the OS. (#269)

  • Fix axis_world_coord_values when the WCS is 1D and ensure it always returns Quantities (#287)

  • Change name of NDCube.axis_world_coord_values to NDCube.axis_world_coords_values to be consistent with NDCube.axis_world_coords (#293)

  • Remove NDCubeSequence animation dependence of deprecated sunpy ImageAnimator and LineAnimator classes in favour of ArrayAnimatorWCS class. (#294)

  • Fix bug whereby common axis was not updated appropriately when slicing an NDCubeSequence. (#310)

  • Fix bug in NDCube.axis_world_coords_values when number of pixel and world dimensions differ. (#319)

  • Fixes bug in <span class="title-ref">~ndcube.utils.wcs.array\_indices\_for\_world\_objects</span> when the WCS input does not have a world_axis_object_components attribute. The fix causes the low_level_wcs version is tried before the code fails. This enables <span class="title-ref">ndcube.NDCube.combined\_wcs</span> to be used with this function. (#344)

  • Fixes IndexError in <span class="title-ref">~ndcube.utils.wcs.array\_indices\_for\_world\_objects</span> which occurred when some of the world axes are dependent. (#344)

  • Stop <span class="title-ref">ndcube.NDCube.explode\_along\_axis</span> setting a common axis to the output <span class="title-ref">~ndcube.NDCubeSequence</span>. The output sequence should have no common axis. (#358)

  • Enable 2-D NDCubes to be visualized as a 1-D animated line. (#381)

  • Ensure corner inputs to <span class="title-ref">ndcube.NDCube.crop</span> are converted to units stored in WCS as <span class="title-ref">~astropy.wcs.WCS.world\_to\_array\_index\_values</span> does not handle units. (#382)

  • updated ndcube github repository link in <span class="title-ref">ndcube.docs.installation.rst</span>. (#392)

  • Fix bug in NDCube.axis_world_coords_values when axes_coords is initially a bare astropy coordinate object rather than a list/tuple of coordinate objects. (#400)

  • Change the implementation of <span class="title-ref">.NDCube.crop</span> so that it takes into account all the corners of the world region specified by the upper and lower corners, not just those two points. (#438)

  • Ensure <span class="title-ref">NDCube</span> init forces WCS to become high level.

    This patches a bug in astropy. (#447)

  • Fix bug in <span class="title-ref">~ndcube.NDCube.axis\_world\_coords\_values</span> which caused the units to be stripped when an axes input was given. (#461)

  • Fix bug in <span class="title-ref">~ndcube.utils.wcs.get\_dependent\_world\_axes</span> where an erroneous matrix transpose caused an error for non-square axis correlation matrices and wrong results for diagonally non-symmetric ones. (#471)

  • Extend support for cropping an <span class="title-ref">~ndcube.NDCube</span> using an <span class="title-ref">~ndcube.extra\_coords.ExtraCoords</span> instance as the wcs. (#472)

  • Fix check as to whether user inputs to <span class="title-ref">ndcube.wcs.wrappers.CompoundLowLevelWCS.world\_to\_pixel\_values</span> result in consistent pixel values when world dimensions share pixel dimensions. Previously this check was unreliable when non-trivial mapping between world and pixel dimensions was used. (#472)

  • Fix slicing <span class="title-ref">~ndcube.ExtraCoords</span> made of lookup tables. This bug meant that mapping of coords to arrays axes was not adjusted when an axis was dropped. (#482)

Improved Documentation
  • Document accepted input to lookup_table in <span class="title-ref">.ExtraCoords</span> setting its physical_types. (#451)
  • Improved information and formatting of __str__ methods. (#453)
Trivial/Internal Changes
  • Simplify and speed up implementation of NDCubeSequence slicing. (#251)
  • Fix docstring formatting to help docs build. (#262)
  • Use pytest-mpl for figure tests. (#312)
  • Port the tests for NDCube to use pytest fixtures (#318)
  • Allow corner inputs to <span class="title-ref">~ndcube.NDCube.crop</span> to not be wrapped in a <span class="title-ref">tuple</span> is only one high level coordinate objects required. (#380)
  • Make sunpy an optional dependence. Without it, the _animate_cube plotting functionality will be disabled. (#393)
  • Adds a function to compare the physical types of two WCS objects. (#433)
  • Propagate reference to NDCube object through <span class="title-ref">~ndcube.extra\_coords.ExtraCoords</span> string slicing. (#454)
  • Adds a function to identify invariant axes between two WCS objects. (#459)
  • The matplotlib animators code has been moved from <span class="title-ref">sunpy</span> to a new package <span class="title-ref">mpl\_animators</span> so ndcube no longer has an optional dependancy on sunpy. (#484)

Files

sunpy/ndcube-v2.0.0.zip

Files (664.8 kB)

Name Size
md5:9a422430ae77c83b79bd4ffd5842d12a
664.8 kB Preview Download

Additional details

Related works