![]() |
CARTA Backend
The backend component of CARTA
|
#include <Stokes.h>
Static Public Member Functions | |
static CARTA::PolarizationType | Get (int value) |
Retrieves the corresponding CARTA polarization type from an integer value. | |
static CARTA::PolarizationType | Get (std::string name) |
Retrieves the corresponding CARTA polarization type from a string name. | |
static casacore::Stokes::StokesTypes | ToCasa (CARTA::PolarizationType type) |
Converts a CARTA polarization type to the corresponding CASA Stokes type. | |
static bool | ConvertFits (const int &in_stokes_value, int &out_stokes_value) |
Converts a FITS Stokes parameter value to its corresponding internal representation. | |
static std::string | Name (CARTA::PolarizationType type) |
Retrieves the name of a given CARTA polarization type. | |
static std::string | Description (CARTA::PolarizationType type) |
Retrieves a descriptive string for a given CARTA polarization type. | |
static bool | IsComputed (int value) |
Determines if a given polarization type is a computed polarization. | |
Static Protected Attributes | |
static std::unordered_map< CARTA::PolarizationType, casacore::Stokes::StokesTypes > | _to_casa |
Maps CARTA polarization types to CASA Stokes types. | |
static std::unordered_map< CARTA::PolarizationType, std::string > | _description |
Provides human-readable descriptions for CARTA polarization types. | |
|
static |
Converts a FITS Stokes parameter value to its corresponding internal representation.
[in] | in_stokes_value | The input FITS Stokes parameter value. |
[out] | out_stokes_value | The converted Stokes parameter value. |
true
if the conversion was successful, false
if the input value is invalid.This function maps a FITS Stokes parameter to a valid internal Stokes value. It supports conversion of standard Stokes parameters (1 to 4) and circular/linear polarization parameters (5 to 12 and -1 to -8).
1
to 4
(directly assigned)5
to 12
and -1
to -8
(converted using out_stokes_value = -in_stokes_value + 4
)
|
static |
Retrieves a descriptive string for a given CARTA polarization type.
[in] | type | The polarization type for which to retrieve a description. |
This function returns a human-readable description of a CARTA::PolarizationType
from the _description
map. If the type is not found in the map, it falls back to returning the string representation of the polarization type.
|
static |
Retrieves the corresponding CARTA polarization type from an integer value.
value | The integer representation of a CARTA::PolarizationType . |
CARTA::PolarizationType
if valid, otherwise POLARIZATION_TYPE_NONE
.This function checks if the provided integer value is a valid CARTA::PolarizationType
. If valid, it returns the corresponding enumeration value. Otherwise, it returns CARTA::PolarizationType::POLARIZATION_TYPE_NONE
as a fallback.
|
static |
Retrieves the corresponding CARTA polarization type from a string name.
name | The string representation of a CARTA::PolarizationType . |
CARTA::PolarizationType
if parsing is successful, otherwise POLARIZATION_TYPE_NONE
.This function attempts to parse a given string into a CARTA::PolarizationType
. If parsing is successful, it returns the corresponding enumeration value. If the name is invalid, it returns CARTA::PolarizationType::POLARIZATION_TYPE_NONE
.
|
static |
Determines if a given polarization type is a computed polarization.
[in] | value | The integer representation of a CARTA::PolarizationType . |
true
if the value corresponds to a computed polarization type, otherwise false
.This function checks whether the provided integer value corresponds to a computed polarization type (e.g., Ptotal
, Plinear
, PFtotal
, PFlinear
, Pangle
).
|
static |
Retrieves the name of a given CARTA polarization type.
[in] | type | The polarization type to retrieve the name for. |
This function returns the string representation of a CARTA::PolarizationType
using the CARTA::PolarizationType_Name
function.
|
static |
Converts a CARTA polarization type to the corresponding CASA Stokes type.
type | The CARTA::PolarizationType to convert. |
casacore::Stokes::StokesTypes
value. std::out_of_range | If the provided type is not found in the mapping. |
This function maps a CARTA::PolarizationType
to its equivalent casacore::Stokes::StokesTypes
using a predefined lookup table. If the provided type is not found in the mapping, an std::out_of_range
exception may be thrown.
|
staticprotected |
Provides human-readable descriptions for CARTA polarization types.
This unordered map associates each CARTA::PolarizationType
enumeration value with a corresponding descriptive string. It is used to provide user-friendly labels for polarization types in logs, UI displays, or reports.
|
staticprotected |
Maps CARTA polarization types to CASA Stokes types.
This unordered map provides a conversion between the CARTA::PolarizationType
enumeration and the corresponding casacore::Stokes::StokesTypes
enumeration. It is used to translate polarization representations between the two frameworks.