libTheSky
Routines to compute sky positions of Sun, Moon, planets and more
All Namespaces Files Functions Variables Pages
thesky_moon Module Reference

Procedures for the Moon. More...

Functions/Subroutines

subroutine elp82b_lbr (tjj, ll, bb, rr)
 Calculate the apparent geocentric ecliptical position of the Moon, using the Lunar Solution ELP 2000-82B.
 
subroutine elp_mpp02_lbr (jd, mode, lon, lat, rad, precess)
 Compute the spherical lunar coordinates using the ELP2000/MPP02 lunar theory in the dynamical mean ecliptic and equinox of J2000.
 
subroutine elp_mpp02_xyz (jd, mode, xyz, vxyz, ierr)
 Compute the rectangular lunar coordinates using the ELP/MPP02 lunar theory in the dynamical mean ecliptic and equinox of J2000.
 
subroutine moonpos_la (jd, calc, nt)
 Quick, lower-accuracy lunar coordinates; ~600x faster than ELP.
 
real(double) function moonmagn (pa, delta)
 Calculate the magnitude of the Moon.
 

Detailed Description

Procedures for the Moon.

Function/Subroutine Documentation

◆ elp82b_lbr()

subroutine thesky_moon::elp82b_lbr ( real(double), intent(in) tjj,
real(double), intent(out) ll,
real(double), intent(out) bb,
real(double), intent(out) rr )

Calculate the apparent geocentric ecliptical position of the Moon, using the Lunar Solution ELP 2000-82B.

Parameters
tjjTime for calculation in Julian millenia after 2000.0
llApparent geocentric ecliptical longitude (output)
bbApparent geocentric ecliptical latitude (output)
rrApparent geocentric distance (output)
Note
  • This is supposed to be the ELP2000-85 version, with the corrections from the 1998 paper (mean arguments up to t^4, etc,). However, the accuracy seems to be less than promised for historical calculations (0.1° rather than 0.01° for CE 0). The subroutine elp_mpp02_lbr() below is supposed to give better results (but then again, so is this one).
  • Differences compared to ELP-MPP02 (ELP82b minus ELP-MPP02):
    • longitude: +0.00001° in CE 1975, ~+0.11° in CE 0/4000 and ~+0.65° in 3000 BCE (systematically drifting to positive values)
      • replacing w(1,2) = -5.8883 with -6.8084 removes the systematic drift to +0.65° @3000 BCE; (see data.f90 / readmoondata()) the drift now oscillates around +-0.012°;
    • latitude: ~0.00000° in CE 1990, ~+/-0.01° in CE 0/4000 and +/- ~0.06° (now ~0.006°) in 3000 BCE
    • distance: +/-0.03 km in CE 2000, +/- ~30 km in CE 0/4000 and +/- ~300 km (now ~20km) in 3000 BCE
See also

Definition at line 55 of file moon_position.f90.

References thesky_moondata::a0, thesky_moondata::ath, thesky_moondata::nrang, thesky_moondata::nterm, thesky_moondata::pc1, thesky_moondata::pc2, thesky_moondata::pc3, thesky_moondata::per1, thesky_moondata::per2, thesky_moondata::per3, thesky_moondata::t, and thesky_moondata::w.

Referenced by thesky_planets::planet_position().

◆ elp_mpp02_lbr()

subroutine thesky_moon::elp_mpp02_lbr ( real(double), intent(in) jd,
integer, intent(in) mode,
real(double), intent(out) lon,
real(double), intent(out) lat,
real(double), intent(out) rad,
logical, intent(in), optional precess )

Compute the spherical lunar coordinates using the ELP2000/MPP02 lunar theory in the dynamical mean ecliptic and equinox of J2000.

Parameters
jdJulian day to compute Moon position for
modeIndex of the corrections to the constants: 0-Fit to LLR observations, 1-Fit to DE405 1950-2060 (historical)
lonEcliptic longitude (rad) (output)
latEcliptic latitude (rad) (output)
radDistance (AU) (output)
precessApply precession (input, optional, default=.true.)
Note
See Lunar Solution ELP 2000/MPP02, Chapront & Francou (2002): ftp://cyrano-se.obspm.fr/pub/2_lunar_solutions/2_elpmpp02/

Definition at line 188 of file moon_position.f90.

References elp_mpp02_xyz(), and thesky_coordinates::precess_ecl().

Referenced by thesky_planets::planet_position().

Here is the call graph for this function:

◆ elp_mpp02_xyz()

subroutine thesky_moon::elp_mpp02_xyz ( real(double), intent(in) jd,
integer, intent(in) mode,
real(double), dimension(3), intent(out) xyz,
real(double), dimension(3), intent(out) vxyz,
integer, intent(out) ierr )

Compute the rectangular lunar coordinates using the ELP/MPP02 lunar theory in the dynamical mean ecliptic and equinox of J2000.

Parameters
jdJulian day to compute Moon position for
modeIndex of the corrections to the constants: 0-Fit to LLR observations, 1-Fit to DE405 1950-2060 (historical)
xyzGeocentric rectangular coordinates: (output)
  • xyz(1) : Position X (km)
  • xyz(2) : Position Y (km)
  • xyz(3) : Position Z (km)
vxyzGeocentric rectangular velocities: (output)
  • vxyz(1) : Velocity X' (km/day)
  • vxyz(2) : Velocity Y' (km/day)
  • vxyz(3) : Velocity Z' (km/day)
ierrFile error index - ierr=0: no error, ierr=1: file error (output)
Note
  • The subroutine elp_mpp02() uses two modules:
    • elp_mpp02_constants: Constants of the solution ELP/MPP02 (input),
    • elp_mpp02_series: Series of the solution ELP/MPP02 (input).
  • The nominal values of some constants have to be corrected. There are two sets of corrections, which can be selected using the parameter 'mode' (used in elp_mpp02_initialise()).
    • mode=0, the constants are fitted to LLR observations provided from 1970 to 2001; it is the default value;
    • mode=1, the constants are fitted to DE405 ephemeris over one century (1950-2060); the lunar angles W1, W2, W3 receive also additive corrections to the secular coefficients ('historical mode'). When the mode is changed, the constants will be reinitialised and the data file reread.
  • Solutions (discussed) in the paper:
    • ELP (original):
      • ELP2000-82: using VSOP82 (1983)
      • ELP2000-85: new mean lunar arguments, higher truncation level, longer time range (1988)
      • ELP2000-82B, here called "ELP": ELP2000-82, using mean lunar arguments from ELP2000-85 (19??)
    • ELP/MPP01: using latest planetary perturbations from MPP01 and VSOP2000, but simpler than MPP01
    • ELP/MPP02: ELP/MPP01, but for some arguments back to ELP + different selection of perturbations + lower truncation. Good fit with DE 405 in [1950,2060]
    • ELP/MPP02*: improved secular arguments, better long-term comparison to DE 405/406 [-3000,2500]
    • ELP/MPP02(LLR): ELP/MPP02(?), optimised for lunar ranging since 1970
    • ELPa: ELP + few Poisson terms (tested in the current study only?)
    • ELPa: ELPa + better secular arguments (as in ELP/MPP02*)
  • It is not entirely clear which version is given below, but we can hope it is ELP/MPP02*. However, the subroutine elp82b_lbr() above is known to underperform (by a factor of 10) in accuracy.

Definition at line 266 of file moon_position.f90.

References thesky_data::elp_mpp02_initialise_and_read_files().

Referenced by elp_mpp02_lbr().

Here is the call graph for this function:

◆ moonmagn()

real(double) function thesky_moon::moonmagn ( real(double), intent(in) pa,
real(double), intent(in) delta )

Calculate the magnitude of the Moon.

Parameters
paPhase angle (rad)
deltaGeocentric(?) distance (AU)
Return values
moonmagnThe magnitude of the Moon
See also

Definition at line 629 of file moon_position.f90.

References moonmagn().

Referenced by thesky_visibility::limmag_skybrightness(), moonmagn(), moonpos_la(), and thesky_planets::planet_position().

Here is the call graph for this function:

◆ moonpos_la()

subroutine thesky_moon::moonpos_la ( real(double), intent(in) jd,
integer, intent(in) calc,
integer, intent(in) nt )

Quick, lower-accuracy lunar coordinates; ~600x faster than ELP.

Parameters
jdJulian day for computation
calcCalculate: 1: l,b,r, 2: & ra,dec, 3: & gmst,agst, 4: & az,alt, nt: number of terms <=60
ntNumber of terms to use
See also
  • Meeus, Astronomical Algorithms, 1998, Ch. 22 and 47
  • Simon et al, A&A, 282, p.663 (1994)

Definition at line 434 of file moon_position.f90.

References thesky_datetime::calc_deltat(), thesky_datetime::calc_gmst(), thesky_coordinates::ecl_2_eq(), thesky_coordinates::eq2horiz(), thesky_local::lat0, thesky_local::lon0, thesky_planetdata::moonla_arg, thesky_planetdata::moonla_lrb, moonmagn(), thesky_planetdata::nplanpos, thesky_planetdata::planpos, and thesky_sun::sunpos_la().

Referenced by thesky_planets::planet_position_la().

Here is the call graph for this function: