CARTA Backend
The backend component of CARTA
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RemoteFiles.h File Reference
#include <carta-protobuf/remote_file_request.pb.h>
#include <string>
Include dependency graph for RemoteFiles.h:
This graph shows which files directly or indirectly include this file:

Functions

bool GenerateUrlFromRequest (const CARTA::RemoteFileRequest &request, std::string &url, std::string &error_message)
 Generates a URL for a remote file request based on provided parameters.
 

Variables

const auto HIPS_BASE_URL = "https://alasky.cds.unistra.fr/hips-image-services/hips2fits"
 
const auto HIPS_MAX_PIXELS = 50e6
 

Function Documentation

◆ GenerateUrlFromRequest()

bool GenerateUrlFromRequest ( const CARTA::RemoteFileRequest &  request,
std::string &  url,
std::string &  error_message 
)

Generates a URL for a remote file request based on provided parameters.

Parameters
requestThe CARTA::RemoteFileRequest containing the request parameters.
urlThe generated URL to be returned if the request is valid.
error_messageA message indicating the reason for failure if the request is invalid.
Returns
true if the URL was successfully generated, false otherwise.

This function validates the CARTA::RemoteFileRequest parameters and constructs a URL to fetch an image from the HiPS service. If any required parameters are missing or invalid, it returns false and provides an appropriate error message.

Note
The function ensures that all required parameters are present and valid before constructing the URL. If wcs is not provided, additional fields such as coordsys, projection, fov, and object or (ra, dec) must be specified.
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ HIPS_BASE_URL

const auto HIPS_BASE_URL = "https://alasky.cds.unistra.fr/hips-image-services/hips2fits"

◆ HIPS_MAX_PIXELS

const auto HIPS_MAX_PIXELS = 50e6