astrotypes  0.0
DispersionConstant.h
Go to the documentation of this file.
1 /*
2  * MIT License
3  *
4  * Copyright (c) 2018 PulsarSearchSoft
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all
14  * copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
24 #ifndef PSS_ASTROTYPES_UNITS_DISPERSIONCONSTANT_H
25 #define PSS_ASTROTYPES_UNITS_DISPERSIONCONSTANT_H
26 
27 #include "TimeUnits.h"
28 #include "Frequency.h"
29 #include "Length.h"
30 #pragma GCC diagnostic push
31 #pragma GCC diagnostic ignored "-Wall"
32 #pragma GCC diagnostic ignored "-Wunused-parameter"
33 #pragma GCC diagnostic ignored "-Wpragmas"
34 #include <boost/units/quantity.hpp>
35 #include <boost/units/conversion.hpp>
36 #include <boost/units/io.hpp>
37 #include <boost/units/derived_dimension.hpp>
38 #include <boost/units/physical_dimensions/length.hpp>
39 #include <boost/units/base_units/astronomical/parsec.hpp>
40 #include <boost/units/systems/si/prefixes.hpp>
41 #include <boost/units/systems/cgs/length.hpp>
42 #pragma GCC diagnostic pop
43 
44 
45 namespace pss {
46 namespace astrotypes {
47 namespace units {
48 namespace dm_constant {
49 
50 //typedef boost::units::scaled_base_unit<units::frequency_base_unit, boost::units::scale<10, boost::units::static_rational<6> > > megahertz_base_unit;
51 typedef boost::units::scaled_base_unit<boost::units::si::frequency::dimension_type, boost::units::scale<10, boost::units::static_rational<6> > > megahertz_base_unit;
52 // typedef divide_typeof_helper<frequency,electric_potential>::type frequency_over_electric_potential;
53 typedef boost::units::multiply_typeof_helper<boost::units::si::frequency, boost::units::si::frequency>::type frequency_squared;
54 
55 namespace s_mhz {
56 
57 typedef boost::units::derived_dimension<
59  boost::units::astronomical::parsec_base_unit, -1,
60  boost::units::length_base_dimension, 3,
61  boost::units::time_base_dimension,1
63 typedef boost::units::unit<DmConstantDimensionType1, boost::units::cgs::system> Unit;
64 
65 
66 } // namespace s_mhz
67 
68 namespace ms_mhz {
69 
70 typedef boost::units::scaled_base_unit<boost::units::si::second_base_unit, boost::units::scale<10, boost::units::static_rational<-3> > > ms_base_unit;
71 
72 typedef boost::units::derived_dimension<
74  boost::units::astronomical::parsec_base_unit, -1,
75  boost::units::length_base_dimension, 3,
76  ms_base_unit,1
78 typedef boost::units::unit<DmConstantDimensionType2, boost::units::cgs::system> Unit;
79 
80 } // namespace ms_mhz
81 
82 BOOST_UNITS_STATIC_CONSTANT(s_mhz_squared_cm_cubed_per_pc, s_mhz::Unit);
83 BOOST_UNITS_STATIC_CONSTANT(ms_mhz_squared_cm_cubed_per_pc, ms_mhz::Unit);
84 
85 namespace s_mhz {
86  static const boost::units::quantity<Unit, double> dm_constant(4.1493775933609e3 * s_mhz_squared_cm_cubed_per_pc);
87 }
88 
89 namespace ms_mhz {
90  static const boost::units::quantity<Unit, double> dm_constant(4.1493775933609e6 * ms_mhz_squared_cm_cubed_per_pc);
91 }
92 
93 } // dm_constant
94 } // namespace units
95 } // namespace astrotypes
96 } // namespace pss
97 
98 #endif // PSS_ASTROTYPES_UNITS_DISPERSIONCONSTANT_H
boost::units::derived_dimension< megahertz_base_unit, 2, boost::units::astronomical::parsec_base_unit,-1, boost::units::length_base_dimension, 3, ms_base_unit, 1 >::type DmConstantDimensionType2
boost::units::scaled_base_unit< boost::units::si::second_base_unit, boost::units::scale< 10, boost::units::static_rational<-3 > > > ms_base_unit
boost::units::derived_dimension< megahertz_base_unit, 2, boost::units::astronomical::parsec_base_unit,-1, boost::units::length_base_dimension, 3, boost::units::time_base_dimension, 1 >::type DmConstantDimensionType1
boost::units::scaled_base_unit< boost::units::si::frequency::dimension_type, boost::units::scale< 10, boost::units::static_rational< 6 > > > megahertz_base_unit
boost::units::unit< DmConstantDimensionType2, boost::units::cgs::system > Unit
boost::units::multiply_typeof_helper< boost::units::si::frequency, boost::units::si::frequency >::type frequency_squared
BOOST_UNITS_STATIC_CONSTANT(s_mhz_squared_cm_cubed_per_pc, s_mhz::Unit)
boost::units::unit< DmConstantDimensionType1, boost::units::cgs::system > Unit