From 483160315bcd9e7a5512d4c112eb3c2b33ac05f4 Mon Sep 17 00:00:00 2001 From: Yusuke Aso <98569855+yusukeaso-astron@users.noreply.github.com> Date: Fri, 10 Jan 2025 17:11:38 +0900 Subject: [PATCH] different frame and frameorg --- plotastrodata/other_utils.py | 4 ++++ plotastrodata/plot_utils.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/plotastrodata/other_utils.py b/plotastrodata/other_utils.py index 95cf1a6..a430958 100644 --- a/plotastrodata/other_utils.py +++ b/plotastrodata/other_utils.py @@ -124,6 +124,10 @@ def coord2xy(coords: str | list, coordorg: str = '00h00m00s 00d00m00s', frameorg = frame if frame is None and frameorg is None: frame = frameorg = 'icrs' + if frame != frameorg: + frame = frameorg + print('Different frame and frameorg are not supported by coord2xy yet.', + frameorg, 'is used.') clist = SkyCoord(coords, frame=frame) c0 = SkyCoord(coordorg, frame=frameorg) xy = c0.spherical_offsets_to(clist) diff --git a/plotastrodata/plot_utils.py b/plotastrodata/plot_utils.py index 68fe6e2..6209baf 100644 --- a/plotastrodata/plot_utils.py +++ b/plotastrodata/plot_utils.py @@ -935,6 +935,9 @@ def set_axis_radec(self, center: str | None = None, center = self.center if center is None: center = '00h00m00s 00d00m00s' + if len(csplit := center.split()) == 3: + center = f'{csplit[1]} {csplit[2]}' + print(center) dec = np.radians(coord2xy(center)[1]) def get_sec(x, i):