Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sdc
kis_tools
Commits
fdca9e79
Commit
fdca9e79
authored
Feb 11, 2021
by
Carl Schaffer
Browse files
adding telescope to hpc tranformation function
parent
151c623a
Changes
1
Hide whitespace changes
Inline
Side-by-side
kis_tools/gris/util.py
View file @
fdca9e79
...
...
@@ -24,6 +24,7 @@ from astropy.coordinates import SkyCoord, GCRS, get_sun
from
astropy.io.fits.hdu.hdulist
import
fitsopen
as
fitsopen
from
sunpy.coordinates
import
Helioprojective
from
kis_tools.util.calculations
import
rotate_around_origin
from
kis_tools.util.constants
import
gregor_coords
from
kis_tools.util.util
import
gris_run_number
...
...
@@ -211,3 +212,23 @@ def gregor_parallactic_angle(time, hpc_x=None, hpc_y=None):
angle
=
gregor_observer
.
parallactic_angle
(
time
,
sun_coords
)
angle
=
angle
.
to
(
'degree'
).
value
return
angle
def
telescope_to_hpc
(
slitposx
=
None
,
slitposy
=
None
,
p0_angle
=
None
,
xcenter
=
None
,
ycenter
=
None
):
"""
Transform GRIS header coordinate data to HPC coordinates
Args:
slitposx: float SLITPOSX in arcsec
slitposy: float SLITPOSY in arcsec
p0_angle: float p0_angle in degrees
xcenter: float X_center in arcsec (stored in GDBS upon centering the telescope)
ycenter: float Y_center in arcsec (stored in GDBS upon centering the telescope)
Returns:
hpc_x, hpc_y tuple of helioprojective coordinates in arcseconds
"""
xi
=
slitposx
-
xcenter
yi
=
slitposy
-
ycenter
rotated
=
rotate_around_origin
((
xi
,
yi
),
np
.
radians
(
p0_angle
))
return
rotated
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment