A star's direction, color (from its B-V color index: Ballesteros' temperature, then Tanner Helland's temperature to RGB) and raw size (OpenFrames' SkySphere::StarToPoint).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | ra |
right ascension and declination (radians) |
||
| real(kind=wp), | intent(in) | :: | dec |
right ascension and declination (radians) |
||
| real(kind=wp), | intent(in) | :: | mag |
apparent magnitude and B-V color index |
||
| real(kind=wp), | intent(in) | :: | ci |
apparent magnitude and B-V color index |
||
| real(kind=wp), | intent(out) | :: | dir(3) |
unit vector |
||
| real(kind=wp), | intent(out) | :: | rgb(3) |
color (0 to 1) |
||
| real(kind=wp), | intent(out) | :: | size |
raw size (as raw_size) |
pure subroutine star_to_point(ra, dec, mag, ci, dir, rgb, size) real(wp), intent(in) :: ra, dec !! right ascension and declination (radians) real(wp), intent(in) :: mag, ci !! apparent magnitude and B-V color index real(wp), intent(out) :: dir(3) !! unit vector real(wp), intent(out) :: rgb(3) !! color (0 to 1) real(wp), intent(out) :: size !! raw size (as raw_size) real(wp) :: t dir = [cos(ra) * cos(dec), sin(ra) * cos(dec), sin(dec)] size = raw_size(mag) t = 0.01_wp * 4600.0_wp * (1.0_wp / (0.92_wp * ci + 1.7_wp) + 1.0_wp / (0.92_wp * ci + 0.62_wp)) if (t <= 66.0_wp) then rgb(1) = 255.0_wp rgb(2) = 99.4708025861_wp * log(t) - 161.1195681661_wp else rgb(1) = 329.698727446_wp * (t - 60.0_wp)**(-0.1332047592_wp) rgb(2) = 288.1221695283_wp * (t - 60.0_wp)**(-0.0755148492_wp) end if if (t >= 66.0_wp) then rgb(3) = 255.0_wp else if (t <= 19.0_wp) then rgb(3) = 0.0_wp else rgb(3) = 138.5177312231_wp * log(t - 10.0_wp) - 305.0447927307_wp end if rgb = max(0.0_wp, min(255.0_wp, rgb)) / 255.0_wp end subroutine star_to_point