CARTA Backend
The backend component of CARTA
Loading...
Searching...
No Matches
FitsUtil.h File Reference
#include <string>
#include <vector>
Include dependency graph for FitsUtil.h:
This graph shows which files directly or indirectly include this file:

Functions

bool ParseHistoryBeamHeader (std::string &header, std::string &bmaj, std::string &bmin, std::string &bpa)
 Parses an AIPS-style beam header to extract beam parameters with regular expression.
 

Function Documentation

◆ ParseHistoryBeamHeader()

bool ParseHistoryBeamHeader ( std::string &  header,
std::string &  bmaj,
std::string &  bmin,
std::string &  bpa 
)

Parses an AIPS-style beam header to extract beam parameters with regular expression.

Parameters
[in]headerA string reference to the history beam header string to be parsed.
[out]bmajA string reference to the extracted major axis value with its unit.
[out]bminA string reference to the extracted minor axis value with its unit.
[out]bpaA string reference to the extracted position angle value with its unit.
Returns
true if the header was successfully parsed and values were extracted, otherwise false.

This function uses regular expressions to extract the major axis (BMAJ), minor axis (BMIN), and position angle (BPA) from an AIPS-style history beam header string. It handles two common formats: one using "Beam =" notation and another using "BMAJ=", "BMIN=", and "BPA=" notation.

Note
Units are normalized to "deg" when "degrees" is found in the header.
Warning
If the header format does not match expected patterns, the function logs a debug message and returns false.
Here is the caller graph for this function: