Commit fdca9e79 authored by Carl Schaffer's avatar Carl Schaffer
Browse files

adding telescope to hpc tranformation function

parent 151c623a
......@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment