[AstroPy] get_moon ... and the phase

Eric Jensen ejensen1 at swarthmore.edu
Fri Nov 29 12:09:21 EST 2019


Hi Tapio, 

Here’s how I handled this in some of my code: 

# Moon illumination formula from Meeus, “Astronomical
# Algorithms".  Formulae 46.1 and 46.2 in the 1991 edition,
# using the approximation cos(psi) \approx -cos(i).  Error
# should be no more than 0.0014 (p. 316).

moon_illum =  0.5 * (1. - sin(dec_sun)*sin(dec_moon) -
				 cos(dec_sun)*cos(dec_moon)*
				 cos(ra_sun - ra_moon))

That gives the percent illumination of the moon, between 0 and 1. 

If you can get the RA and Dec of the sun and moon, and the above precision is good enough for your purposes, this is a simple way to do it. 

Eric



> On Nov 29, 2019, at 7:38 AM, Tapio Pursimo <tpursimo at not.iac.es> wrote:
> 
> 
> Hello,
> 
> Can anybody help me how to get the moon phase using astropy?
> I can get the coordinates using get_moon, but the phase is apparently 
> missing.
> I would not like to use/install "ephem" nor "astroplan".
> 
> Best regards,
> 
> Tapio Pursimo
> 
> _______________________________________________
> AstroPy mailing list
> AstroPy at python.org
> https://mail.python.org/mailman/listinfo/astropy

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3952 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/astropy/attachments/20191129/50581571/attachment.bin>


More information about the AstroPy mailing list