Commit 4f80f683 authored by Jeroen Vreeken's avatar Jeroen Vreeken Committed by Michel Roelofs
Browse files

Source obtained from Jeroen

parents
This diff is collapsed.
include build.mk
CFLAGS= -Wall -O3 \
-I. \
-Icontroller \
-Iutils \
-Itrace \
-Idt_azimuth -Idt_elevation -Iec -Ishell -Ilog
LDFLAGS= -lpthread -lrt -lm -ldl -Wl,-E
CFLAGS_SIM=-DUSE_AZ_SIM -DUSE_EL_SIM
ARCHIVES= \
dt_azimuth/dt_azimuth.a \
dt_elevation/dt_elevation.a \
controller/controller.a \
log/log.a \
ec/ec.a \
shell/shell.a \
trace/trace.a \
utils/utils.a
dt_ctrl_sim_LDFLAGS=`controller/block_list.sh dt_azimuth/dt_azimuth.a dt_elevation/dt_elevation.a controller/controller.a`
dt_ctrl_LDFLAGS=$(dt_ctrl_sim_LDFLAGS) `controller/block_list.sh ec/ec.a`
all: trace/trace.a utils/utils.a console \
dt_ctrl dt_ctrl_sim \
trace_list trace_view \
test
dt_ctrl: dt_ctrl.o $(ARCHIVES)
dt_ctrl_sim: dt_ctrl_sim.o $(ARCHIVES)
dt_ctrl_sim.o: dt_ctrl.c
@echo "COMPILE: dt_ctrl.c (OUTPUT: dt_ctrl_sim.o)"
@$(CC) $(CFLAGS) $(CFLAGS_SIM) dt_ctrl.c -c -o dt_ctrl_sim.o
trace_list: trace_list.o $(ARCHIVES)
trace_view: trace_view.o $(ARCHIVES)
%.a:
@echo " SUBDIR: $(@D)"
@$(MAKE) -C $(@D)
ec/ec.a: log/log.a shell/shell.a
trace/trace.a: utils/utils.a
winrotor-usb:
@echo " SUBDIR: $@"
@$(MAKE) -C winrotor-usb
test:
@echo " SUBDIR: $@"
@$(MAKE) -C test
console:
@echo " SUBDIR: $@"
@$(MAKE) -C console
.PHONY: utils trace console winrotor-usb test
clean:
rm -f *.o *.d
rm -f dt_az dt_az_ctrl \
command_shell \
trace_list trace_view \
dt_ctrl \
dt_ctrl_sim
$(MAKE) -C controller clean
$(MAKE) -C console clean
$(MAKE) -C utils clean
$(MAKE) -C trace clean
$(MAKE) -C dt_azimuth clean
$(MAKE) -C dt_elevation clean
$(MAKE) -C winrotor-usb clean
$(MAKE) -C ec clean
$(MAKE) -C test clean
$(MAKE) -C shell clean
$(MAKE) -C log clean
DT controller software
The current implementation uses pthreads for threading.
It is assumed that 32bit load and stores are atomic.
Directories:
controller Basic controller functions & blocks.
utils Helper functions (e.g. TCP and config file reading)
dt_azimuth DT Azimuth (real & model)
dt_elevation DT Elevation (real & model)
ec Ethercat implementation
shell Code for command shell
console Console programs for commanding a controller
winrotor-usb Winrotor-USB control block
Programs:
dt_ctrl Controller software for the complete DT
trace_list Connects to controller and prints list of available
traces.
trace_view Live view of a trace using gnuplot.
trace_dump Dump trace data to stdout.
trace_fft View the spectrum of a trace.
command_shell Command line tool to send commands to a setpoint
generator.
console_easycomm Control (and view) the controller DT with easycomm.
console_joystick Control the DT with a joystick.
console_moontracker Track the moon.
spg_list List all available setpoint generators
# Some make rules to make output pretty....
# default ARFLAGS also has 'v', but we don't want it to be verbose.
ARFLAGS= -r
# make sure libs from /usr/local/lib are found
VPATH= /lib64 /usr/lib64 /usr/local/lib64 /lib /usr/lib /usr/local/lib
%.o : %.c
@echo " CC $<"
@$(CC) -MD $(CFLAGS) -c $<
%: %.o
@echo " LD $@"
@$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) $($@_LDFLAGS) -o $@
(%): %
@echo " AR $< in $@"
@$(AR) $(ARFLAGS) $@ $<
%.tab.c %.tab.h: %.y
@echo "BISON $<"
@bison -d $<
%.yy.c: %.l %.tab.h
@echo " FLEX $<"
@flex -o $@ $<
# il2c: instruction list 2 c 'compiler'
%.c %.h: %.il
@echo " IL2C $<"
@$(IL2C) $<
# dot -> pdf
%.pdf: %.dot
@echo " DOT $<"
@dot $< -o $@ -Tpdf
-include $(SRCS:.c=.d)
include ../build.mk
CFLAGS= -Wall -g -I../utils -I../controller -Iaalib -Ipredictlib -I../trace
ARCHIVES= ../utils/utils.a aalib/aalib.a predictlib/predictlib.a ../trace/trace.a
all: aalib predictlib\
setpoint.o console_easycomm console_joystick command_shell \
spg_list spg_log_parser \
console_moontracker \
console_httptrace console_httpline console_httpline_install \
trace_proxy trace_line_install trace_log \
console_j2000tracker console_j2000tracer console_j2000_indi \
log_proxy spg_auth console_idle console_zenith \
console_suntracker console_azel console_manual \
console_weather \
await_controller \
console_sattracker
await_controller: await_controller.o $(ARCHIVES)
console_easycomm: console_easycomm.o setpoint.o $(ARCHIVES)
console_httpline: console_httpline.o $(ARCHIVES)
console_httpline_install: console_httpline
@echo " CP console_httpline"
@cp console_httpline ../htdocs
console_httptrace: console_httptrace.o $(ARCHIVES)
console_joystick: console_joystick.o setpoint.o $(ARCHIVES)
command_shell: command_shell.o setpoint.o $(ARCHIVES)
spg_list: spg_list.o $(ARCHIVES)
spg_log_parser: spg_log_parser.o $(ARCHIVES)
console_moontracker: console_moontracker.o setpoint.o $(ARCHIVES) -lm -lpthread
console_j2000tracker: console_j2000tracker.o setpoint.o $(ARCHIVES) -lnova -lpthread -lm
console_j2000tracer: console_j2000tracer.o $(ARCHIVES) -lnova
console_j2000_indi: console_j2000_indi.o $(ARCHIVES) -lindi -lindidriver -lm
console_azel: console_azel.o setpoint.o $(ARCHIVES)
console_manual: console_manual.o setpoint.o $(ARCHIVES)
console_suntracker: console_suntracker.o setpoint.o $(ARCHIVES) -lm -lpthread
console_idle: console_idle.o setpoint.o $(ARCHIVES)
console_weather: console_weather.o $(ARCHIVES) -lpthread
console_zenith: console_zenith.o setpoint.o $(ARCHIVES)
trace_proxy: trace_proxy.o $(ARCHIVES)
trace_line: trace_line.o $(ARCHIVES)
trace_line_install: trace_line
@echo " CP trace_line"
@cp trace_line ../htdocs
trace_log: trace_log.o $(ARCHIVES)
log_proxy: log_proxy.o $(ARCHIVES)
spg_auth: spg_auth.o setpoint.o $(ARCHIVES)
console_sattracker: console_sattracker.o setpoint.o $(ARCHIVES) -lpthread -lnova -lm
aalib:
@$(MAKE) -C aalib
doc:
@$(MAKE) -C doc
predictlib:
@$(MAKE) -C predictlib
.PHONY: aalib doc predictlib
clean:
rm -f *.o *.d
rm -f \
command_shell \
console_joystick \
console_easycomm \
spg_list \
console_httptrace \
console_httpline \
trace_proxy \
console_manual \
console_moontracker \
console_suntracker \
console_j2000tracker \
console_j2000tracer \
console_j2000_indi \
console_azel \
console_idle \
console_sattracker \
console_weather \
console_zenith \
trace_proxy \
trace_line \
trace_log \
log_proxy \
spg_auth \
spg_log_parser \
await_controller
$(MAKE) -C aalib clean
$(MAKE) -C doc clean
$(MAKE) -C predictlib clean
This is a copy of Astronomical Almanac 5.6
Positions are hardcoded for the Dwingeloo Radio Telescope.
- Jeroen Vreeken (pe1rxq@amsat.org)
<?xml version="1.0" encoding="Windows-1252" ?>
<XML_DIZ_INFO>
<MASTER_PAD_VERSION_INFO>
<MASTER_PAD_VERSION>1.15</MASTER_PAD_VERSION>
<MASTER_PAD_INFO>Portable Application Description, or PAD for short, is a data set that is used by shareware authors to disseminate information to anyone interested in their software products. To find out more go to http://www.asp-shareware.org/pad</MASTER_PAD_INFO>
</MASTER_PAD_VERSION_INFO>
<Company_Info>
<Company_Name>Stephen L. Moshier</Company_Name>
<Address_1>30 Frost Street</Address_1>
<Address_2 />
<City_Town>Cambridge</City_Town>
<State_Province>MA</State_Province>
<Zip_Postal_Code>02140</Zip_Postal_Code>
<Country>USA</Country>
<Company_WebSite_URL>http://www.moshier.net/index.html</Company_WebSite_URL>
<Contact_Info>
<Author_First_Name>Steve</Author_First_Name>
<Author_Last_Name>Moshier</Author_Last_Name>
<Author_Email>steve@moshier.net</Author_Email>
<Contact_First_Name />
<Contact_Last_Name />
<Contact_Email />
</Contact_Info>
<Support_Info>
<Sales_Email />
<Support_Email />
<General_Email />
<Sales_Phone />
<Support_Phone />
<General_Phone />
<Fax_Phone />
</Support_Info>
</Company_Info>
<Program_Info>
<Program_Name>aa-55.zip</Program_Name>
<Program_Version>5.5</Program_Version>
<Program_Release_Month>01</Program_Release_Month>
<Program_Release_Day>27</Program_Release_Day>
<Program_Release_Year>2002</Program_Release_Year>
<Program_Cost_Dollars>0</Program_Cost_Dollars>
<Program_Cost_Other_Code />
<Program_Cost_Other />
<Program_Type>Freeware</Program_Type>
<Program_Release_Status>Minor Update</Program_Release_Status>
<Program_Install_Support>Install and Uninstall</Program_Install_Support>
<Program_OS_Support>Win 3.1x,Win95,Win98,WinME,WinNT 3.x,WinNT 4.x,WinXP,Windows2000,Unix,Linux,MS-DOS,OS/2,OS/2 Warp,OpenVMS</Program_OS_Support>
<Program_Language />
<File_Info>
<Filename_Versioned>aa-55.zip</Filename_Versioned>
<Filename_Previous>aa-54.zip</Filename_Previous>
<Filename_Generic>aa.zip</Filename_Generic>
<Filename_Long>aa.zip</Filename_Long>
<File_Size_Bytes>382591</File_Size_Bytes>
<File_Size_K>374</File_Size_K>
<File_Size_MB>0.37</File_Size_MB>
</File_Info>
<Expire_Info>
<Has_Expire_Info>N</Has_Expire_Info>
<Expire_Count />
<Expire_Based_On>Days</Expire_Based_On>
<Expire_Other_Info />
<Expire_Month />
<Expire_Day />
<Expire_Year />
</Expire_Info>
<Program_Change_Info>Improved rise and set time calculation</Program_Change_Info>
<Program_Specific_Category>Education</Program_Specific_Category>
<Program_Categories>astronomy</Program_Categories>
<Program_System_Requirements />
<Includes_JAVA_VM>N</Includes_JAVA_VM>
<Includes_VB_Runtime>N</Includes_VB_Runtime>
<Includes_DirectX>N</Includes_DirectX>
</Program_Info>
<Program_Descriptions>
<English>
<Keywords>ephemerides,planets,moon,sun,sunrise,moonrise,moon phase</Keywords>
<Char_Desc_45>Self-contained ephemeris calculator, C source</Char_Desc_45>
<Char_Desc_80 />
<Char_Desc_250 />
<Char_Desc_450 />
<Char_Desc_2000>This program computes the orbital positions of planetary bodies and performs rigorous coordinate reductions to apparent geocentric and topocentric place (local altitude and azimuth).
It also reduces star catalogue positions given in either the FK4 or FK5 system. The program follows the rigorous algorithms for reduction of celestial coordinates exactly as laid out in current editions of the Astronomical Almanac. Source code listings in C language are supplied.
Command input to aa.exe is by single line responses to programmed prompts. The program requests date, time, and which of a menu of things to do. Menu item 0 is the Sun, 3 is the
Moon. The other values 1-9 are planets; 99 opens an orbit catalogue file; 88 opens a star catalogue.
Several methods of calculating the positions of the planets have been provided for in the program source code. These range in accuracy from a built-in computation using perturbation formulae to a solution from precise orbital elements that you supply from
an almanac. The program uses as a default a set of trigonometric expansions for the position of the Earth and planets. These have been adjusted to match the Jet Propulsion Laboratory&apos;s DE404 Long Ephemeris (1995) with a precision ranging from about 0.1&quot; for the Earth to 1&quot; for Pluto. The adjustment was carried out on the interval from 3000 B.C. to 3000 A.D. for the outer planets. The adjustment for the inner planets is strictly valid only from 1350 B.C. to 3000 A.D., but may be used to 3000 B.C. with some loss of precision. The Moon&apos;s position is calculated by a modified version of the lunar theory of Chapront-Touze&apos; and Chapront. This has a precision of 0.5 arc second relative to DE404 for all dates between 1369 B.C. and 3000 A.D.
Build scripts for the program are supplied for the following software systems: Microsoft Visual C, 16-bit MSC 6, Borland C (4, 5, turbo), VMS, and generic unix or linux.</Char_Desc_2000>
</English>
</Program_Descriptions>
<Web_Info>
<Application_URLs>
<Application_Info_URL>http://www.moshier.net/aadoc.html</Application_Info_URL>
<Application_Order_URL />
<Application_Screenshot_URL />
<Application_Icon_URL />
<Application_XML_File_URL />
</Application_URLs>
<Download_URLs>
<Primary_Download_URL>http://www.moshier.net/aa-55.zip</Primary_Download_URL>
<Secondary_Download_URL />
<Additional_Download_URL_1 />
<Additional_Download_URL_2 />
</Download_URLs>
</Web_Info>
<Permissions>
<Distribution_Permissions />
<EULA />
</Permissions>
</XML_DIZ_INFO>
This diff is collapsed.
/* This program calculates orbits of planetary bodies and reduces
* the coordinates of planets or stars to geocentric and topocentric
* place. An effort has been made to use rigorous methods throughout.
*
* References to AA page numbers are to The Astronomical Almanac, 1986
* published by the U.S. Government Printing Office.
*
* The program uses as a default the PLAN404 approximations to DE404
* for planetary positions.
*
* Warning! Your atan2() function may not work the same as the one
* assumed by this program.
* atan2(x,y) computes atan(y/x), result between 0 and 2pi.
*
* S. L. Moshier, November, 1987
*/
#include <time.h>
#include <stdio.h>
#include <unistd.h>
extern double g_az;
extern double g_el;
/* Conversion factors between degrees and radians */
double DTR = 1.7453292519943295769e-2;
double RTD = 5.7295779513082320877e1;
double RTS = 2.0626480624709635516e5; /* arc seconds per radian */
double STR = 4.8481368110953599359e-6; /* radians per arc second */
double PI = 3.14159265358979323846;
extern double PI;
/* Standard epochs. Note Julian epochs (J) are measured in
* years of 365.25 days.
*/
double J2000 = 2451545.0; /* 2000 January 1.5 */
double B1950 = 2433282.423; /* 1950 January 0.923 Besselian epoch */
double J1900 = 2415020.0; /* 1900 January 0, 12h UT */
/* Data structures containing orbital elements of
* objects that orbit the sun. See kep.h for the definition.
*/
#include "kep.h"
#ifdef __BORLANDC__
#include <stdlib.h>
#endif
#ifdef _MSC_VER
#if _MSC_VER >= 1000
#include <stdlib.h>
#include <string.h>
#endif
#endif
/* approximate motion of right ascension and declination
* of object, in radians per day
*/
double FAR dradt;
double FAR ddecdt;
/* Space for star description read from a disc file.
*/
struct star fstar;
/* Space for orbit read from a disc file. Entering 99 for the
* planet number yields a prompt for a file name containg ASCII
* strings specifying the elements.
*/
struct orbit forbit;
/* Orbits for each planet. The indicated orbital elements are
* not actually used, since the positions are are now calculated
* from a formula. Magnitude and semidiameter are still used.
*/
/* Programs to compute perturbations. */
extern struct plantbl mer404, ven404, ear404, mar404;
extern struct plantbl jup404, sat404, ura404, nep404, plu404;
struct orbit mercury = {
"Mercury ",
2446800.5, /* January 5.0, 1987 */
7.0048,
48.177,
29.074,
0.387098,
4.09236,
0.205628,
198.7199,
2446800.5,
-0.42,
3.36,
&mer404,
0.0,
0.0,
0.0
};
struct orbit venus = {
"Venus ",
2446800.5,
3.3946,
76.561,
54.889,
0.723329,
1.60214,
0.006757,
9.0369,
2446800.5,
/* Note the calculated apparent visual magnitude for Venus
* is not very accurate.
*/
-4.40,
8.34,
&ven404,
0.0,
0.0,
0.0
};
/* Fixed numerical values will be used for earth if read in from a file
* named earth.orb. See kfiles.c, kep.h.
*/
struct orbit earth = {
"Earth ",
2446800.5,
0.0,
0.0,
102.884,
0.999999,
0.985611,
0.016713,
1.1791,
2446800.5,
-3.86,
0.0,
&ear404,
0.0,
0.0,
0.0
};
extern struct orbit earth;
struct orbit mars = {
"Mars ",
2446800.5,
1.8498,
49.457,
286.343,
1.523710,
0.524023,
0.093472,
53.1893,
2446800.5,
-1.52,
4.68,
&mar404,
0.0,
0.0,
0.0
};
struct orbit jupiter = {
"Jupiter ",
2446800.5,
1.3051,
100.358,
275.129,
5.20265,
0.0830948,
0.048100,
344.5086,
2446800.5,
-9.40,
98.44,
&jup404,
0.0,
0.0,
0.0
};
struct orbit saturn = {
"Saturn ",
2446800.5,
2.4858,
113.555,
337.969,
9.54050,
0.0334510,
0.052786,
159.6327,
2446800.5,
-8.88,
82.73,
&sat404,
0.0,
0.0,
0.0
};
struct orbit uranus = {
"Uranus ",
2446800.5,
0.7738,
73.994,
98.746,
19.2233,
0.0116943,
0.045682,
84.8516,
2446800.5,
-7.19,
35.02,
&ura404,
0.0,
0.0,
0.0
};
struct orbit neptune = {
"Neptune ",
2446800.5,
1.7697,
131.677,
250.623,
30.1631,
0.00594978,
0.009019,
254.2568,
2446800.5,
-6.87,