Defines an interface for a Geometric Slashed Ring Model based on the model_image class. This is a simple example of a model_image object. More...

#include "model/model_image_xsring.h"

Inheritance diagram for model_image_xsring:
Collaboration diagram for model_image_xsring:

Public Member Functions

void use_numerical_visibilities ()
 State switch to select numerically computed visibilities using the machinery in model_image. Once called, all future visibilities will be computed numerically until use_analytical_visibilities() is called.
 
void set_image_resolution (int Nray)
 Sets model_image_crescent to generate production images with resolution Nray x Nray. The default is 128x128, which is probably larger than required in practice.
 
void use_analytical_visibilities ()
 State switch to select analytically computed visibilities using the analytical Fourier transform of the Gaussian. Once called, visibilities will be computed analytically until use_numerical_visibilities() is called.
 
virtual size_t size () const
 A user-supplied function that returns the number of the parameters the model expects.
 
virtual std::string model_tag () const
 Return a string that contains a unique identifying tag for use with the ThemisPy plotting features.
 
virtual std::complex< double > visibility (datum_visibility &d, double accuracy)
 Returns complex visibility in Jy computed from the image given a datum_visibility_amplitude object, containing all of the accoutrements. While this provides access to the actual data value, the two could be separated if necessary. Also takes an accuracy parameter with the same units as the data, indicating the accuracy with which the model must generate a comparison value. Note that this can be redefined in child classes.
 
virtual double visibility_amplitude (datum_visibility_amplitude &d, double acc)
 Returns visibility ampitudes in Jy computed from the image given a datum_visibility_amplitude object, containing all of the accoutrements. While this provides access to the actual data value, the two could be separated if necessary. Also takes an accuracy parameter with the same units as the data, indicating the accuracy with which the model must generate a comparison value. Note that this is redefined to accomodate the possibility of using the analytical computation.
 
virtual double closure_phase (datum_closure_phase &d, double acc)
 Returns closure phase in degrees computed from the image given a datum_closure_phase object, containing all of the accoutrements. While this provides access to the actual data value, the two could be separated if necessary. Also takes an accuracy parameter with the same units as the data, indicating the accuracy with which the model must generate a comparison value. Note that this is redefined since the closure phase of Gaussian images is identically zero.
 
virtual double closure_amplitude (datum_closure_amplitude &d, double acc)
 Returns closure amplitude computed from the image given a datum_closure_phase object, containing all of the accoutrements. While this provides access to the actual data value, the two could be separated if necessary. Also takes an accuracy parameter with the same units as the data, indicating the accuracy with which the model must generate a comparison value. Note that this can be redefined in child classes.
 
- Public Member Functions inherited from model_image
virtual void generate_model (std::vector< double > parameters)
 A one-time generate function that permits model construction prior to calling the visibility_amplitude, closure_phase, etc. for each datum. Takes a vector of parameters.
 
virtual void generate_complex_visibilities ()
 A one-time generate function that will generate the complex visibilities and store them. This must be called after generate_model has been called.
 
void output_image (std::string fname, bool rotate=false)
 
void get_image (std::vector< std::vector< double > > &alpha, std::vector< std::vector< double > > &beta, std::vector< std::vector< double > > &I) const
 Provides direct access to the constructed image. Sets a 2D grid of angles (alpha, beta) in radians and intensities in Jy per steradian.
 
void get_visibilities (std::vector< std::vector< double > > &u, std::vector< std::vector< double > > &v, std::vector< std::vector< std::complex< double > > > &V) const
 Provides direct access to the complex visibilities. Sets a 2D grid of baselines (u,v) in lambda, and visibilites in Jy.
 
void get_visibility_amplitudes (std::vector< std::vector< double > > &u, std::vector< std::vector< double > > &v, std::vector< std::vector< double > > &V) const
 Provides direct access to the visibility amplitudes. Sets a 2D grid of baselines (u,v) in lambda, and visibilites in Jy.
 
void use_spline_interp (bool use_spline)
 Provides ability to use bicubic spline interpolator (true) instead of regular bicubic. Code defaults to false.
 
virtual void set_mpi_communicator (MPI_Comm comm)
 Defines a set of processors provided to the model for parallel computation via an MPI communicator. Only facilates code parallelization if the model computation is parallelized via MPI.
 
void write_model_tag_file (std::string tagfilename="model_image.tag") const
 Write a unique identifying tag for use with the ThemisPy plotting features. This calls the overloaded version with the outstream, which is the only function that need be rewritten in child classes.
 
virtual void write_model_tag_file (std::ofstream &tagout) const
 Write a unique identifying tag for use with the ThemisPy plotting features. For most child classes, the default implementation is suffcient. However, should that not be the case, this is the only function that need be rewritten in child classes.
 

Private Member Functions

virtual void generate_image (std::vector< double > parameters, std::vector< std::vector< double > > &I, std::vector< std::vector< double > > &alpha, std::vector< std::vector< double > > &beta)
 Generates and returns rectalinear grid of intensities associated with the Crescent Image model in Jy/pixel located at pixels centered on angular positions alpha and beta, both specified in radians and aligned with a fiducial direction. Note that the parameter vector has had the position removed.
 
double BesselJ0 (double x)
 Calculates the Bessel Function J1(x)
 
double BesselJ1 (double x)
 Calculates the Bessel Function J1(x)
 
double BesselJ2 (double x)
 Calculates the Bessel Function J2(x)
 
std::complex< double > complex_visibility (double u, double v)
 Calculates the complex visibility amplitude.
 

Private Attributes

double _V0
 Internal total intensity.
 
double _Rext
 Radius of the larger disc.
 
double _Rint
 Radius of the smaller disc.
 
double _d
 Distance between centers of the two disks.
 
double _f
 The fading parameter.
 
int _Nray
 Image resolution.
 
bool _use_analytical_visibilities
 If true uses analytical visibility computation; if false uses numerical visibilities.
 

Additional Inherited Members

- Protected Attributes inherited from model_image
MPI_Comm _comm
 
bool _generated_model
 True when a model is generated with generate_model.
 
bool _generated_visibilities
 True when model visibilities have been computed.
 
bool _use_spline
 True when want to use bicubic spline interpolator.
 
double _position_angle
 Position angle of the image, assumed to be the last element of the parameter list passed to generate_model. Assumed to be in radians and defined E of N.
 
std::vector< double > _current_parameters
 Last set of parameters passed to generate_image, useful to determine if it is necessary to recompute the model. Useful, e.g., if we are varying only position angle, or if recomputing for a number of different data sets at the same set of parameters.
 
std::vector< std::vector< double > > _alpha
 2D grid of horizonal pixel locations in radians, relative to the fiducial direction of the image (i.e., unrotated by the position angle).
 
std::vector< std::vector< double > > _beta
 2D grid of vertical pixel locations in radians, relative to the fiducial direction of the image (i.e., unrotated by the position angle).
 
std::vector< std::vector< double > > _I
 2D grid of intensities at pixel locations in Jy/str.
 
- Protected Attributes inherited from model_visibility
MPI_Comm _comm
 
- Protected Attributes inherited from model_visibility_amplitude
MPI_Comm _comm
 
- Protected Attributes inherited from model_closure_phase
MPI_Comm _comm
 
- Protected Attributes inherited from model_closure_amplitude
MPI_Comm _comm
 

Detailed Description

The Geometric Slashed Rint Model is created by substracting out a disc from the inside of a larger disc, both of constant intensity.

This model is defined by four parameters:

  • parameters[0]: The total integrated flux in Jy.
  • parameters[1]: R = The overall size.
  • parameters[2]: \( \psi \) = The relative thickness.
  • parameters[3]: \( \epsilon \) = The eccentricity.
  • parameters[4]: \( f \) = The fading parameter.
  • parameters[5]: \( \phi \) = The orientation (in model_image) in radians.

The documentation for this class was generated from the following files: