summaryrefslogtreecommitdiffstats
path: root/kstars/kstars/tools/modcalcvlsr.h
blob: 2320bd19108efa110176fdf24878177dc4c4c0ec (plain)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
/***************************************************************************
                          modcalcLSRVel.h  -  description
                             -------------------
    begin                : dom mar 13 2005
    copyright            : (C) 2005 by Pablo de Vicente
    email                : pvicentea@wanadoo.es
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef MODCALCVLSR_H
#define MODCALCVLSR_H

#include <kapplication.h>
#include <qwidget.h>
#include "modcalcvlsrdlg.h"

class QWidget;
class SkyPoint;
class KStarsDateTime;
class GeoLocation;
class dms;

/**
  *@author Pablo de Vicente
  *Module to compute the heliocentric radial velocity, geocentric radial velocity and 
  *topocentric radial velocity for a source, given its coordinates, its Vlsr and the date and
  *location on the Earth.
  */

class modCalcVlsr : public modCalcVlsrDlg  {

Q_OBJECT

public: 
	modCalcVlsr(QWidget *p, const char *n);
	~modCalcVlsr();
	
public slots:

	void slotClearCoords();
	void slotComputeVelocities();
	void slotUtChecked();
	void slotDateChecked();
	void slotRaChecked();
	void slotDecChecked();
	void slotEpochChecked();
	void slotLongChecked();
	void slotLatChecked();
	void slotHeightChecked();
	void slotVlsrChecked();
	void slotInputFile();
	void slotOutputFile();
	void slotRunBatch();

private:

	/**@returns a SkyPoint constructed from the coordinates in the 
	 * RA and Dec dmsBoxes. */
	SkyPoint getEquCoords(void);

	/* @return a double with the Vlsr from the vlsrBox in the UI
	 */
	double getVLSR (void);
	
	/* @return a double with the Vhel from the vhelBox in the UI
	 */
	double getVhel (void);
	
	/* @return a double with the Vgeo from the vgeoBox in the UI
	 */
	double getVgeo (void);
	
	/* @return a double with the Vtopo from the vtopoBox in the UI
	 */
	double getVtopo (void);

	/**@returns a KStarsDateTime constructed from the Time and Date fields. */
	KStarsDateTime getDateTime (void);

	/**Parse the string argument as a double
	 * @param eName    String from which the epoch is to be constructed
	 *                 once it is converted to a double
	 */
	double getEpoch (QString eName);

	/* Creates a dms object from the latitude box */
	dms getLatitude (void);

	/* Creates a dms object from the longitude box */
	dms getLongitude (void);

	/* creates a double from the height box */ 
	double getHeight(void);
	
	/* Constructs a GeoLocation object from the longitude, latitude and height fields */

	void getGeoLocation(void);

	/**Fill the Time and Date fields with the current values from the 
	 * CPU clock. */
	void showCurrentDateTime(void);

	/* Constructs the a GeoLocation object (geoPlace) from the calling classes.
	 * This is for using as Geolocation the location setup in KStars 
	 * */
	void initGeo(void);

	/* Fills the longitude, latitude and height fields with the values in the 
	 * geoPlace object, which come from the calling classes.
	 */
	void showLongLat(void);

	/**Fills the VLSR box with its value
	 **/
	void showVlsr (const double vlsr );

	/**Fills the Heliocentric velocity box with its value
	 **/
	void showHelVel (const double vhel );

	/**Fills the geocentric velocity box with its value
	 **/
	void showGeoVel (const double vgeo );

	/**Fills the topocentric velocity box with its value
	 **/
	void showTopoVel (const double vtopo );

	/**Fills the epoch box with the value corresponding to a julian day
	 * @param dt   date/time from which to construct the epoch string
	 */
	void showEpoch (const KStarsDateTime &dt );

	/* Method to process the lines from a file
	 */
	void processLines( QTextStream &istream );
  
	GeoLocation *geoPlace;

};



#endif