File: amass_test.cpp

package info (click to toggle)
c-munipack 2.1.38-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 55,888 kB
  • sloc: ansic: 200,762; cpp: 106,123; lex: 9,035; yacc: 4,916; sh: 4,074; fortran: 2,613; xml: 2,105; python: 1,182; makefile: 546; perl: 104
file content (45 lines) | stat: -rw-r--r-- 1,490 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/**************************************************************

amass_test.c (C-Munipack project)
Air-mass coeficient test
Copyright (C) 2003 David Motl, dmotl@volny.cz

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

**************************************************************/

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <cmunipack.h>

/* Testing tool for read-all files */
int amass_test(void)
{
	int res;
	double jd, x, y, lon, lat, ra, dec;

	/* Apply to given JD */
	jd  = 2454123.853642;
	lon = 16 + 35/60.0 + 02/3600.0;
	lat = 49 + 12/60.0 + 17/3600.0;
	ra  = 23 + 04/60.0 + 52/3600.0;
	dec = 59 + 22/60.0 + 57/3600.0;
	res = cmpack_airmass(jd, ra, dec, lon, lat, &x, &y);

	printf("Air-mass coefficient: %.3f\n", x);
	printf("Altitude [degrees]  : %.3f\n", y);
	return res;
}