GyotoPatternDisk.h
Go to the documentation of this file.
/*
Copyright 2011-2015, 2018 Frederic Vincent, Thibaut Paumard
This file is part of Gyoto.
Gyoto 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 3 of the License, or
(at your option) any later version.
Gyoto is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Gyoto. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GyotoPatternDisk_H_
#define __GyotoPatternDisk_H_
#include <iostream>
#include <fstream>
#include <iomanip>
namespace Gyoto{
namespace Astrobj { class PatternDisk; }
}
//#include <GyotoMetric.h>
#include <GyotoThinDisk.h>
class Gyoto::Astrobj::PatternDisk : public Astrobj::ThinDisk {
friend class Gyoto::SmartPointer<Gyoto::Astrobj::PatternDisk>;
private:
std::string filename_;
double * emission_;
double * opacity_;
double * velocity_;
double * radius_;
double Omega_;
double t0_;
double dnu_;
double nu0_;
size_t nnu_;
double dphi_;
double phimin_;
size_t nphi_;
double phimax_;
size_t repeat_phi_;
double dr_;
size_t nr_;
// Constructors - Destructor
// -------------------------
public:
GYOTO_OBJECT;
// fillProperty is overridden to remove leading "!" from FITS filename
void fillProperty(Gyoto::FactoryMessenger *fmp, Property const &p) const;
PatternDisk();
PatternDisk(const PatternDisk& ) ;
virtual PatternDisk* clone () const;
virtual ~PatternDisk() ;
// Accessors
// ---------
public:
using ThinDisk::innerRadius;
virtual void innerRadius(double);
using ThinDisk::outerRadius;
virtual void outerRadius(double);
virtual void patternVelocity(double);
virtual double patternVelocity() const;
virtual void file(std::string const &f);
virtual std::string file() const ;
#ifdef GYOTO_USE_CFITSIO
virtual void fitsRead(std::string filename_);
virtual void fitsWrite(std::string filename_);
#endif
void setEmission(double * pattern);
void setVelocity(double * pattern);
void radius(double * pattern);
virtual void copyIntensity(double const * const pattern = NULL,
size_t const naxes[3] = NULL);
virtual double const * getIntensity() const;
virtual void getIntensityNaxes( size_t naxes[3] ) const ;
virtual void copyOpacity(double const * const pattern = NULL,
size_t const naxes[3] = NULL);
virtual double const * opacity() const;
virtual void copyVelocity(double const * const pattern = NULL,
size_t const naxes[2] = NULL);
virtual double const * getVelocity() const;
virtual void copyGridRadius(double const * const pattern = NULL,
size_t nr = 0 );
virtual double const * getGridRadius() const;
virtual void repeatPhi(size_t n);
virtual size_t repeatPhi() const;
virtual void nu0(double freq);
virtual double nu0() const;
virtual void dnu(double dfreq);
virtual double dnu() const;
void phimin(double phimin);
double phimin() const;
void phimax(double phimax);
double phimax() const;
protected:
void getIndices(size_t i[3], double const co[4], double nu=0.) const ;
public:
using ThinDisk::emission;
virtual double emission(double nu_em, double dsem,
state_t const &c_ph, double const c_obj[8]=NULL) const;
virtual double transmission(double nu_em, double dsem, state_t const &, double const coord[8]) const;
virtual void getVelocity(double const pos[4], double vel[4]) ;
};
#endif
size_t
#define size_t
If not defined in <sys/types.h>.
Definition GyotoConfig.h:390
GYOTO_OBJECT
#define GYOTO_OBJECT
Declare class::properties and class::getProperties().
Definition GyotoObject.h:84
GyotoThinDisk.h
Geometrically thin disks and rings.
Gyoto::Astrobj::Generic::emission
virtual double emission(double nu_em, double dsem, state_t const &coord_ph, double const coord_obj[8]=NULL) const
Specific intensity Iν.
Gyoto::Astrobj::PatternDisk
Geometrically thin disk read from FITS file.
Definition GyotoPatternDisk.h:51
Gyoto::Astrobj::PatternDisk::copyVelocity
virtual void copyVelocity(double const *const pattern=NULL, size_t const naxes[2]=NULL)
Set PatternDisk::velocity_.
Gyoto::Astrobj::PatternDisk::phimin_
double phimin_
Minimum φ in grid.
Definition GyotoPatternDisk.h:93
Gyoto::Astrobj::PatternDisk::phimax_
double phimax_
Maximum φ in grid.
Definition GyotoPatternDisk.h:95
Gyoto::Astrobj::PatternDisk::outerRadius
virtual void outerRadius(double)
Set rout_.
Gyoto::Astrobj::PatternDisk::copyOpacity
virtual void copyOpacity(double const *const pattern=NULL, size_t const naxes[3]=NULL)
Set PatternDisk::opacity_.
Gyoto::Astrobj::PatternDisk::setEmission
void setEmission(double *pattern)
Set PatternDisk::emission_.
Gyoto::Astrobj::PatternDisk::opacity
virtual double const * opacity() const
Get PatternDisk::opacity_.
Gyoto::Astrobj::PatternDisk::nr_
size_t nr_
Number of rows in the patternGrid size in the r direction.
Definition GyotoPatternDisk.h:104
Gyoto::Astrobj::PatternDisk::emission_
double * emission_
Iν(ν, r, φ).
Definition GyotoPatternDisk.h:60
Gyoto::Astrobj::PatternDisk::getIndices
void getIndices(size_t i[3], double const co[4], double nu=0.) const
Get emission_ cell corresponding to position co[4].
Gyoto::Astrobj::PatternDisk::t0_
double t0_
Date for which i=0 corresponds to phi=0.
Definition GyotoPatternDisk.h:86
Gyoto::Astrobj::PatternDisk::dr_
double dr_
Radius step.
Definition GyotoPatternDisk.h:103
Gyoto::Astrobj::PatternDisk::getGridRadius
virtual double const * getGridRadius() const
Get PatternDisk::radius_.
Gyoto::Astrobj::PatternDisk::phimin
void phimin(double phimin)
Set PatternDisk::phimin_.
Gyoto::Astrobj::PatternDisk::radius_
double * radius_
Radius vector.
Definition GyotoPatternDisk.h:74
Gyoto::Astrobj::PatternDisk::getIntensityNaxes
virtual void getIntensityNaxes(size_t naxes[3]) const
Get PatternDisk::nnu_, PatternDisk::nphi_, and PatternDisk::nr_.
Gyoto::Astrobj::PatternDisk::dphi_
double dphi_
δφ between two grid columns
Definition GyotoPatternDisk.h:92
Gyoto::Astrobj::PatternDisk::patternVelocity
virtual void patternVelocity(double)
Set PatternDisk::Omega_.
Gyoto::Astrobj::PatternDisk::nphi_
size_t nphi_
Grid size in the φ direction.
Definition GyotoPatternDisk.h:94
Gyoto::Astrobj::PatternDisk::Omega_
double Omega_
Pattern angular velocity.
Definition GyotoPatternDisk.h:80
Gyoto::Astrobj::PatternDisk::copyGridRadius
virtual void copyGridRadius(double const *const pattern=NULL, size_t nr=0)
Set PatternDisk::radius_.
Gyoto::Astrobj::PatternDisk::PatternDisk
PatternDisk()
Standard constructor.
Gyoto::Astrobj::PatternDisk::fitsRead
virtual void fitsRead(std::string filename_)
Read parameters and arrays from FITS file.
Gyoto::Astrobj::PatternDisk::repeatPhi
virtual void repeatPhi(size_t n)
Set PatternDisk::repeat_phi_.
Gyoto::Astrobj::PatternDisk::nu0
virtual void nu0(double freq)
Set PatternDisk::nu0_.
Gyoto::Astrobj::PatternDisk::dnu_
double dnu_
Frequency scale of PatternDisk::emission_ in Hz.
Definition GyotoPatternDisk.h:88
Gyoto::Astrobj::PatternDisk::setVelocity
void setVelocity(double *pattern)
Set PatternDisk::velocity__.
Gyoto::Astrobj::PatternDisk::velocity_
double * velocity_
velocity(r, φ)
Definition GyotoPatternDisk.h:69
Gyoto::Astrobj::PatternDisk::nu0_
double nu0_
Lowest frequency provided in PatternDisk::emission_ in Hz.
Definition GyotoPatternDisk.h:89
Gyoto::Astrobj::PatternDisk::fillProperty
void fillProperty(Gyoto::FactoryMessenger *fmp, Property const &p) const
Output a single Property to XML.
Gyoto::Astrobj::PatternDisk::nnu_
size_t nnu_
Number of frequencies provided in PatternDisk::emission_.
Definition GyotoPatternDisk.h:90
Gyoto::Astrobj::PatternDisk::transmission
virtual double transmission(double nu_em, double dsem, state_t const &, double const coord[8]) const
Transmission: exp( αν * dsem ).
Gyoto::Astrobj::PatternDisk::opacity_
double * opacity_
Same dimenstions as emission, or NULL.
Definition GyotoPatternDisk.h:62
Gyoto::Astrobj::PatternDisk::getVelocity
virtual double const * getVelocity() const
Get PatternDisk::velocity_.
Gyoto::Astrobj::PatternDisk::radius
void radius(double *pattern)
Set PatternDisk::radius_.
Gyoto::Astrobj::PatternDisk::emission
virtual double emission(double nu_em, double dsem, state_t const &c_ph, double const c_obj[8]=NULL) const
Specific intensity Iν.
Gyoto::Astrobj::PatternDisk::getIntensity
virtual double const * getIntensity() const
Get PatternDisk::emission_.
Gyoto::Astrobj::PatternDisk::phimax
void phimax(double phimax)
Set PatternDisk::phimax_.
Gyoto::Astrobj::PatternDisk::copyIntensity
virtual void copyIntensity(double const *const pattern=NULL, size_t const naxes[3]=NULL)
Set PatternDisk::emission_.
Gyoto::Astrobj::PatternDisk::clone
virtual PatternDisk * clone() const
Cloner.
Gyoto::Astrobj::PatternDisk::repeat_phi_
size_t repeat_phi_
Number of times the pattern should be repeated to cover [0, 2Π].
Definition GyotoPatternDisk.h:101
Gyoto::Astrobj::PatternDisk::fitsWrite
virtual void fitsWrite(std::string filename_)
Write parameters and arrays to FITS file.
Gyoto::Astrobj::PatternDisk::filename_
std::string filename_
Optional FITS file name containing the arrays.
Definition GyotoPatternDisk.h:54
Gyoto::Astrobj::PatternDisk::innerRadius
virtual void innerRadius(double)
Set rin_.
Gyoto::Astrobj::PatternDisk::dnu
virtual void dnu(double dfreq)
Set PatternDisk::dnu_.
Gyoto::Astrobj::ThinDisk
Geometrically thin disks and rings.
Definition GyotoThinDisk.h:71
Gyoto::Astrobj::ThinDisk::innerRadius
virtual double innerRadius() const
Get rin_.
Gyoto::Astrobj::ThinDisk::outerRadius
virtual double outerRadius() const
Get rout_.
Gyoto::SmartPointer
Pointers performing reference counting.
Definition GyotoSmartPointer.h:135
Gyoto::Astrobj
Access to astronomical objects.
Definition GyotoAstrobj.h:49
Gyoto
Namespace for the Gyoto library.
Definition GyotoAstrobj.h:44