Skip to content
Erick Daniszewski edited this page Mar 4, 2014 · 2 revisions

Below is an outline of the files currently in the SRTN project with brief descriptions of functionality, as well as listing the functions which each file contains. This is intended as a means of organizing the code and making its functionality more visible, and is not the final version of the document. As change and updates to the source occur, changes to this list may occur as well.



GUI Interface

The GUI has buttons along the top. Below describes the functionality of these buttons.

--

clear

Clears the current time integral and data, starts back at zero.

--

stow

Indicates whether the antenna is stowed or not.

--

azel

Allows you to set the az el coordinates for the antenna.

--

npoint

Unclear. This seems to be involved in some kind of calibration, however.

--

beamsw

Unclear. The help file states that it is "beam switch".

--

freq

Allows the user to change the frequency at which to observe. The help file indicates that it is possible to pass in optional arguments to adjust the bandwidth as well.

--

offset

Allows user to specify an offset in the az el coordinates.

--

record

Prompts the user for a file name and records data to that file.

--

cmdfl

When selected, the program will run (or try to run) whatever commands exist in the cmd.txt file. This feature could be useful when developing automation for the program.

--

cal

Allows the user to calibrate the telescope, with different modes of calibration.

--

help

Brings up a help window that specifies some information on the buttons and commands accepted by the program.

--

exit

Exits the program.

--

Files and Functions


60-mcc.rules

udev rules that allows pci devices, HID devices, and libusb to work with non-root users


acml.h

allows calling ACML routines via their C or FORTRAN interfaces


amdfft.c

fast-fourrier transform for AMD architecture?

Functions:

	void fft_init(int n, float ream[], double *comm, int *info)
	void cfft(int n, float ream[], double *comm, int *info)

cal.c

code for calibration?

Functions:

	void cal(int mode)
	void polyfitr(int npoly, int nfreq, float ddata[], float wtt[], float dataout[])
	void MatrixInvert(int nsiz, long double aarr[], long double bbrr[])

cat.c

parses the cat file

Functions:

	int catfile(void)
	char *kmatch(char *buf, char *ct)

cmd.txt

a text file storing commands you want srtn to execute


cmdfl.c

logic to interpret and execute what is in cmd.txt

Functions:

	double cmdfile(void)

d1cons.h

declares constant values used throughout the code


d1glob.h

declares globals used in the code


d1proto.h

forward-declare many of the functions used often in the code


d1typ.h

declares the d1type struct


disp.c

has much of the logic that deals with the GUI

Functions:

	void button_clear_clicked(void)
	void button_stow_clicked(void)
	void button_azel_clicked(void)
	void hit_enter_azel(void)
	void button_freq_clicked(void)
	void hit_enter_freq(void)
	void button_offset_clicked(void)
	void hit_enter_offset(void)
	void button_npoint_clicked(void)
	void button_bsw_clicked(void)
	void button_record_clicked(void)
	void hit_enter_record(void)
	void record_tooltip(void)
	void button_cmdfl_clicked(void)
	void hit_enter_cmdfl(void)
	void button_cal_clicked(void)
	void hit_enter_cal(void)
	void button_help_clicked(void)
	void button_exit_clicked(void)
	gint button_press_event(GtkWidget * widget, GdkEventButton * event)
	void clearpaint(void)
	void cleararea(void)
	gint configure_event(GtkWidget * widget)
	gint expose_event(GtkWidget * widget, GdkEventExpose * event)
	void quit()

doindent2

script that appears to format/indent C code in a specified way


fftw2.c

handle fast-fourrier transforms?

Functions:

	void fft_init(int n, fftwf_plan * p, float **reamin0, float **reamout0)
	void fft_free(fftwf_plan * p, float **reamin0, float **reamout0)
	void cfft(fftwf_plan * p)

fftw3.h

fast-fourrier transform


four.c

unsure, might have something to do with angles..

Functions:

	void Four(double *fft_r, double *fft_i, int nn)

geom.c

appears to hold logic for spherical geometry

Functions:

	double vlsr(double time, double ra, double dec)
	void GalactictoRadec(double glat, double glon, double *ra, double *dec)
	void moonradec(double time, double *ra, double *dec)
	void precess(double rain, double decin, double *praout, double *pdecout, double epin, double epout)
	void radec_azel(double ha, double dec, double latt, double *azs, double *elevs)
	void sunradec(double time, double *ra, double *dec)
	void azel_to_radec(double time, double az, double el, double *ra, double *dec)

hproto.h

forward-declare functions involving the help menu


librtlsdr.c

library allowing us to interface with the dongle (and other kinds of dongles as well)


main.c

sets everything up, declares variables and checks variable/flag values to determine what to do, initialize/define GUI buttons and actions

Functions:

	int main(int argc, char *argv[])
	void zerospectra(int mode)
	void aver(void)
	double gauss(void)

map.c

seems to involve drawing of lines/points on the GUI, this may be what controls the 'map' in the bottom quadrant of the GUI

Functions:

	void scanplot(void)

outfile.c

writes data to a file

Functions:

	void outfile(void)

PCI-DAS4020-12.1.21.tgz

things for PCI boards?


pci-das4020.h

forward declare functions for PCI board usage


plot.c

plots something on the GUI (the graph(t) on the left, or the FFT?)

Functions:

	gint Repaint(void)

README

Gives some details on how the program works and should be set up


rtl-sdr.h

forward-declare functions from librtlsdr


rtl-sdr.rules

udev rules to allow external rtl-sdr devices to work with non-root users


rtl-sdr_export.h

something dealing with librtlsdr


rtlsdr_i2c.h

forward-declare things from librtlsdr


sport.c

controls antenna movement?

Functions:

	void azel(double az, double el)
	int rot2(double *az, double *el, int cmd, char *resp)

sportold.c

old version of sport.c (controls antenna movement)

Functions:

	void azel(double az, double el)

srt.cat

unclear, may be a config file of sorts


srt.hlp

help file which populates the help window of the GUI


srthelp.c

displays the help menu on the GUI and loads in the help info from srt.hlp

Functions:

	void display_help()
	void button_helphome_clicked(void)
	void button_helpmode_clicked(void)
	void button_helpnpoint_clicked(void)
	void button_helpbeamsw_clicked(void)
	void button_helpfreq_clicked(void)
	void button_helpoffset_clicked(void)
	void button_helprecord_clicked(void)
	void button_helpcmdfl_clicked(void)
	void button_helpcal_clicked(void)
	void button_helpexit_clicked(void)
	void load_help(char *command)
	void exit_help(void)

srtn

The program!


srtnmake

Script that compiles the program


time.c

an assortment of timing functions

Functions:

	double gst(double ttime)
	double tosecs(int yr, int day, int hr, int min, int sec)
	void toyrday(double secs, int *pyear, int *pday, int *phr, int *pmin, int *psec)
	int dayofyear(int year, int month, int day)
	char *to_date(int year, int day)
	char *to_radecp(double ra, double dec)
	double readclock(void)

tuner_r820t.c

the tuner driver


tuner_r820t.h

forward declare for the tuner driver


velspec.c

unclear, it interacts with the GUI, and seems to be plotting something, maybe the spectrum on the right hand side of GUI

Functions:

	void velspec()
	void button_psw_clicked(void)
	void vclearpaint(void)
	gint vconfigure_event(GtkWidget * widget)
	gint vexpose_event(GtkWidget * widget, GdkEventExpose * event)
	void vquit()
	void vplot(void)

vspectra.c

initializes the dongle and reads data in from it?

Functions:

	void vspectra(void)
	void Init_Device(int mode)

vspectra_fftw.c

initializes the dongle and reads data in from it?

Functions:

	void vspectra(void)
	void Init_Device(int mode)

vspectra_four.c

initializes the dongle and reads data in from it?

Functions:

	void vspectra(void)
	void Init_Device(int mode)

vspectra_pci.c

initializes the dongle/pci and reads data in from it?

Functions:

	void Init_Device(int mode)
	void vspectra(void)
	void DoOpenDevices()
	int get_pci(unsigned short value[], int count)

vspectra_pci_fftw.c

initializes the dongle/pci and reads data in from it?

Functions:

	void DoOpenDevices();
	void Init_Device(int mode)
	void vspectra(void)
	void DoOpenDevices()
	int get_pci(unsigned short value[], int count)
Clone this wiki locally