CARTA Backend
The backend component of CARTA
Loading...
Searching...
No Matches
FitsUtil.cc File Reference
#include "FitsUtil.h"
#include <spdlog/spdlog.h>
#include <iomanip>
#include <regex>
#include <sstream>
Include dependency graph for FitsUtil.cc:

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.

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: