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

SatDump image product class. More...

#include <image_product.h>

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

Classes

struct  ImageHolder
 Struct holding both the image and some metadata. More...

Public Member Functions

void set_proj_cfg (nlohmann::json cfg)
 Set geo projection config in the product.
void set_proj_cfg_tle_timestamps (nlohmann::json cfg, nlohmann::json tle, nlohmann::json timestamps)
 Set geo projection config in the product, with a TLE and timestamps.
nlohmann::json get_proj_cfg (int channel)
 Get geo projection config in the product, if present.
bool has_proj_cfg ()
 Check if geo projection info is present.
void set_calibration (std::string calibrator, nlohmann::json cfg)
std::pair< std::string, nlohmann::json > get_calibration ()
bool has_calibration ()
 Check if calibration info is present.
nlohmann::json get_calibration_raw ()
ImageHolderget_channel_image (int index)
 Get image channel by absolute ID.
ImageHolderget_channel_image (std::string name)
 Get image channel by name.
ImageHolderget_channel_image_by_wavenumber (double wavenumber)
 Get image channel by wavenumber. Returns the closest one.
ImageHolderget_channel_image_by_unitstr (std::string str)
 Get image channel by unit string. Returns the closest one.
int get_channel_image_idx (std::string name)
 Get image channel raw ID by name.
int get_raw_channel_val (int idx, int x, int y)
 Get raw channel count.
void set_channel_wavenumber (int index, double wavenumber)
 Set channel wavenumber.
void set_channel_frequency (int index, double frequency)
 Set channel frequency (internally, wavenumber)
double get_channel_wavenumber (int index)
 Get channel wavenumber.
double get_channel_frequency (int index)
 Get channel frequency.
void set_channel_unit (int index, std::string type_or_unit)
 Set channel calibration unit.
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 Member Functions inherited from satdump::products::Product
 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.

Public Attributes

std::vector< ImageHolderimages
bool save_as_matrix = false
bool d_no_not_save_images = false
bool d_no_not_load_images = false
Public Attributes inherited from satdump::products::Product
nlohmann::json contents
std::string instrument_name
std::string type

Detailed Description

SatDump image product class.

This is mainly intended for Earth imaging instruments, with one or more spectral channel (AVHRR, MODIS...).

It contains and allows if possible :

  • Geographic referencing
  • Spectral calibration or other physical units
  • Dynamic correlation between channels with transforms
Parameters
imagesraw image structs containing channel descriptions and images
save_as_matrixif enabled, saves all image channels in a single matrix. All images MUST be of the exact same resolution (useful for eg, IASI)
d_no_not_save_imagesadvanced parameter, telling it to save the product without saving the image channels, mainly meant for saving in async ways
d_no_not_load_imagesadvanced parameter, telling it not to load images but only the CBOR, mainly meant to edit it more efficiently

Member Function Documentation

◆ get_channel_frequency()

double satdump::products::ImageProduct::get_channel_frequency ( int index)
inline

Get channel frequency.

Parameters
indexabsolute channel index
Returns
channel frequency in Hz

◆ get_channel_image() [1/2]

ImageHolder & satdump::products::ImageProduct::get_channel_image ( int index)
inline

Get image channel by absolute ID.

Parameters
indexabsolute channel index
Returns
the image channel struct

◆ get_channel_image() [2/2]

ImageHolder & satdump::products::ImageProduct::get_channel_image ( std::string name)
inline

Get image channel by name.

Parameters
namechannel name
Returns
the image channel struct

◆ get_channel_image_by_unitstr()

ImageHolder & satdump::products::ImageProduct::get_channel_image_by_unitstr ( std::string str)
inline

Get image channel by unit string. Returns the closest one.

Parameters
strUnit string
Returns
the image channel struct

◆ get_channel_image_by_wavenumber()

ImageHolder & satdump::products::ImageProduct::get_channel_image_by_wavenumber ( double wavenumber)
inline

Get image channel by wavenumber. Returns the closest one.

Parameters
doublewavenumber
Returns
the image channel struct

◆ get_channel_image_idx()

int satdump::products::ImageProduct::get_channel_image_idx ( std::string name)
inline

Get image channel raw ID by name.

Parameters
namechannel name
Returns
the image channel ID (NOT abs_id!!)

◆ get_channel_wavenumber()

double satdump::products::ImageProduct::get_channel_wavenumber ( int index)
inline

Get channel wavenumber.

Parameters
indexabsolute channel index
Returns
channel wavenumber

◆ get_proj_cfg()

nlohmann::json satdump::products::ImageProduct::get_proj_cfg ( int channel)
inline

Get geo projection config in the product, if present.

Parameters
channelchannel absolute index. If -1 returns global config (for experts!)
Returns
projection config as JSON object

◆ get_raw_channel_val()

int satdump::products::ImageProduct::get_raw_channel_val ( int idx,
int x,
int y )
inline

Get raw channel count.

Parameters
idxchannel index (NOT abs_idx!!!)
xposition in image
yposition in image

◆ has_calibration()

bool satdump::products::ImageProduct::has_calibration ( )
inline

Check if calibration info is present.

Returns
true if present

◆ has_proj_cfg()

bool satdump::products::ImageProduct::has_proj_cfg ( )
inline

Check if geo projection info is present.

Returns
true if present

◆ load()

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

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

Parameters
filecbor file to load

Reimplemented from satdump::products::Product.

◆ save()

void satdump::products::ImageProduct::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 from satdump::products::Product.

◆ set_channel_frequency()

void satdump::products::ImageProduct::set_channel_frequency ( int index,
double frequency )
inline

Set channel frequency (internally, wavenumber)

Parameters
indexabsolute channel index
frequencyfrequency value, in Hz

◆ set_channel_unit()

void satdump::products::ImageProduct::set_channel_unit ( int index,
std::string type_or_unit )
inline

Set channel calibration unit.

Parameters
indexabsolute channel index
typetype of calibration (ID). If non-standard, this can be an arbitrary string such as the unit instead

◆ set_channel_wavenumber()

void satdump::products::ImageProduct::set_channel_wavenumber ( int index,
double wavenumber )
inline

Set channel wavenumber.

Parameters
indexabsolute channel index
wavenumberwavenumber value

◆ set_proj_cfg()

void satdump::products::ImageProduct::set_proj_cfg ( nlohmann::json cfg)
inline

Set geo projection config in the product.

Parameters
cfgprojection config. Must contain all applicable metadata

◆ set_proj_cfg_tle_timestamps()

void satdump::products::ImageProduct::set_proj_cfg_tle_timestamps ( nlohmann::json cfg,
nlohmann::json tle,
nlohmann::json timestamps )
inline

Set geo projection config in the product, with a TLE and timestamps.

Parameters
cfgprojection config.
tlethe TLE
timestampsthe timestamps

The documentation for this class was generated from the following files: