ConverterIntensity.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef CONVERTERINTENSITY_H_
00027 #define CONVERTERINTENSITY_H_
00028
00029 #include <QString>
00030 #include <QList>
00031 #include <casa/Arrays/Vector.h>
00032 #include <coordinates/Coordinates/SpectralCoordinate.h>
00033
00034 namespace casa {
00035
00040 class ConverterIntensity {
00041 public:
00042 static const QString FRACTION_OF_PEAK;
00043 static const QString KELVIN;
00044 static const QString JY_SR;
00045 static const QString JY_ARCSEC;
00046 static const QString JY_BEAM;
00047 static const QString JY;
00048 static const QString ADU;
00049 static const QString TIMES_PIXELS;
00050 static bool isSupportedUnits( const QString& yUnit );
00051
00052
00053
00054
00055 static void convert( Vector<float>& values, const Vector<float> hertzValues,
00056 const QString& oldUnits, const QString& newUnits,
00057 double maxValue, const QString& maxUnits,
00058 double beamAngle, double beamArea, SpectralCoordinate coord );
00059
00060
00061 static double convertJyBeams( const QString& sourceUnits, const QString& destUnits,
00062 double value, SpectralCoordinate& coord );
00063 static double convertJY( const QString& oldUnits, const QString& newUnits,
00064 double value, SpectralCoordinate& coord );
00065 static double convertJYSR( const QString& oldUnits,const QString& newUnits,
00066 double value, SpectralCoordinate& coord );
00067 static double convertKelvin( const QString& oldUnits,const QString& newUnits,
00068 double value, SpectralCoordinate& coord );
00069 virtual ~ConverterIntensity();
00070
00071 private:
00072 ConverterIntensity();
00073 static double percentToValue( double yValue, double maxValue );
00074 static double valueToPercent( double yValue, double maxValue );
00075 static double convertQuantity( double yValue, double frequencyValue,
00076 const QString& oldUnits, const QString& newUnits,
00077 double beamSolidAngle, double beamArea );
00078 static void convertJansky( Vector<float>& values, const QString& oldUnits,
00079 const QString& newUnits, SpectralCoordinate& coord );
00080 static void convertKelvin( Vector<float>& values, const QString& oldUnits,
00081 const QString& newUnits, SpectralCoordinate& coord );
00082 static bool isJansky( const QString& units );
00083 static bool isKelvin( const QString& units );
00084 static double convertNonKelvinUnits( double yValue, const QString& oldUnits,
00085 const QString& newUnits, double beamArea );
00086 static QString getJanskyBaseUnits( const QString& units );
00087 static QString getKelvinBaseUnits( const QString& units );
00088 static QString stripPixels( const QString& units );
00089 static double beamToArcseconds( double yValue, double beamArea );
00090 static double arcsecondsToBeam( double yValue, double beamArea );
00091 static double srToArcseconds( double yValue );
00092 static double arcsecondsToSr( double yValue );
00093 static const QList<QString> BEAM_UNITS;
00094 static const QList<QString> JY_UNITS;
00095 static const QList<QString> JY_SR_UNITS;
00096 static const QList<QString> KELVIN_UNITS;
00097 static const double SPEED_LIGHT_FACTOR;
00098 static const double FREQUENCY_FACTOR;
00099 static const double ARCSECONDS_PER_STERADIAN;
00100 };
00101
00102 }
00103 #endif