Commit e55b8669 authored by Andrea Orlat's avatar Andrea Orlat
Browse files

added a small test code in order to test the refraction routine over different...

added a small test code in order to test the refraction routine over different dataset of weather parameters
parent f85da2b1
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ USER_LIB = -lACE \
# C programs (public and local)
# -----------------------------
EXECUTABLES     = 
EXECUTABLES_L   = TestClient TestRefro
EXECUTABLES_L   = TestClient TestRefro TestRefroIter

#
# <brief description of xxxxx program>
@@ -68,6 +68,9 @@ TestClient_LIBS = RefractionImpl
TestRefro_OBJECTS   = TestRefro
TestRefro_LIBS      = SlaLibrary

TestRefroIter_OBJECTS = TestIter
TestRefroIter_LIBS = SlaLibrary


#
# special compilation flags for single c sources
+68 −0
Original line number Diff line number Diff line
/*************************************************************/
/* Use the files in test directory as input */
/* Also provide the elevation */
/**+++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
#include <slalib.h>
#include <slamac.h>
#include <stdio.h>
#include <iostream>
#include <fstream>

#define HEIGHT 67.0
#define LATITUDE 45.0
#define WAVELEN 0.036
using namespace std;

int main (int argc, char *argv[]) {

	std::ifstream in;
	double temp,press,hum;
	double hm;
	double tdk;
	double wl;
	double phi;
	double tlr = 0.0065;
	double eps = 1e-8;
	double elev;
	double obsZenithDistance,corZenithDistance;

	in.open(argv[1]);

	cout << argv[1] << endl;
	
	elev=atof(argv[2]);

	cout << elev <<  endl;

	while (!in.eof()) {
		in >> temp >> press >> hum;

		obsZenithDistance=(90-elev)*DD2R;

		hm = HEIGHT; // meters
		tdk = temp+273.0;
		wl = WAVELEN*1000000; //micro meters
		phi = LATITUDE*DD2R; // radians		
		slaRefro(obsZenithDistance, hm, tdk, press, hum/100, wl, phi, tlr, eps, &corZenithDistance);
		corZenithDistance*=DR2D;
		cout << temp << " " << press << " " << hum << " " << corZenithDistance << endl;
		//cout << corZenithDistance << endl;

	}

	/*printf("Refraction, Temp %lf(°),Pressure %lf(mbar),Humidity %lf(RH),HEIGHT %lf(m), LATITUDE %lf(°)\n",TEMP,PRESSURE,HUMIDITY,HEIGHT,LATITUDE);
	for (unsigned i=0;i<=90;i+=5) {
		double obsZenithDistance=(double)(90-i);
		obsZenithDistance*=DD2R;
		double corZenithDistance;
		double tdk = TEMP + 273.0;
		double wl = 50000.0;
		double phi = LATITUDE*DD2R; // radians
		double tlr = 0.0065;
		double eps = 1e-8;
		slaRefro(obsZenithDistance, HEIGHT, tdk, PRESSURE, HUMIDITY, wl, phi, tlr, eps, &corZenithDistance);
		printf("%lf\t%lf\n",(double)i,corZenithDistance*DR2D);
	}*/


}
+107 −0
Original line number Diff line number Diff line
17.80	1020.50	73.10
17.60	1020.30	73.50
17.70	1020.10	72.60
17.50	1020.00	72.70
17.20	1020.10	73.80
17.00	1019.90	74.90
16.30	1019.80	77.20
16.10	1019.90	77.80
16.20	1020.00	75.30
16.60	1020.00	73.80
17.10	1020.20	73.50
18.70	1020.30	69.10
19.80	1020.40	65.90
20.80	1020.20	66.30
21.80	1020.10	62.10
22.50	1019.90	60.10
23.60	1019.90	57.00
24.30	1019.70	54.80
25.10	1019.50	50.70
26.40	1019.20	49.00
27.00	1018.90	43.60
27.30	1018.60	39.80
27.90	1018.40	37.60
28.30	1018.10	35.50
28.70	1017.90	31.70
28.70	1017.70	31.90
28.90	1017.40	30.80
29.40	1017.00	30.50
29.30	1016.80	32.10
29.40	1016.50	33.50
28.90	1016.20	31.10
29.00	1016.00	30.50
29.00	1015.90	31.50
28.70	1015.70	31.70
28.20	1015.60	32.40
27.70	1015.60	34.50
26.80	1015.60	35.30
25.60	1015.60	38.30
24.50	1015.90	40.30
24.40	1016.00	43.10
22.80	1016.00	47.60
22.20	1016.00	50.00
21.20	1016.00	53.90
20.10	1016.00	58.30
19.80	1015.90	59.70
19.10	1015.90	61.80
18.70	1015.60	64.10
18.40	1015.50	64.20
18.40	1015.40	63.50
18.00	1015.10	65.70
17.70	1015.20	65.60
17.50	1015.10	65.10
17.30	1014.80	66.70
17.20	1014.50	69.40
17.00	1014.30	70.40
17.20	1014.40	68.00
16.80	1014.40	69.20
17.00	1014.40	70.00
18.00	1014.50	67.70
19.20	1014.50	64.50
20.50	1014.60	60.60
21.80	1014.50	54.20
23.30	1014.40	50.90
24.80	1014.30	46.70
26.30	1014.20	41.60
27.00	1014.10	38.80
27.90	1013.80	36.20
28.50	1013.40	34.40
29.50	1013.20	32.70
29.70	1012.80	31.90
29.90	1012.50	30.60
30.20	1012.20	29.50
30.60	1011.80	28.50
30.70	1011.40	28.50
30.80	1010.90	28.40
31.30	1010.60	27.90
31.00	1010.30	28.30
31.30	1009.90	28.70
31.60	1009.60	28.00
31.60	1009.40	28.70
31.50	1009.00	30.10
30.00	1009.10	39.70
29.50	1009.30	41.00
29.00	1009.30	43.30
28.10	1009.20	46.40
27.00	1009.30	50.30
26.30	1009.40	52.40
25.60	1009.60	53.40
24.90	1009.60	54.70
23.70	1009.40	57.90
23.60	1009.20	56.50
22.90	1009.10	58.40
22.10	1008.70	61.20
21.90	1008.60	62.10
21.00	1008.60	64.50
20.80	1008.30	66.60
20.40	1008.30	69.40
20.30	1008.20	75.00
20.60	1008.10	79.10
20.50	1008.00	82.30
19.90	1008.00	79.80
19.60	1008.00	80.70
19.40	1008.10	82.80
20.10	1008.40	82.30
20.70	1009.00	79.30
20.90	1009.00	75.00
21.00	1009.40	72.90
+299 −0
Original line number Diff line number Diff line
19.00	1019.80	78.20
19.10	1019.80	77.40
19.10	1019.70	78.00
19.10	1019.60	76.70
19.20	1019.50	76.10
19.10	1019.50	76.40
19.40	1019.40	74.60
19.30	1019.30	75.50
19.10	1019.40	76.60
19.00	1019.40	76.70
18.90	1019.30	77.10
18.80	1019.50	77.90
18.70	1019.50	77.60
18.70	1019.30	77.80
18.50	1019.30	78.20
18.60	1019.30	77.20
18.40	1019.20	78.50
18.30	1019.10	78.20
18.30	1019.20	78.90
18.10	1019.20	78.80
18.20	1019.20	77.80
18.40	1019.30	76.20
18.40	1019.20	75.60
18.50	1019.40	75.60
18.20	1019.40	77.00
18.20	1019.40	76.70
18.10	1019.40	77.20
18.00	1019.40	77.80
18.10	1019.40	77.60
18.10	1019.50	78.30
18.20	1019.60	78.20
18.10	1019.60	79.00
26.20	1018.80	57.40
26.50	1018.70	56.70
26.40	1018.50	58.10
26.20	1018.40	57.50
26.30	1018.30	57.70
26.70	1018.30	56.50
27.20	1018.10	53.50
27.20	1018.00	49.60
27.40	1018.00	49.90
27.40	1017.80	48.60
27.80	1017.80	47.40
27.80	1017.60	46.80
28.00	1017.50	46.80
28.20	1017.50	46.20
28.10	1017.50	45.20
28.40	1017.40	44.80
28.30	1017.30	42.60
28.40	1017.20	41.60
28.70	1017.10	39.80
28.80	1017.00	36.30
29.00	1017.00	39.60
29.00	1016.90	39.30
29.20	1016.90	40.50
29.10	1016.80	41.00
29.00	1016.80	40.80
29.40	1016.60	38.80
29.50	1016.50	39.60
29.40	1016.40	38.80
29.40	1016.20	38.80
29.40	1016.20	38.40
29.80	1016.10	39.70
29.40	1016.00	39.90
29.40	1015.80	39.60
29.40	1015.80	39.60
29.70	1015.70	39.20
29.60	1015.60	37.70
29.40	1015.50	38.50
29.30	1015.40	38.20
29.70	1015.30	37.60
29.50	1015.30	37.30
29.40	1015.20	37.50
29.30	1015.20	37.20
29.20	1015.20	37.90
29.30	1015.20	38.10
29.20	1015.10	39.50
29.10	1015.10	38.90
29.00	1015.00	38.60
28.90	1014.90	38.30
28.90	1014.90	39.40
28.90	1015.00	39.30
28.90	1014.90	38.50
28.70	1014.90	39.50
28.40	1014.90	39.50
28.10	1014.90	38.40
27.90	1014.80	38.50
27.50	1014.80	40.10
27.50	1014.90	38.80
27.40	1015.00	39.40
27.10	1015.00	39.90
27.00	1015.20	40.60
26.90	1015.20	42.50
26.60	1015.30	45.50
26.30	1015.40	47.50
26.10	1015.40	48.70
25.90	1015.40	50.00
25.60	1015.30	51.50
25.40	1015.30	52.10
25.00	1015.40	54.40
24.60	1015.40	55.20
24.30	1015.40	56.50
24.00	1015.40	57.00
23.80	1015.40	56.70
23.80	1015.40	55.80
23.60	1015.40	57.10
23.00	1015.40	57.40
22.90	1015.30	56.00
22.90	1015.30	56.10
23.00	1015.40	54.70
22.50	1015.40	57.00
22.30	1015.20	58.10
22.00	1015.40	58.30
21.30	1015.30	63.50
21.10	1015.20	64.60
20.80	1015.10	65.50
20.60	1015.00	66.80
20.70	1015.00	64.10
20.60	1015.00	65.30
20.30	1015.00	65.10
20.60	1014.90	62.00
20.60	1014.90	62.80
20.20	1014.80	65.00
20.40	1014.80	62.90
20.60	1014.60	61.40
20.70	1014.50	61.70
20.40	1014.50	63.50
20.10	1014.40	65.60
19.80	1014.60	66.30
19.60	1014.40	67.00
19.60	1014.50	67.40
19.40	1014.60	68.10
19.50	1014.40	68.50
19.50	1014.30	70.10
19.70	1014.20	68.00
19.70	1014.10	68.40
19.60	1014.10	69.60
19.40	1014.00	70.30
19.40	1014.00	70.20
19.30	1013.80	70.00
19.40	1013.70	68.30
19.60	1013.70	67.40
19.50	1013.70	68.10
19.10	1013.80	69.40
19.10	1013.70	69.30
18.90	1013.80	70.20
18.60	1013.80	71.80
18.50	1013.90	71.70
18.70	1013.80	71.40
19.10	1013.80	70.10
19.20	1013.90	70.80
19.10	1013.90	71.80
19.20	1014.00	71.90
19.20	1013.90	73.00
19.30	1013.90	73.30
20.10	1013.90	71.00
20.20	1013.80	71.40
20.40	1013.90	71.10
20.80	1013.90	71.30
21.20	1013.80	70.00
21.40	1013.80	67.80
21.90	1013.80	66.10
22.60	1013.90	62.20
22.70	1013.80	61.00
23.40	1013.70	58.40
23.80	1013.70	57.20
24.40	1013.70	55.90
24.80	1013.70	55.10
25.30	1013.70	55.50
26.20	1013.60	52.80
26.60	1013.50	51.30
27.10	1013.50	49.10
27.20	1013.40	49.30
27.00	1013.50	47.50
27.60	1013.30	44.00
28.20	1013.20	43.50
28.30	1013.10	43.60
28.20	1013.00	43.80
28.40	1013.00	42.70
28.90	1012.80	42.10
29.20	1012.70	42.20
29.20	1012.60	41.70
29.50	1012.50	40.60
29.70	1012.40	39.80
29.60	1012.30	40.00
30.10	1012.20	40.20
30.50	1012.10	39.30
30.30	1012.00	38.60
30.50	1011.70	38.60
30.90	1011.70	38.20
30.80	1011.60	37.50
30.50	1011.40	36.90
30.60	1011.40	38.30
30.50	1011.40	36.60
31.30	1011.10	34.90
31.40	1011.00	36.70
31.30	1010.90	36.10
31.20	1010.70	37.10
31.00	1010.60	37.60
31.30	1010.40	36.40
31.20	1010.20	35.00
31.20	1010.20	35.40
31.70	1010.00	36.20
31.50	1010.00	36.30
31.40	1010.00	35.70
31.50	1009.80	35.20
31.40	1009.70	35.60
31.60	1009.60	35.90
31.40	1009.40	36.40
31.30	1009.30	36.30
31.70	1009.10	35.00
31.90	1009.20	34.40
31.80	1009.00	34.90
31.70	1008.90	35.80
31.90	1009.00	35.50
32.20	1008.80	36.30
31.90	1008.70	36.70
31.60	1008.60	36.50
31.80	1008.50	36.90
31.60	1008.30	37.40
31.30	1008.30	41.70
30.50	1008.40	46.50
30.10	1008.60	46.90
29.90	1008.60	48.30
29.70	1008.70	48.50
29.60	1008.70	48.40
29.60	1008.80	50.30
29.40	1008.70	50.90
29.20	1008.70	51.20
29.00	1008.50	51.90
28.80	1008.60	52.90
28.50	1008.50	54.50
28.10	1008.60	55.60
27.80	1008.60	57.00
27.40	1008.60	58.00
27.10	1008.60	59.10
26.80	1008.70	59.90
26.50	1008.80	61.00
26.20	1009.00	61.50
26.00	1009.10	61.40
26.00	1009.00	60.60
25.90	1009.00	60.80
25.60	1009.00	61.60
25.40	1008.90	62.00
25.20	1008.90	62.90
24.90	1008.80	63.80
24.70	1008.70	63.70
24.70	1008.70	62.80
24.70	1008.70	62.30
24.50	1008.50	63.60
24.20	1008.50	64.50
24.10	1008.50	64.10
23.80	1008.40	65.50
23.60	1008.20	66.20
23.40	1008.10	66.60
23.20	1008.00	67.70
23.00	1008.00	68.50
23.00	1008.00	69.00
23.00	1007.90	68.40
23.10	1007.80	68.70
22.90	1007.80	69.10
22.80	1007.90	69.20
22.60	1007.90	70.30
22.60	1007.80	70.80
22.60	1007.80	69.50
22.50	1007.50	68.40
22.90	1007.40	62.70
21.60	1007.70	75.30
21.10	1007.70	80.50
21.00	1007.50	84.60
21.20	1007.50	85.80
21.00	1007.50	87.90
21.10	1007.60	91.10
21.20	1007.40	92.50
21.20	1007.30	92.60
21.30	1007.20	93.70
21.40	1007.40	93.70
21.50	1007.40	92.60
21.20	1007.30	92.90
21.10	1007.40	93.00
20.80	1007.40	92.50
20.50	1007.40	92.20
20.50	1007.40	92.50
20.50	1007.30	94.10
20.30	1007.40	94.70
20.30	1007.50	95.90
20.60	1007.50	96.40
20.90	1007.60	96.00
20.70	1007.70	96.10
20.60	1007.90	96.50
20.80	1008.30	96.50
21.00	1008.30	95.00
21.10	1008.40	91.40
21.00	1008.40	90.00
21.10	1008.50	88.40
21.20	1008.40	87.60
21.20	1008.40	86.90
21.10	1008.60	86.30
21.20	1008.70	85.40