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

Class handling 2D transforms, mainly intended for image channels. This covers a simple but pretty important problem : More...

#include <channel_transform.h>

Public Types

enum  transform_type_t {
  TYPE_INVALID = 0 , TYPE_NONE = 1 , TYPE_AFFINE = 2 , TYPE_AFFINE_SLANTX = 3 ,
  TYPE_AFFINE_INTERPX = 4 , TYPE_INTERP_XY = 5
}

Public Member Functions

ChannelTransforminit_none ()
 Initialize a NONE transform.
ChannelTransforminit_affine (double a_x, double a_y, double b_x, double b_y)
 Initialize an AFFINE transform.
ChannelTransforminit_affine_slantx (double a_x, double a_y, double b_x, double b_y, double slantx_center, double slantx_ampli)
 Initialize an AFFINE_SLANTX transform.
ChannelTransforminit_affine_interpx (double a_x, double a_y, double b_x, double b_y, std::vector< std::pair< double, double > > interpx_points)
 Initialize an AFFINE_INTERPX transform.
ChannelTransforminit_interp_xy (std::vector< std::pair< std::pair< double, double >, std::pair< double, double > > > interp_xy_points)
transform_type_t getType ()
 Get type of this transform.
void render ()
 Render ImGui UI to edit the transform.
void forward (double *x, double *y) const
 Convert channel coordinates to reference coordinates.
void reverse (double *x, double *y) const
 Convert reference coordinates to channel coordinates.

Friends

void to_json (nlohmann::json &j, const ChannelTransform &v)
void from_json (const nlohmann::json &j, ChannelTransform &v)

Detailed Description

Class handling 2D transforms, mainly intended for image channels. This covers a simple but pretty important problem :

Quite often, instrument channels are NOT perfectly aligned... Or the same resolution. This therefore requires the ability to shift them around and re-scale them. However, it often gets more complicated than that. For example, MWS (on AWS) or KMSS are made out of several detectors that are not scanning on the same axis, therefore they also need to be rotated around to align channels.

Instead of pre-aligning them and discarding data, or handling those cases specifically, this class defines several common or arbitrary transforms to convert each channel to a "reference" field. Therefore, by taking a channel's 2D X/Y coordinates, running it through its own reference's forward and then the target channel's reverse will give the equivalent coordinates on the other channel.

Available transforms are :

  • 0, Invalid : Default, throws an exception
  • 1, None : Does nothing, use if no transform is required between channels
  • 2, Affine : ax + b form applied on both axis, meant for simple translations and resolution changes
  • 3, Affine Slant X : Combines the affine transform and a shift in y identical at any point in x
  • 4, Affine + Arbtitrary interpolation on the X axis (eg, for VIIRS with discountinuties between channels)
  • 5, TODOREWORK

Member Function Documentation

◆ forward()

void satdump::ChannelTransform::forward ( double * x,
double * y ) const
inline

Convert channel coordinates to reference coordinates.

Parameters
xcoordinate to be transformed
ycoordinate to be transformed

◆ getType()

ChannelTransform::transform_type_t satdump::ChannelTransform::getType ( )

Get type of this transform.

Returns
type of the transform

◆ init_affine()

ChannelTransform & satdump::ChannelTransform::init_affine ( double a_x,
double a_y,
double b_x,
double b_y )

Initialize an AFFINE transform.

Parameters
a_xaffine a for x axis
a_yaffine a for y axis
b_xaffine b for x axis
b_yaffine b for y axis

◆ init_affine_interpx()

ChannelTransform & satdump::ChannelTransform::init_affine_interpx ( double a_x,
double a_y,
double b_x,
double b_y,
std::vector< std::pair< double, double > > interpx_points )

Initialize an AFFINE_INTERPX transform.

Parameters
a_xaffine a for x axis
a_yaffine a for y axis
b_xaffine b for x axis
b_yaffine b for y axis
interpx_pointspoints for x axis interpolation

◆ init_affine_slantx()

ChannelTransform & satdump::ChannelTransform::init_affine_slantx ( double a_x,
double a_y,
double b_x,
double b_y,
double slantx_center,
double slantx_ampli )

Initialize an AFFINE_SLANTX transform.

Parameters
a_xaffine a for x axis
a_yaffine a for y axis
b_xaffine b for x axis
b_yaffine b for y axis
slantx_centercenter of the slant on the x axis
slantx_amplimultiplicator applied after substracting center

◆ init_none()

ChannelTransform & satdump::ChannelTransform::init_none ( )

Initialize a NONE transform.

Parameters

◆ render()

void satdump::ChannelTransform::render ( )

Render ImGui UI to edit the transform.

Parameters

◆ reverse()

void satdump::ChannelTransform::reverse ( double * x,
double * y ) const
inline

Convert reference coordinates to channel coordinates.

Parameters
xcoordinate to be transformed
ycoordinate to be transformed

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