SatDump 2.0.0-alpha-76a915210
Loading...
Searching...
No Matches
satdump::products::Product Class Reference

Core SatDump product class. More...

#include <product.h>

Inheritance diagram for satdump::products::Product:
satdump::products::ImageProduct satdump::products::PunctiformProduct

Public Member Functions

 Product (Product const &)=delete
void operator= (Product const &x)=delete
void set_product_timestamp (double timestamp)
 Set product timestamp, optional. This is usually the rough creation time / acquisition time.
bool has_product_timestamp ()
 Check if a product timestamp is present.
double get_product_timestamp ()
 Get the product timestamp.
void set_product_source (std::string source)
 Set product source, optional. This is meant to contextualize where this product is from, eg which satellite.
bool has_product_source ()
 Check if a product source is present.
std::string get_product_source ()
 Get the product source.
void set_product_id (std::string id)
 Set product ID, optional. This is meant to, for example, differentiate several identical instruments.
bool has_product_id ()
 Check if a product ID is present.
std::string get_product_id ()
 Get the product ID.
virtual void save (std::string directory)
 Save the product. Depending on the type this will save a product.cbor and other files in the same directory (eg, images)
virtual void load (std::string file)
 Load the product. This should refer to the product.cbor file.

Public Attributes

nlohmann::json contents
std::string instrument_name
std::string type

Detailed Description

Core SatDump product class.

This is the base class of all products, images or anything else. They should ONLY be loaded using the loadProducts() function!

Parameters
contentsraw JSON product data and/or description. Usually not accessed directly
instrument_namename (ID) of the instrument that generated the data, or other ID type if needed
typetype of the product, set by the class using this as a base

Member Function Documentation

◆ get_product_id()

std::string satdump::products::Product::get_product_id ( )
inline

Get the product ID.

Returns
the ID

◆ get_product_source()

std::string satdump::products::Product::get_product_source ( )
inline

Get the product source.

Returns
source name

◆ get_product_timestamp()

double satdump::products::Product::get_product_timestamp ( )
inline

Get the product timestamp.

Returns
UNIX timestamp

◆ has_product_id()

bool satdump::products::Product::has_product_id ( )
inline

Check if a product ID is present.

Returns
true if present

◆ has_product_source()

bool satdump::products::Product::has_product_source ( )
inline

Check if a product source is present.

Returns
true if present

◆ has_product_timestamp()

bool satdump::products::Product::has_product_timestamp ( )
inline

Check if a product timestamp is present.

Returns
true if present

◆ load()

void satdump::products::Product::load ( std::string file)
virtual

Load the product. This should refer to the product.cbor file.

Parameters
filecbor file to load

Reimplemented in satdump::products::ImageProduct, and satdump::products::PunctiformProduct.

◆ save()

void satdump::products::Product::save ( std::string directory)
virtual

Save the product. Depending on the type this will save a product.cbor and other files in the same directory (eg, images)

Parameters
directorydirectory to save into

Reimplemented in satdump::products::ImageProduct, and satdump::products::PunctiformProduct.

◆ set_product_id()

void satdump::products::Product::set_product_id ( std::string id)
inline

Set product ID, optional. This is meant to, for example, differentiate several identical instruments.

Parameters
idproduct ID

◆ set_product_source()

void satdump::products::Product::set_product_source ( std::string source)
inline

Set product source, optional. This is meant to contextualize where this product is from, eg which satellite.

Parameters
sourceproduct source name

◆ set_product_timestamp()

void satdump::products::Product::set_product_timestamp ( double timestamp)
inline

Set product timestamp, optional. This is usually the rough creation time / acquisition time.

Parameters
timestampUNIX timestamp

The documentation for this class was generated from the following files:
  • src-core/products/product.h
  • src-core/products/product.cpp