Defines an image model based on the RIAF models employed in Broderick, Fish, Doeleman and Loeb (2011) and Broderick et al. (2016), permitting greater freedom to modify the underlying semi-analytic accretion flow structure. More...
#include "model/model_image_general_riaf.h"
Public Member Functions | |
model_image_general_riaf (double frequency=230e9, double D=VRT2::VRT2_Constants::D_SgrA_cm) | |
Constructor to make a RIAF model. Takes a frequency (Hz), mass (cm), distance (cm). | |
virtual size_t | size () const |
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. | |
void | set_image_resolution (int Nray, int number_of_refines=0) |
void | set_screen_size (double Rmax) |
double | frequency () const |
Returns the frequency at which this model is created. | |
double | generate_flux_estimate (double accuracy, std::vector< double > parameters) |
Returns an estimate of the total flux, computed over a dynamically adjusted region, at the frequency at which this model is created. An accuracy parameter (in Jy) is passed that defines the absolute accuracy at which the flux estimate must be computed. | |
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. | |
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. | |
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 accuracy) |
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 can be redefined in child classes. | |
virtual double | closure_phase (datum_closure_phase &d, double accuracy) |
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 can be redefined in child classes. | |
virtual double | closure_amplitude (datum_closure_amplitude &d, double accuracy) |
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. | |
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. | |
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. | |
Protected Attributes | |
MPI_Comm | _comm |
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 |
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 RIAF image model in Jy/str 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. | |
void | open_error_streams () |
Opens model-communicator-specific error streams for debugging output. | |
double | estimate_image_size_log_spiral (VRT2::PolarizationMap &pmap, double initial_r, double theta_step, double percent_from_max_I, unsigned int max_iter, double safety_factor) |
Private Attributes | |
const double | _D |
Internal distance in cm for the current model. | |
const double | _frequency |
Internal frequency in Hz for the current model. | |
double | _Rmax |
Image sizes in M (note, not applied to flux estimates) | |
int | _Nray_base |
Base image resolution no refines. | |
int | _Nray |
Image resolution after refines. | |
int | _number_of_refines |
Refines the base image roughly doubling the resolution. | |
std::ofstream | _merr |
Model-specific error stream. | |
Detailed Description
Provides explicit implementation of the model_image object for the semi-analytic RIAF models. There are additional tuning parameters that may impact accuracy, e.g., distance to the image screen, number of rays to produce, etc. See the appropriate parts of model_image_riaf.cpp for more. It also provides a flux estimate for inclusion in later flux_model extensions (model_riaf).
Parameter list:
- parameters[0] ... Black hole mass in units solar mass units.
- parameters[1] ... Black hole spin parameter (-1 to 1).
- parameters[2] ... Cosine of the spin inclination relative to line of sight.
- parameters[3] ... "Thermal" electron population density normalization in \({\rm cm}^{-3}\).
- parameters[4] ... "Thermal" electron population density radial power law.
- parameters[5] ... "Thermal" electron population density \(h/r\).
- parameters[6] ... "Thermal" electron population temperature normalization in K.
- parameters[7] ... "Thermal" electron population temperature radial power law.
- parameters[8] ... Power-law electron population density normalization in \({\rm cm}^{-3}\).
- parameters[9] ... Power-law electron population density radial power law.
- parameters[10] ... Power-law electron population density \(h/r\).
- parameters[11] .. Infall parameter (0,1)
- parameters[12] .. Sub-keplerian parameter, i.e., sets \(u_\phi/u_t =\) parameters[13] \(\times\)<keplerian value>.
- parameters[13] .. Position angle (in model_image) in radians.
- Warning
- This defines a model_image object associated with a RIAF observed at single frequency. Requires the VRT2 library to be installed.
Member Function Documentation
void set_image_resolution | ( | int | Nray, |
int | number_of_refines = 0 |
||
) |
Sets model_image_sed_fitted_riaf to generate production images with resolution Nray x Nray. The default is 128x128, which is probably larger than required in practice. number_of_refines set the number of refines to use when making the image defaults to zero. Refine, adaptively refines the underlying grid to roughly double the number of pixels in the image, while only send back more rays in interesting locations.
void set_screen_size | ( | double | Rmax | ) |
Sets the screen size of the image in units M so that image has size Rmax x Rmax. The default is 15 which is probably larger than needed.
The documentation for this class was generated from the following files: