Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: DanRyanIrish <[email protected]>
  • Loading branch information
samaloney and DanRyanIrish committed Apr 30, 2024
1 parent 8f2c7e0 commit 722550f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 28 deletions.
2 changes: 1 addition & 1 deletion changelog/90.feature.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Add a custom coordinate frame :class:`stixpy.coordinate.frames.STIXImaging` and the associated transformations (`~stixpy.coordinates.transforms.stixim_to_hpc`, ~stixpy.coordinates.transforms.hpc_to_stixim') to and from `~sunpy.coordinates.frames.Helioprojective`.
Add a custom coordinate frame :class:`stixpy.coordinate.frames.STIXImaging` and the associated transformations (`~stixpy.coordinates.transforms.stixim_to_hpc`, `~stixpy.coordinates.transforms.hpc_to_stixim`) to and from `~sunpy.coordinates.frames.Helioprojective`.
Also add a `stixpy.map.stix.STIXMap` for `~sunpy.map.Map` source which properly displays the :class:`stixpy.coordinate.frames.STIXImaging` coordinate frame.
6 changes: 0 additions & 6 deletions examples/imaging_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,9 @@
create_visibility,
get_uv_points_data,
)
# from stixpy.frames import get_hpc_info
from stixpy.imaging.em import em
from stixpy.product import Product

# from astropy.coordinates import SkyCoord
# from astropy.time import Time
# from sunpy.map import make_fitswcs_header, Map



logger = logging.getLogger(__name__)
logger.setLevel("DEBUG")
Expand Down
17 changes: 9 additions & 8 deletions stixpy/coordinates/frames.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ class STIXImaging(SunPyBaseCoordinateFrame):
r"""
STIX Imaging Frame
- ``x`` (aka "theta_x") along the pixel rows (e.g. 0, 1, 2, 3; 4, 5, 6, 8).
- ``y`` (aka "theta_y") along the pixel columns (e.g. A, B, C, D).
- ``Tx`` (aka "theta_x") along the pixel rows (e.g. 0, 1, 2, 3; 4, 5, 6, 8).
- ``Ty`` (aka "theta_y") along the pixel columns (e.g. A, B, C, D).
- ``distance`` is the Sun-observer distance.
Aligned with SIIX 'pixels' +X corresponds direction along pixel row toward pixels
Aligned with STIX 'pixels' +X corresponds direction along pixel row toward pixels
0, 4 and +Y corresponds direction along columns towards pixels 0, 1, 2, 3.
.. code-block:: text
Expand Down Expand Up @@ -74,11 +74,11 @@ def stix_wcs_to_frame(wcs):
Parameters
----------
wcs : astropy.wcs.WCS
wcs : `astropy.wcs.WCS`
Returns
-------
astropy.coordinates.BaseCoordinateFrame
`astropy.coordinates.BaseCoordinateFrame`
"""
if hasattr(wcs, "coordinate_frame"):
return wcs.coordinate_frame
Expand Down Expand Up @@ -113,17 +113,18 @@ def stix_wcs_to_frame(wcs):
def stix_frame_to_wcs(frame, projection='TAN'):
r"""
For a given frame, this function returns the corresponding WCS object.
It registers the WCS coordinates types from their associated frame in the
`astropy.wcs.utils.celestial_frame_to_wcs` registry.
Parameters
----------
frame : astropy.coordinates.BaseCoordinateFrame
projection : str, optional
frame : `astropy.coordinates.BaseCoordinateFrame`
projection : `str`, optional
Returns
-------
astropy.wcs.WCS
`astropy.wcs.WCS`
"""
# Bail out early if not STIXImaging frame
if not isinstance(frame, STIXImaging):
Expand Down
13 changes: 0 additions & 13 deletions stixpy/map/stix.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,6 @@ class STIXMap(GenericMap):
def is_datasource_for(cls, data, header, **kwargs):
return str(header.get('TELESCOP', '')).endswith('STIX')

# @property
# def coordinate_system(self):
# """
# Coordinate system used
#
# Overrides the values in the header which are not understood by Astropy WCS
# """
# return SpatialPair("SXLN-TAN", "SXLT-TAN")
#
# @property
# def spatial_units(self):
# return SpatialPair(u.arcsec, u.arcsec)

def plot(self, **kwargs):

# Until this is resolved need to manually override https://github.com/astropy/astropy/issues/16339
Expand Down

0 comments on commit 722550f

Please sign in to comment.