Skip to content

Class astrea::trace::RiseSetArray

ClassList > astrea > trace > RiseSetArray

Represents an array of rise and set times. More...

  • #include <RiseSetArray.hpp>

Public Types

Type Name
typedef std::vector< Time >::const_iterator const_iterator
Constant iterator type for the RiseSetArray .
typedef std::vector< Time >::iterator iterator
Iterator type for the RiseSetArray .

Public Functions

Type Name
RiseSetArray () = default
Default constructor for RiseSetArray .
RiseSetArray (const std::vector< Time > & risesets)
Constructs a RiseSetArray from a vector of Time objects.
RiseSetArray (const RiseSetArray & other)
Copy constructor for RiseSetArray .
RiseSetArray (RiseSetArray && other) noexcept
Move constructor for RiseSetArray .
Time access_time (const StatType & stat=StatType::AVG, const Unitless percentile=0.5) const
Calculates the access time based on rise and set times.
void append (const Time & rise, const Time & set)
Appends a rise and set time to the array.
Time average_daily_vis_time () const
Calculates the average daily visibility time based on the rise and set times.
iterator begin ()
Returns an iterator to the beginning of the RiseSetArray .
const_iterator begin () const
Returns a constant iterator to the beginning of the RiseSetArray .
const_iterator cbegin () const
Returns a constant iterator to the beginning of the RiseSetArray .
const_iterator cend () const
Returns a constant iterator to the end of the RiseSetArray .
iterator end ()
Returns an iterator to the end of the RiseSetArray .
const_iterator end () const
Returns a constant iterator to the end of the RiseSetArray .
Time gap (const StatType & stat=StatType::AVG, const Unitless percentile=0.5) const
Calculates the gap between rise and set times.
std::vector< Time > get_access_times () const
Get a vector of access durations for this rise-set array.
std::vector< Time > get_gap_times () const
Get a vector of gap durations for this rise-set array.
bool has_access (const Time & time) const
Checks if the given time occurs during an access window.
void insert (const Time & rise, const Time & set)
Inserts a rise and set time at the end of the array.
Time mean_time_to_access () const
Calculates the mean time to access (MTTA) for this RiseSetArray .
RiseSetArray operator& (const RiseSetArray & other) const
Intersection operator to find common rise/set pairs between two RiseSetArray objects.
RiseSetArray & operator&= (const RiseSetArray & other)
In-place intersection operator to find common rise/set pairs between two RiseSetArray objects.
RiseSetArray operator- (const RiseSetArray & other) const
Difference operator to subtract one RiseSetArray from another.
RiseSetArray & operator-= (const RiseSetArray & other)
In-place difference operator to subtract one RiseSetArray from another.
RiseSetArray & operator= (RiseSetArray && other) noexcept
Move assignment operator for RiseSetArray .
RiseSetArray & operator= (const RiseSetArray & other)
Copy assignment operator for RiseSetArray .
bool operator== (const RiseSetArray & other) const
Equality operator to compare two RiseSetArray objects.
Time & operator[] (const std::size_t & ind)
Returns a reference to the rise/set pair at the specified index.
const Time & operator[] (const std::size_t & ind) const
Returns a const reference to the rise/set pair at the specified index.
RiseSetArray operator| (const RiseSetArray & other) const
Union operator to combine two RiseSetArray objects.
RiseSetArray & operator|= (const RiseSetArray & other)
In-place union operator to combine two RiseSetArray objects.
void prepend (const Time & rise, const Time & set)
Prepends a rise and set time to the array.
std::size_t size () const
Returns the number of rise/set pairs in the array.
std::vector< std::string > to_string_vector () const
Converts the RiseSetArray to a vector of formatted strings.
~RiseSetArray () = default
Destructor for RiseSetArray .

Detailed Description

This class provides functionality to manage and manipulate an array of rise and set times, including operations like addition, subtraction, intersection, and union of rise/set pairs.

Public Types Documentation

typedef const_iterator

Constant iterator type for the RiseSetArray .

using astrea::trace::RiseSetArray::const_iterator =  std::vector<Time>::const_iterator;


typedef iterator

Iterator type for the RiseSetArray .

using astrea::trace::RiseSetArray::iterator =  std::vector<Time>::iterator;


Public Functions Documentation

function RiseSetArray [1/4]

Default constructor for RiseSetArray .

astrea::trace::RiseSetArray::RiseSetArray () = default

Initializes an empty RiseSetArray.


function RiseSetArray [2/4]

Constructs a RiseSetArray from a vector of Time objects.

astrea::trace::RiseSetArray::RiseSetArray (
    const std::vector< Time > & risesets
) 

Parameters:

  • risesets A vector of Time objects representing rise and set times.

function RiseSetArray [3/4]

Copy constructor for RiseSetArray .

astrea::trace::RiseSetArray::RiseSetArray (
    const RiseSetArray & other
) 

Parameters:


function RiseSetArray [4/4]

Move constructor for RiseSetArray .

astrea::trace::RiseSetArray::RiseSetArray (
    RiseSetArray && other
) noexcept

Parameters:


function access_time

Calculates the access time based on rise and set times.

Time astrea::trace::RiseSetArray::access_time (
    const StatType & stat=StatType::AVG,
    const Unitless percentile=0.5
) const

Parameters:

  • stat The statistical measure to calculate (MIN, MEAN, MAX, PCT).
  • percentile The percentile to calculate if stat is PCT (between 0 and 1).

Returns:

Time The calculated access time based on the specified statistic.


function append

Appends a rise and set time to the array.

void astrea::trace::RiseSetArray::append (
    const Time & rise,
    const Time & set
) 

Parameters:

  • rise The rise time to append.
  • set The set time to append.

Exception:

  • std::invalid_argument If the rise time is not before the set time.
  • std::invalid_argument If the rise and set times are not in chronological order.
  • std::invalid_argument If the rise and set times are not valid.

function average_daily_vis_time

Calculates the average daily visibility time based on the rise and set times.

Time astrea::trace::RiseSetArray::average_daily_vis_time () const

Returns:

Time The calculated average daily visibility time.


function begin [1/2]

Returns an iterator to the beginning of the RiseSetArray .

iterator astrea::trace::RiseSetArray::begin () 

Returns:

iterator An iterator to the beginning of the RiseSetArray.


function begin [2/2]

Returns a constant iterator to the beginning of the RiseSetArray .

const_iterator astrea::trace::RiseSetArray::begin () const

Returns:

const_iterator A constant iterator to the beginning of the RiseSetArray.


function cbegin

Returns a constant iterator to the beginning of the RiseSetArray .

const_iterator astrea::trace::RiseSetArray::cbegin () const

Returns:

const_iterator A constant iterator to the beginning of the RiseSetArray.


function cend

Returns a constant iterator to the end of the RiseSetArray .

const_iterator astrea::trace::RiseSetArray::cend () const

Returns:

const_iterator A constant iterator to the end of the RiseSetArray.


function end [1/2]

Returns an iterator to the end of the RiseSetArray .

iterator astrea::trace::RiseSetArray::end () 

Returns:

iterator An iterator to the end of the RiseSetArray.


function end [2/2]

Returns a constant iterator to the end of the RiseSetArray .

const_iterator astrea::trace::RiseSetArray::end () const

Returns:

const_iterator A constant iterator to the end of the RiseSetArray.


function gap

Calculates the gap between rise and set times.

Time astrea::trace::RiseSetArray::gap (
    const StatType & stat=StatType::AVG,
    const Unitless percentile=0.5
) const

Parameters:

  • stat The statistical measure to calculate (MIN, MEAN, MAX, PCT).
  • percentile The percentile to calculate if stat is PCT (between 0 and 1).

Returns:

Time The calculated gap based on the specified statistic.


function get_access_times

Get a vector of access durations for this rise-set array.

std::vector< Time > astrea::trace::RiseSetArray::get_access_times () const

Returns:

std::vector<Time> Vector of access durations in the order that they appear


function get_gap_times

Get a vector of gap durations for this rise-set array.

std::vector< Time > astrea::trace::RiseSetArray::get_gap_times () const

Returns:

std::vector<Time> Vector of gap durations in the order that they appear


function has_access

Checks if the given time occurs during an access window.

bool astrea::trace::RiseSetArray::has_access (
    const Time & time
) const

Parameters:

  • time Time to check for access

Returns:

true if time occurs during an access windows

Returns:

false if time occurs during a gap


function insert

Inserts a rise and set time at the end of the array.

void astrea::trace::RiseSetArray::insert (
    const Time & rise,
    const Time & set
) 

Parameters:

  • rise The rise time to insert.
  • set The set time to insert.

Exception:

  • std::invalid_argument If the rise time is not before the set time.
  • std::invalid_argument If the rise and set times are not in chronological order.
  • std::invalid_argument If the rise and set times are not valid.

function mean_time_to_access

Calculates the mean time to access (MTTA) for this RiseSetArray .

Time astrea::trace::RiseSetArray::mean_time_to_access () const

Returns:

Time The calculated mean time to access based on the rise and set times.

Note:

access: |<gap-->|<access-->|<-gap->|<access-->|... | | | | |... tta: |\ | | | |... |+\ | | | |... |++\ | |\ | |... |+++\ | |+\ | |... |++++\ | |++\ | |... |+++++\ | |+++\ | |... |++++++\ | |++++\ | |... |+++++++\ | |+++++\ | |... |++++++++|____________|++++++|____________|...

MMTA is the mean time to access, or the mean height of the shaded regions MMTA = 0.5 * sqrt(gap0^2 + gap1^2 + ...)


function operator&

Intersection operator to find common rise/set pairs between two RiseSetArray objects.

RiseSetArray astrea::trace::RiseSetArray::operator& (
    const RiseSetArray & other
) const

Parameters:

Returns:

RiseSetArray A new RiseSetArray containing the intersection of the two.


function operator&=

In-place intersection operator to find common rise/set pairs between two RiseSetArray objects.

RiseSetArray & astrea::trace::RiseSetArray::operator&= (
    const RiseSetArray & other
) 

Parameters:

Returns:

RiseSetArray& Reference to this RiseSetArray after the intersection.


function operator-

Difference operator to subtract one RiseSetArray from another.

RiseSetArray astrea::trace::RiseSetArray::operator- (
    const RiseSetArray & other
) const

Parameters:

Returns:

RiseSetArray A new RiseSetArray containing the result of the subtraction.


function operator-=

In-place difference operator to subtract one RiseSetArray from another.

RiseSetArray & astrea::trace::RiseSetArray::operator-= (
    const RiseSetArray & other
) 

Parameters:

Returns:

RiseSetArray& Reference to this RiseSetArray after the subtraction.


function operator=

Move assignment operator for RiseSetArray .

RiseSetArray & astrea::trace::RiseSetArray::operator= (
    RiseSetArray && other
) noexcept

Parameters:

Returns:

RiseSetArray& Reference to this RiseSetArray after the move.


function operator=

Copy assignment operator for RiseSetArray .

RiseSetArray & astrea::trace::RiseSetArray::operator= (
    const RiseSetArray & other
) 

Parameters:

Returns:

RiseSetArray& Reference to this RiseSetArray after the copy.


function operator==

Equality operator to compare two RiseSetArray objects.

bool astrea::trace::RiseSetArray::operator== (
    const RiseSetArray & other
) const

Parameters:

Returns:

true If the two RiseSetArray objects are equal.

Returns:

false If the two RiseSetArray objects are not equal.


function operator[]

Returns a reference to the rise/set pair at the specified index.

Time & astrea::trace::RiseSetArray::operator[] (
    const std::size_t & ind
) 

Parameters:

  • ind The index of the rise/set pair to access.

Returns:

Time& A reference to the rise/set pair at the specified index.


function operator[]

Returns a const reference to the rise/set pair at the specified index.

const Time & astrea::trace::RiseSetArray::operator[] (
    const std::size_t & ind
) const

Parameters:

  • ind The index of the rise/set pair to access.

Returns:

const Time& A const reference to the rise/set pair at the specified index.


function operator|

Union operator to combine two RiseSetArray objects.

RiseSetArray astrea::trace::RiseSetArray::operator| (
    const RiseSetArray & other
) const

Parameters:

Returns:

RiseSetArray A new RiseSetArray containing the union of the two.


function operator|=

In-place union operator to combine two RiseSetArray objects.

RiseSetArray & astrea::trace::RiseSetArray::operator|= (
    const RiseSetArray & other
) 

Parameters:

Returns:

RiseSetArray& Reference to this RiseSetArray after the union.


function prepend

Prepends a rise and set time to the array.

void astrea::trace::RiseSetArray::prepend (
    const Time & rise,
    const Time & set
) 

Parameters:

  • rise The rise time to prepend.
  • set The set time to prepend.

Exception:

  • std::invalid_argument If the rise time is not before the set time.
  • std::invalid_argument If the rise and set times are not in chronological order.
  • std::invalid_argument If the rise and set times are not valid.

function size

Returns the number of rise/set pairs in the array.

std::size_t astrea::trace::RiseSetArray::size () const

Returns:

std::size_t The number of rise/set pairs.


function to_string_vector

Converts the RiseSetArray to a vector of formatted strings.

std::vector< std::string > astrea::trace::RiseSetArray::to_string_vector () const

Returns:

std::vector<std::string> A vector of formatted strings representing the rise and set times.


function ~RiseSetArray

Destructor for RiseSetArray .

astrea::trace::RiseSetArray::~RiseSetArray () = default



The documentation for this class was generated from the following file astrea/trace/trace/risesets/RiseSetArray.hpp