libTheSky
Routines to compute sky positions of Sun, Moon, planets and more
Loading...
Searching...
No Matches
stars.f90
Go to the documentation of this file.
1!> \file stars.f90 Star procedures for libTheSky
2
3
4! Copyright (c) 2002-2023 Marc van der Sluys - marc.vandersluys.nl
5!
6! This file is part of the libTheSky package,
7! see: http://libthesky.sf.net/
8!
9! This is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License
10! as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
11!
12! This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
13! warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14!
15! You should have received a copy of the GNU General Public License along with this code. If not, see
16! <http://www.gnu.org/licenses/>.
17
18
19!***********************************************************************************************************************************
20!> \brief Procedures for stars
21
23 implicit none
24 save
25
26contains
27
28 !*********************************************************************************************************************************
29 !> \brief Calculate the apparent position of selected bright stars close to the ecliptic, correcting for proper motion,
30 !! precession, nutation and aberration
31 !!
32 !! \param jd Julian day
33
34 subroutine calcstars(jd)
35 use sufr_kinds, only: double
36 use sufr_constants, only: pi, ras2r, jd2000
37
38 use thesky_nutation, only: nutation
42
43 implicit none
44 real(double), intent(in) :: jd
45
46 integer :: i
47 real(double) :: t,dpsi,eps0,deps,eps, ra(nstars),dec(nstars),pma(nstars),pmd(nstars)
48 real(double) :: da1(nstars),dd1(nstars),da2(nstars),dd2(nstars), l(nstars),b(nstars)
49
50
51 ! Data shared in module stardata - Add 11 Pleiades members: nstars 6->17:
52 starnames = (/'Pleiades ','Aldebaran ','Pollux ','Regulus ','Spica ','Antares ','16 Tau ','Electra ', &
53 '18 Tau ','Taygete ','Maia ','21 Tau ','22 Tau ','Merope ','Alcyone ','Atlas ','28 Tau '/)
54 starnamesnl = (/'de Pleiaden','Aldebaran ','Pollux ','Regulus ','Spica ','Antares ','16 Tau ', &
55 'Electra ','18 Tau ','Taygete ','Maia ','21 Tau ','22 Tau ','Merope ','Alcyone ', &
56 'Atlas ','28 Tau '/)
57 starmags = (/1.6,0.85,1.14,1.35,0.98,0.96,5.46,3.70,5.64,4.30,3.87,5.76,6.43,4.18,2.87,3.63,5.09/)
58 starrads = (/110.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0./)*60*ras2r
59 starcons = (/'Taurus ','Taurus ','Gemini ','Leo ','Virgo ','Scorpio','Taurus ','Taurus ','Taurus ','Taurus ','Taurus ', &
60 'Taurus ','Taurus ','Taurus ','Taurus ','Taurus ','Taurus '/)
61 starconsnl = (/'Stier ','Stier ','Tweelingen','Leeuw ','Maagd ','Schorpioen','Stier ','Stier ', &
62 'Stier ','Stier ','Stier ','Stier ','Stier ','Stier ','Stier ','Stier ','Stier '/)
63 starconsabr = (/'Tau','Tau','Gem','Leo','Vir','Sco','Tau','Tau','Tau','Tau','Tau','Tau','Tau','Tau','Tau','Tau','Tau'/)
64
65
66 ! RA & Dec in Rad, FK5 2000.0/2000.0:
67 ra = (/0.99047d0,1.2039309324d0,2.0303233601d0,2.6545229429d0,3.5133171901d0,4.3171054224d0,0.980890d0,0.981202d0,0.982453d0, &
68 0.982657d0,0.985355d0,0.985704d0,0.986322d0,0.987536d0,0.992591d0,0.999906d0,1.000015d0/)
69 dec = (/0.42092d0,0.2881416664d0,0.4891494426d0,0.2088671634d0,-0.1948018168d0,-0.4613254715d0,0.423931d0,0.420857d0, &
70 0.433525d0,0.427034d0,0.425298d0,0.428561d0,0.428095d0,0.417977d0,0.420712d0,0.419810d0,0.421264d0/)
71
72
73 ! Proper motion in mas/yr->rad/yr:
74 pma = (/0.,62.78,-625.69,-249.40,-42.50,-10.16,0.011,0.019,0.020,0.018,0.020,0.011,0.014,0.021,0.019,0.018,0.013/)/6.48d8*pi
75 pmd = (/0.,-189.35,-45.96,4.91,-31.73,-23.21,-0.046,-0.046,-0.047,-0.045,-0.046,-0.042,-0.044,-0.045,-0.046,-0.047,-0.050/) &
76 /6.48d8*pi
77
78
79 ! PM = change of epoch:
80 t = (jd-jd2000)/365.250d0 ! Julian years since 2000.0
81 ra = ra + pma*t
82 dec = dec + pmd*t
83
84
85 ! Precession = change of equinox (from J2000.0 to EoD):
86 do i=1,nstars
87 call precess_eq(jd2000,jd,ra(i),dec(i))
88 end do
89
90
91 ! Nutation, 1st order, Meeus Eq.23.1:
92 t = (jd-jd2000)/365250.d0 ! Julian millennia since 2000.0
93 call nutation(t, dpsi,eps0,deps)
94 eps = eps0 + deps
95
96 do i=1,nstars
97 da1(i) = (cos(eps0)+sin(eps0)*sin(ra(i))*tan(dec(i)))*dpsi - (cos(ra(i))*tan(dec(i)))*deps
98 dd1(i) = (sin(eps0)*cos(ra(i)))*dpsi + sin(ra(i))*deps
99 end do
100
101
102 ! Aberration in ra,dec:
103 do i=1,nstars
104 call aberration_eq(jd, ra(i),dec(i), da2(i), dd2(i), eps0=eps0)
105 end do
106
107 ra = ra + da1 + da2
108 dec = dec + dd1 + dd2
109
110
111 ! Calculate ecliptic coordinates l,b:
112 do i=1,nstars
113 call eq_2_ecl(ra(i),dec(i),eps,l(i),b(i))
114 end do
115
116
117 ! Transport to module stardata:
118 starra = ra
119 stardec = dec
120 starl = l
121 starb = b
122
123 end subroutine calcstars
124 !*********************************************************************************************************************************
125
126
127
128
129
130end module thesky_stars
131!***********************************************************************************************************************************
Procedures for coordinates.
subroutine eq_2_ecl(ra, dec, eps, l, b)
Convert (geocentric) spherical equatorial coordinates RA, Dec (and eps) to spherical ecliptical coord...
subroutine aberration_eq(jd, ra, dec, dra, ddec, eps0)
Correct equatorial coordinates for annual aberration - moderate accuracy, use for stars.
subroutine precess_eq(jd1, jd2, a1, d1)
Compute the precession of the equinoxes in equatorial coordinates, from jd1 to jd2.
Procedures for nutation.
Definition nutation.f90:24
subroutine nutation(t, dpsi, eps0, deps)
Calculate nutation - cheap routine from Meeus - as well as the mean obliquity of the ecliptic.
Definition nutation.f90:45
Star and basic constellation data.
Definition modules.f90:238
character, dimension(10) starconsnl
Definition modules.f90:248
real(double), dimension(nstars) starb
Definition modules.f90:246
real(double), dimension(nstars) starra
Definition modules.f90:246
character, dimension(10) starcons
Definition modules.f90:248
real, dimension(nstars) starmags
Definition modules.f90:247
real, dimension(nstars) starrads
Definition modules.f90:247
real(double), dimension(nstars) starl
Definition modules.f90:246
real(double), dimension(nstars) stardec
Definition modules.f90:246
character, dimension(10) starnames
Definition modules.f90:248
character, dimension(3) starconsabr
Definition modules.f90:248
integer, parameter nstars
Definition modules.f90:245
character, dimension(11) starnamesnl
Definition modules.f90:248
Procedures for stars.
Definition stars.f90:22
subroutine calcstars(jd)
Calculate the apparent position of selected bright stars close to the ecliptic, correcting for proper...
Definition stars.f90:35