Esempio n. 1
0
/***********************************************************************//**
 * @brief Parameter constructor
 *
 * @param[in] prefactor Smoothly broken power law pre factor (ph/cm2/s/MeV).
 * @param[in] index1 Smoothly broken power law index1.
 * @param[in] pivot Smoothly broken power law pivot energy
 * @param[in] index2 Smoothly broken power law index1.
 * @param[in] breakenergy Break energy.
 * @param[in] beta Break smoothness parameter
 *
 * Constructs a smoothly broken power law using the model parameters
 * power law @p prefactor (ph/cm2/s/MeV),
 * spectral @p index1,
 * @p pivot energy,
 * spectral @p index2,
 * @p breakenergy of spectral break, and
 * smoothness parameter @p beta.
 ***************************************************************************/
GModelSpectralSmoothBrokenPlaw::GModelSpectralSmoothBrokenPlaw(
                                        const double&  prefactor,
                                        const double&  index1,
                                        const GEnergy& pivot,
                                        const double&  index2,
                                        const GEnergy& breakenergy,
                                        const double&  beta) :
                                GModelSpectral()
{
    // Initialise members
    init_members();
    
    // Set parameters
    m_norm.value(prefactor);
    m_index1.value(index1);
    m_pivot.value(pivot.MeV());              // Internally stored in MeV
    m_index2.value(index2);
    m_breakenergy.value(breakenergy.MeV());  // Internally stored in MeV
    m_beta.value(beta);
    
    // Perform autoscaling of parameter
    autoscale();
    
    // Return
    return;
}
/***********************************************************************//**
 * @brief Parameter constructor
 *
 * @param[in] prefactor Power law pre factor (ph/cm2/s/MeV).
 * @param[in] index Power law index.
 * @param[in] pivot Pivot energy.
 *
 * Constructs a spectral power law using the model parameters
 * - power law @p prefactor (ph/cm2/s/MeV)
 * - spectral @p index
 * - @p pivot energy.
 ***************************************************************************/
GModelSpectralPlaw::GModelSpectralPlaw(const double&  prefactor,
                                       const double&  index,
                                       const GEnergy& pivot) :
                    GModelSpectral()
{
    // Initialise members
    init_members();

    // Set parameters
    m_norm.value(prefactor);
    m_index.value(index);
    m_pivot.value(pivot.MeV());  // Internally stored in MeV

    // Perform autoscaling of parameter
    autoscale();

    // Return
    return;
}
Esempio n. 3
0
/***********************************************************************//**
 * @brief Constructor
 *
 * @param[in] norm Total flux under Gaussian (in ph/cm2/s).
 * @param[in] mean Mean energy.
 * @param[in] sigma Energy width.
 ***************************************************************************/
GModelSpectralGauss::GModelSpectralGauss(const double&  norm,
                                         const GEnergy& mean,
                                         const GEnergy& sigma) :
                     GModelSpectral()
{
    // Initialise members
    init_members();

    // Set parameters
    m_norm.value(norm);
    m_mean.value(mean.MeV());
    m_sigma.value(sigma.MeV());

    // Autoscale parameters
    autoscale();

    // Return
    return;
}
/***********************************************************************//**
 * @brief Filename constructor
 *
 * @param[in] filename File name.
 * @param[in] value Normalization factor (defaults to 1).
 *
 * Constructs map cube model by loading a map cube from @p filename and by
 * assigning the normalization @p value.
 ***************************************************************************/
GModelSpatialDiffuseCube::GModelSpatialDiffuseCube(const std::string& filename,
                                                   const double&      value) :
                          GModelSpatialDiffuse()
{
    // Initialise members
    init_members();

    // Set parameter
    m_value.value(value);

    // Perform autoscaling of parameter
    autoscale();

    // Store filename
    m_filename = filename;

    // Return
    return;
}
Esempio n. 5
0
/***********************************************************************//**
 * @brief Constructor
 *
 * @param[in] prefactor Pre factor normalization (ph/cm2/s/MeV).
 * @param[in] index Power law index.
 * @param[in] pivot Pivot energy.
 * @param[in] cutoff Cut off energy.
 *
 * Construct an exponentially cut off power law from
 * - a prefactor value (in units of ph/cm2/s/MeV)
 * - a spectral index,
 * - a pivot energy, and
 * - a cut off energy.
 ***************************************************************************/
GModelSpectralExpPlaw::GModelSpectralExpPlaw(const double&  prefactor,
                                             const double&  index,
                                             const GEnergy& pivot,
                                             const GEnergy& cutoff) :
                       GModelSpectral()
{
    // Initialise members
    init_members();

    // Set parameters
    m_norm.value(prefactor);
    m_index.value(index);
    m_pivot.value(pivot.MeV()); // Internally stored in MeV
    m_ecut.value(cutoff.MeV()); // Internally stored in MeV

    // Autoscale parameters
    autoscale();

    // Return
    return;
}
/***********************************************************************//**
 * @brief Sky map constructor
 *
 * @param[in] cube Sky map cube.
 * @param[in] energies Sky map energies.
 * @param[in] value Normalization factor (defaults to 1).
 *
 * Constructs map cube model by extracting a @p cube from a sky map. The
 * constructor also assigns the energy values for all maps and sets the
 * scaling @p value. The filename will remain blank.
 ***************************************************************************/
GModelSpatialDiffuseCube::GModelSpatialDiffuseCube(const GSkymap&   cube,
                                                   const GEnergies& energies,
                                                   const double&    value) :
                          GModelSpatialDiffuse()
{
    // Initialise members
    init_members();

    // Set parameter
    m_value.value(value);

    // Perform autoscaling of parameter
    autoscale();

    // Set map cube
    this->cube(cube);

    // Set energies
    this->energies(energies);

    // Return
    return;
}
Esempio n. 7
0
void Plot::mouseDoubleClickEvent(QMouseEvent* evt)
{
    Q_UNUSED(evt)
    autoscale();    
}