Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 08:49 03 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : MMX - lunar occultation of a star

Author Message
cdeagle
Senior Member

Joined: 22/06/2014
Location: United States
Posts: 261
Posted: 02:11am 24 Jul 2017
Copy link to clipboard 
Print this post

This post describes a MMBASIC program for the MicroMite MMX, Raspberry Pi and DOS platforms which can be used to predict occultations of a star by the Moon. A lunar occultation occurs whenever the Moon moves across the location of another celestial object.

Here is a typical user interaction with the program, star_occult.bas, and the results provided.

lunar occultation of a star
===========================

Spica


please input the calendar date

(month [1 - 12], day [1 - 31], year [yyyy])
< for example, october 21, 1986 is input as 10,21,1986 >
< b.c. dates are negative, a.d. dates are positive >
< the day of the month may also include a decimal part >

? 2,1,1987

please input the geographic latitude of the observer
(degrees [-90 to +90], minutes [0 - 60], seconds [0 - 60])
(north latitudes are positive, south latitudes are negative)
? 40,0,0

please input the geographic longitude of the observer
(degrees [0 - 360], minutes [0 - 60], seconds [0 - 60])
(east longitude is positive, west longitude is negative)
? -105,0,0

please input the altitude of the observer (meters)
(positive above sea level, negative below sea level)
? 0

please input the number of days to simulate
? 30

searching for occultation conditions ...


begin occultation conditions
----------------------------

calendar date February 18 1987

utc time 12 hours 26 minutes 13.32 seconds

utc julian day 2446845.01820969

topocentric coordinates

lunar azimuth angle 213 deg 43 min 59.35 sec

lunar elevation angle 32 deg 45 min 24.36 sec

lunar phase 79.27


end occultation conditions
--------------------------

calendar date February 18 1987

utc time 13 hours 15 minutes 56.89 seconds

utc julian day 2446845.05274173

topocentric coordinates

lunar azimuth angle 225 deg 34 min 30.72 sec

lunar elevation angle 26 deg 37 min 43.62 sec

lunar phase 78.97


event duration 0 hours 49 minutes 43.57 seconds


The celestial coordinates of the star of interest are defined by the user in a subroutine called star_data. The following illustrates the coordinates for the star Spica. Note that the value for the star's declination in degrees is input as a string. This allows the software to compute the correct "sign" for declination.



sub star_data

' star coordinates subroutine

'''''''''''''''''''''''''''''

local rasc_hr, rasc_min, rasc_sec

local decl_deg$ as string, decl_min, decl_sec

local decl.deg

' star name

star_name$ = "Spica"

' j2000 right ascension (hours, minutes, seconds)

rasc_hr = 13.0
rasc_min = 25.0
rasc_sec = 11.587.0

' j2000 right ascension (radians)

rasc_star = (15.0 * dtr) * (rasc_hr + rasc_min / 60.0 + rasc_sec / 3600.0)

' j2000 declination (degrees, minutes, seconds)
' (note: input declination in degrees as a string)

decl_deg$ = "-11.0"
decl_min = 9.0
decl_sec = 40.71

decl.deg = val(decl_deg$)

' j2000 declination (radians)

if (left$(decl_deg$, 1) = "-" and decl.deg = 0.0) then

decl_star = -dtr * (decl_min / 60.0 + decl_sec / 3600.0)

elseif (decl.deg = 0.0) then

decl_star = dtr * (decl_min / 60.0 + decl_sec / 3600.0)

else

decl_star = dtr * sgn(decl.deg) * (abs(decl.deg) + decl_min / 60.0 + decl_sec / 3600.0)

end if

end sub



Here is a zip archive of the MMBASIC source code, the PDF document for the MATLAB version and several data files for other stars.

2017-07-24_120438_star_occult.zip
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024