Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure

core/RefractionExtinction.hpp

00001 /*
00002  * Stellarium
00003  * Copyright (C) 2010 Fabien Chereau
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00018  *
00019  * Refraction and extinction computations.
00020  * Implementation: 2010-03-23 GZ=Georg Zotti, Georg.Zotti@univie.ac.at
00021  */
00022 
00023 
00024 // TODO USABILITY: add 4 more flags/switches in GUI:
00025 // (boolean) refraction, [could be omitted and linked to global "show atmosphere"]
00026 // (value field) Temperature [C] [influences refraction]
00027 // (value field) Pressure [mbar]  [influences refraction]
00028 // (combo)   extinction Coeff. k=0...(0.01)...1, [if k=0, no ext. effect]
00029 // SUGGESTION: Could Temperature/Pressure/ex.Coeff./LightPollution be linked to the landscape files?
00030 
00031 #include "VecMath.hpp"
00032 
00046 class RefractionExtinction
00047 {
00048 public:
00049     RefractionExtinction();
00053     void forward(Vec3d* altAzPos, float* mag, int size);
00057     void backward(Vec3d* altAzPos, float* mag, int size);
00059     void setPressure(float p_mbar);
00061     void setTemperature(float t_C);
00064     void setExtinctionCoefficient(float k);
00065 
00073     float airmass(float cosZ, bool apparent_z=true);
00074 
00075 private:
00077     void updatePrecomputed();
00078 
00081     float pressure;
00083     float temperature;
00085     float ext_coeff;
00087     float press_temp_corr_Saemundson;
00089     float press_temp_corr_Bennett;
00090 };