CARTA Backend
The backend component of CARTA
Loading...
Searching...
No Matches
carta::RegionSpatialProfile Class Reference

#include <RegionSpatialProfile.h>

Collaboration diagram for carta::RegionSpatialProfile:
[legend]

Public Member Functions

 RegionSpatialProfile ()=default
 Default constructor.
 
 RegionSpatialProfile (int region_id, int file_id, const std::vector< CARTA::SetSpatialRequirements_SpatialConfig > &configs)
 Constructor which sets spatial configurations.
 
void SetConfigurations (int file_id, const std::vector< CARTA::SetSpatialRequirements_SpatialConfig > &configs)
 Set spatial profile configurations.
 
bool GetConfigurations (int file_id, std::vector< CARTA::SetSpatialRequirements_SpatialConfig > &configs)
 Get spatial configurations for file id.
 
std::vector< int > GetConfigFileIds (int file_id)
 Get file ids in configurations which match file id.
 
bool GetPointSpatialProfile (int file_id, std::shared_ptr< Frame > frame, std::vector< CARTA::SetSpatialRequirements_SpatialConfig > &configs, std::shared_ptr< casacore::LCRegion > lc_region, std::vector< CARTA::SpatialProfileData > &spatial_profile_messages)
 Add calculated region spatial profile for point region to message.
 
bool GetLineSpatialProfile (int file_id, std::shared_ptr< Frame > frame, std::shared_ptr< Region > region, int stokes_index, int z, CARTA::SetSpatialRequirements_SpatialConfig &config, bool &cancelled, std::string &message, CARTA::SpatialProfileData &spatial_profile_message)
 Add calculated spatial profile for line region to message.
 
void ClearFileConfigs (int file_id)
 Clear configurations for frame.
 

Private Member Functions

bool HasConfiguration (int file_id, CARTA::SetSpatialRequirements_SpatialConfig &config)
 Check if configuration exists with input parameters, for line profile cancellation.
 
bool GetLineProfile (int file_id, std::shared_ptr< Frame > frame, std::shared_ptr< Region > region, int stokes_index, int z, CARTA::SetSpatialRequirements_SpatialConfig &config, bool &cancelled, std::string &message, std::vector< float > &profile, casacore::Quantity &increment)
 Calculate profile for line region by approximating as a box region for each pixel.
 
float GetBoxMeanValue (int file_id, std::shared_ptr< Frame > frame, RegionState &region_state, std::shared_ptr< casacore::CoordinateSystem > coord_sys, int z, int stokes_index)
 Calculate mean value for box region along line.
 
bool CancelLineProfile (int file_id, std::shared_ptr< Frame > frame, std::shared_ptr< Region > line_region, int z, RegionState &line_region_state, CARTA::SetSpatialRequirements_SpatialConfig &config)
 Check whether to cancel line profile calculation.
 

Private Attributes

int _region_id
 Region id, for config id.
 
std::unordered_map< ConfigId, std::vector< CARTA::SetSpatialRequirements_SpatialConfig >, ConfigIdHash_configs
 Spatial profile configurations.
 
std::mutex _config_mutex
 Lock to add/remove configurations.
 
std::mutex _profile_mutex
 Lock for calculating during line profiles, for cancellation.
 

Constructor & Destructor Documentation

◆ RegionSpatialProfile() [1/2]

carta::RegionSpatialProfile::RegionSpatialProfile ( )
default

Default constructor.

◆ RegionSpatialProfile() [2/2]

carta::RegionSpatialProfile::RegionSpatialProfile ( int  region_id,
int  file_id,
const std::vector< CARTA::SetSpatialRequirements_SpatialConfig > &  configs 
)

Constructor which sets spatial configurations.

Parameters
region_idRegion id for spatial profiles
file_idFile id for image frame
configsSpatial configurations
Here is the call graph for this function:

Member Function Documentation

◆ CancelLineProfile()

bool carta::RegionSpatialProfile::CancelLineProfile ( int  file_id,
std::shared_ptr< Frame frame,
std::shared_ptr< Region line_region,
int  z,
RegionState line_region_state,
CARTA::SetSpatialRequirements_SpatialConfig &  config 
)
private

Check whether to cancel line profile calculation.

Parameters
file_idFile id for image frame
frameImage frame
line_regionLine or polyline region
zZ axis index
line_region_stateLine region parameters when profile started
configSpatial profile configuration
Returns
Whether to cancel
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ClearFileConfigs()

void carta::RegionSpatialProfile::ClearFileConfigs ( int  file_id)

Clear configurations for frame.

Parameters
file_idFile id for image frame

◆ GetBoxMeanValue()

float carta::RegionSpatialProfile::GetBoxMeanValue ( int  file_id,
std::shared_ptr< Frame frame,
RegionState region_state,
std::shared_ptr< casacore::CoordinateSystem >  coord_sys,
int  z,
int  stokes_index 
)
private

Calculate mean value for box region along line.

Parameters
file_idFile id for image frame
frameImage frame
region_stateBox region parameters
coord_sysCoordinate system used to define box
zZ axis index
stokes_indexStokes axis index
Returns
Mean value of box region
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetConfigFileIds()

std::vector< int > carta::RegionSpatialProfile::GetConfigFileIds ( int  file_id)

Get file ids in configurations which match file id.

Parameters
file_idFile id for image frame
Returns
File ids

◆ GetConfigurations()

bool carta::RegionSpatialProfile::GetConfigurations ( int  file_id,
std::vector< CARTA::SetSpatialRequirements_SpatialConfig > &  configs 
)

Get spatial configurations for file id.

Parameters
[in]file_idFile id for image frame
[out]configsSpatial configurations
Returns
Whether configs exist for file id
Here is the caller graph for this function:

◆ GetLineProfile()

bool carta::RegionSpatialProfile::GetLineProfile ( int  file_id,
std::shared_ptr< Frame frame,
std::shared_ptr< Region region,
int  stokes_index,
int  z,
CARTA::SetSpatialRequirements_SpatialConfig &  config,
bool &  cancelled,
std::string &  message,
std::vector< float > &  profile,
casacore::Quantity &  increment 
)
private

Calculate profile for line region by approximating as a box region for each pixel.

Parameters
[in]file_idFile id for image frame
[in]frameImage frame
[in]regionLine or polyline region
[in]stokes_indexStokes axis index
[in]zZ axis index
[in]configSpatial configuration
[out]cancelledWhether profile was cancelled
[out]messageError message
[out]profileResult of profile calculation
[out]incrementIncrement of spatial axis in profile
Returns
Whether profile calculation completed
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetLineSpatialProfile()

bool carta::RegionSpatialProfile::GetLineSpatialProfile ( int  file_id,
std::shared_ptr< Frame frame,
std::shared_ptr< Region region,
int  stokes_index,
int  z,
CARTA::SetSpatialRequirements_SpatialConfig &  config,
bool &  cancelled,
std::string &  message,
CARTA::SpatialProfileData &  spatial_profile_message 
)

Add calculated spatial profile for line region to message.

Parameters
[in]file_idFile id for image frame
[in]frameImage frame
[in]regionLine or polyline region
[in]stokes_indexStokes axis index
[in]zZ axis index
[in]configSpatial configuration
[out]cancelledWhether line profile was cancelled
[out]messageMessage if line profile failed
[out]spatial_profile_messageRegion spatial profile data message
Returns
Whether profile was added
Here is the call graph for this function:

◆ GetPointSpatialProfile()

bool carta::RegionSpatialProfile::GetPointSpatialProfile ( int  file_id,
std::shared_ptr< Frame frame,
std::vector< CARTA::SetSpatialRequirements_SpatialConfig > &  configs,
std::shared_ptr< casacore::LCRegion >  lc_region,
std::vector< CARTA::SpatialProfileData > &  spatial_profile_messages 
)

Add calculated region spatial profile for point region to message.

Parameters
[in]file_idFile id for image frame
[in]frameImage frame
[in]configsSpatial configurations
[in]lc_regionRegion applied to image
[out]spatial_profile_messagesRegion spatial profile data messages
Returns
Whether profiles were added

◆ HasConfiguration()

bool carta::RegionSpatialProfile::HasConfiguration ( int  file_id,
CARTA::SetSpatialRequirements_SpatialConfig &  config 
)
private

Check if configuration exists with input parameters, for line profile cancellation.

Parameters
file_idFile id for image frame
[in]configSpatial configuration
Returns
Whether configuration exists
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetConfigurations()

void carta::RegionSpatialProfile::SetConfigurations ( int  file_id,
const std::vector< CARTA::SetSpatialRequirements_SpatialConfig > &  configs 
)

Set spatial profile configurations.

Parameters
file_idFile id for image frame
configsSpatial configurations
Here is the caller graph for this function:

Member Data Documentation

◆ _config_mutex

std::mutex carta::RegionSpatialProfile::_config_mutex
private

Lock to add/remove configurations.

◆ _configs

std::unordered_map<ConfigId, std::vector<CARTA::SetSpatialRequirements_SpatialConfig>, ConfigIdHash> carta::RegionSpatialProfile::_configs
private

Spatial profile configurations.

◆ _profile_mutex

std::mutex carta::RegionSpatialProfile::_profile_mutex
private

Lock for calculating during line profiles, for cancellation.

◆ _region_id

int carta::RegionSpatialProfile::_region_id
private

Region id, for config id.


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