The unit vector of a direction on the sky from its right ascension (hours) and declination (degrees), as the stars' (star_to_point).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | ra |
right ascension (hours) |
||
| real(kind=wp), | intent(in) | :: | dec |
declination (degrees) |
pure function sky_direction(ra, dec) result(dir) real(wp), intent(in) :: ra !! right ascension (hours) real(wp), intent(in) :: dec !! declination (degrees) real(wp) :: dir(3) real(wp) :: a, d a = ra / 24.0_wp * 2.0_wp * pi d = dec * pi / 180.0_wp dir = [cos(a) * cos(d), sin(a) * cos(d), sin(d)] end function sky_direction