Skip to content

Commit

Permalink
More rebase fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
samaloney committed May 5, 2024
1 parent f119efe commit d10065d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
7 changes: 2 additions & 5 deletions examples/imaging_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,16 @@
from stixpy.coordinates.frames import STIXImaging
from stixpy.coordinates.transforms import get_hpc_info
from stixpy.imaging.em import em
from stixpy.map.stix import STIXMap # noqa
from stixpy.product import Product

logger = logging.getLogger(__name__)
logger.setLevel("DEBUG")

#############################################################################
# Read science file as Product

cpd_sci = Product(
"http://pub099.cs.technik.fhnw.ch/fits/L1/2021/09/23/SCI/solo_L1_stix-sci-xray-cpd_20210923T152015-20210923T152639_V02_2109230030-62447.fits"
# 'http://pub099.cs.technik.fhnw.ch/fits/L1/2022/08/24/SCI/solo_L1_stix-sci-xray-cpd_20220824T140037-20220824T145017_V02_2208242079-61784.fits'
)
cpd_sci

Expand Down Expand Up @@ -131,7 +130,7 @@
fd_bp_map = Map((bp_image, header))

hpc_ref = Helioprojective(pointing[0], pointing[1], observer=solo, obstime=fd_bp_map.date)
header_hp = make_fitswcs_header(bp_image, hpc_ref, scale=[10,10]*u.arcsec/u.pix, rotation_angle=90*u.deg+roll)
header_hp = make_fitswcs_header(bp_image, hpc_ref, scale=[10, 10]*u.arcsec/u.pix, rotation_angle=90*u.deg+roll)
hp_map = Map((bp_image, header_hp))
hp_map_rotated = hp_map.rotate()

Expand Down Expand Up @@ -204,13 +203,11 @@
# Create a back projection image with natural weighting

bp_nat = vis_to_image(stix_vis1, imsize, pixel_size=pixel)
plt.imshow(bp_nat.value)

###############################################################################
# Create a back projection image with uniform weighting

bp_uni = vis_to_image(stix_vis1, imsize, pixel_size=pixel, natural=False)
plt.imshow(bp_uni.value)

###############################################################################
# Create a `sunpy.map.Map` with back projection
Expand Down
2 changes: 1 addition & 1 deletion stixpy/coordinates/frames.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from stixpy.net.client import STIXClient # noqa
from stixpy.utils.logging import get_logger

logger = get_logger(__name__, "DEBUG")
logger = get_logger(__name__)

__all__ = ["STIXImaging"]

Expand Down
7 changes: 5 additions & 2 deletions stixpy/coordinates/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
from sunpy.net import Fido
from sunpy.net import attrs as a

from stixpy.coordinates.frames import STIX_X_OFFSET, STIX_X_SHIFT, STIX_Y_OFFSET, STIX_Y_SHIFT, STIXImaging, logger
from stixpy.coordinates.frames import STIX_X_OFFSET, STIX_X_SHIFT, STIX_Y_OFFSET, STIX_Y_SHIFT, STIXImaging
from stixpy.utils.logging import get_logger

logger = get_logger(__name__)

__all__ = ['get_hpc_info', 'stixim_to_hpc', 'hpc_to_stixim']

Expand Down Expand Up @@ -154,5 +157,5 @@ def hpc_to_stixim(hpccoord, stxframe):
# Transform from SOLO HPC to STIX imaging
newrepr = solo_hpc_coord.cartesian.transform(matrix_transpose(rmatrix))
stx_coord = stxframe.realize_frame(newrepr, obstime=solo_hpc_frame.obstime)
logger.debug("STIX: %s", stx_coord)
logger.debug("STIX: %s", newrepr)
return stx_coord
5 changes: 1 addition & 4 deletions stixpy/map/stix.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def plot(self, **kwargs):

# Until this is resolved need to manually override https://github.com/astropy/astropy/issues/16339
res = super().plot(**kwargs)
if self.coordinate_system == 'stiximaging':
if self.coordinate_frame.name == 'stiximaging':
res.axes.coords[0].set_coord_type('longitude', coord_wrap=180*u.deg)
res.axes.coords[1].set_coord_type('latitude')

Expand All @@ -27,7 +27,4 @@ def plot(self, **kwargs):
res.axes.coords[0].set_axislabel(r'STIX $\Theta_{X}$')
res.axes.coords[1].set_axislabel(r'STIX $\Theta_{Y}$')

res.axes.coords[0].set_axislabel(r'STIX $\Theta_{X}$')
res.axes.coords[1].set_axislabel(r'STIX $\Theta_{Y}$')

return res

0 comments on commit d10065d

Please sign in to comment.