Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | Related Functions
bsta_spherical_histogram< T > Class Template Reference

A histogram on the unit sphere. More...

#include <bsta_spherical_histogram.h>

List of all members.

Public Types

enum  ang_units { RADIANS, DEG }
enum  angle_bounds { B_0_360, B_180_180, B_0_180, B_90_90 }

Public Member Functions

 bsta_spherical_histogram ()
 bsta_spherical_histogram (unsigned n_azimuth, unsigned n_elevation, T azimuth_start, T azimuth_range, T elevation_start, T elevation_range, ang_units units=DEG, angle_bounds az_branch_cut=B_180_180, angle_bounds el_poles=B_90_90)
 ~bsta_spherical_histogram ()
ang_units units () const
 angle units e.g. RADIANS, DEG.
angle_bounds azimuth_branch_cut () const
 discontinuity azimuthal angle coordinates.
angle_bounds elevation_poles () const
 location of north and south poles on the sphere.
unsigned n_azimuth () const
 number of bins allowed.
unsigned n_elevation () const
int azimuth_index (T azimuth) const
 indices for individual spherical coordinates.
int elevation_index (T elevation) const
int linear_index (int azimuth_index, int elevation_index) const
 1-d linear indices.
int lin_index (T azimuth, T elevation)
 function name different since T could be int.
azimuth_start () const
 azimuth bounds.
azimuth_range () const
elevation_start () const
 elevation bounds.
elevation_range () const
void azimuth_interval (int azimuth_index, T &azimuth_start, T &azimuth_range) const
void azimuth_interval (T azimuth, T &azimuth_start, T &azimuth_range) const
void elevation_interval (int elevation_index, T &elevation_start, T &elevation_range) const
void elevation_interval (T elevation, T &elevation_start, T &elevation_range) const
azimuth_center (int azimuth_index) const
elevation_center (int elevation_index) const
void center (int linear_index, T &az_center, T &el_center)
void upcount (T azimuth, T elevation, T mag=T(1.0))
 increment the count in a given bin by mag.
void upcount_weighted_by_area (T azimuth, T elevation, T mag=T(1.0))
 weight the increment by spherical area of the bin, i.e. mag/sin(el).
counts (int azimuth_index, int elevation_index)
 counts in a specified bin.
counts (T azimuth, T elevation)
counts (int linear_index)
total_counts ()
 total number of counts, cached so non-const.
p (int azimuth_index, int elevation_index)
 probability of a bin.
p (T azimuth, T elevation)
void mean (T &mean_az, T &mean_el)
 mean of histogram distribution.
vnl_matrix_fixed< T, 2, 2 > covariance_matrix ()
 covariance matrix of histogram cvar = [(az-mu_az)][(az-mu_az) (el-mu_el)].
void std_dev (T &std_dev_az, T &std_dev_el)
 marginal standard deviations.
vcl_vector< int > bins_intersecting_cone (T center_az, T center_el, T cone_half_angle)
 linear index of bins which have centers lying inside the cone.
void write_counts_with_interval (vcl_ostream &os, int azimuth_index, int elevation_index)
 output of bin ranges and counts (zero counts not output).
void write_counts_with_center (vcl_ostream &os, int azimuth_index, int elevation_index)
 output of bin center and counts (zero counts not output).
void print_to_text (vcl_ostream &os)
 write bin centers (azimuth elevation) and non_zero counts to stream.
void print_to_vrml (vcl_ostream &os, T transparency=T(0))
 display counts in vrml with reference sphere.
void convert_to_cartesian (T azimuth, T elevation, T &x, T &y, T &z) const
 convenient utilities.
void convert_to_spherical (T x, T y, T z, T &azimuth, T &elevation) const

Static Public Member Functions

static T deg_to_rad (T ang)
 unit conversions.
static T rad_to_deg (T ang)

Private Attributes

unsigned n_azimuth_
 members.
unsigned n_elevation_
azimuth_start_
azimuth_range_
elevation_start_
elevation_range_
delta_az_
delta_el_
angle_bounds az_branch_cut_
angle_bounds el_poles_
ang_units units_
bool total_counts_valid_
total_counts_
vcl_map< int, T > counts_

Related Functions

(Note that these are not member functions.)

template<class T >
vcl_ostream & operator<< (vcl_ostream &s, bsta_spherical_histogram< T > const &h)
 Write histogram to stream.
template<class T >
vcl_istream & operator>> (vcl_istream &is, bsta_spherical_histogram< T > &h)
 Read histogram from stream.

Detailed Description

template<class T>
class bsta_spherical_histogram< T >

A histogram on the unit sphere.

Definition at line 47 of file bsta_spherical_histogram.h.


Member Enumeration Documentation

template<class T>
enum bsta_spherical_histogram::ang_units
Enumerator:
RADIANS 
DEG 

Definition at line 50 of file bsta_spherical_histogram.h.

Enumerator:
B_0_360 
B_180_180 
B_0_180 
B_90_90 

Definition at line 51 of file bsta_spherical_histogram.h.


Constructor & Destructor Documentation

template<class T >
bsta_spherical_histogram< T >::bsta_spherical_histogram ( )

Definition at line 55 of file bsta_spherical_histogram.txx.

template<class T >
bsta_spherical_histogram< T >::bsta_spherical_histogram ( unsigned  n_azimuth,
unsigned  n_elevation,
azimuth_start,
azimuth_range,
elevation_start,
elevation_range,
ang_units  units = DEG,
angle_bounds  az_branch_cut = B_180_180,
angle_bounds  el_poles = B_90_90 
)

Definition at line 66 of file bsta_spherical_histogram.txx.

template<class T>
bsta_spherical_histogram< T >::~bsta_spherical_histogram ( ) [inline]

Definition at line 60 of file bsta_spherical_histogram.h.


Member Function Documentation

template<class T>
angle_bounds bsta_spherical_histogram< T >::azimuth_branch_cut ( ) const [inline]

discontinuity azimuthal angle coordinates.

Definition at line 65 of file bsta_spherical_histogram.h.

template<class T >
T bsta_spherical_histogram< T >::azimuth_center ( int  azimuth_index) const

Definition at line 140 of file bsta_spherical_histogram.txx.

template<class T >
int bsta_spherical_histogram< T >::azimuth_index ( azimuth) const

indices for individual spherical coordinates.

Definition at line 246 of file bsta_spherical_histogram.txx.

template<class T >
void bsta_spherical_histogram< T >::azimuth_interval ( int  azimuth_index,
T &  azimuth_start,
T &  azimuth_range 
) const

Definition at line 290 of file bsta_spherical_histogram.txx.

template<class T>
void bsta_spherical_histogram< T >::azimuth_interval ( azimuth,
T &  azimuth_start,
T &  azimuth_range 
) const [inline]

Definition at line 92 of file bsta_spherical_histogram.h.

template<class T >
T bsta_spherical_histogram< T >::azimuth_range ( ) const

Definition at line 112 of file bsta_spherical_histogram.txx.

template<class T >
T bsta_spherical_histogram< T >::azimuth_start ( ) const

azimuth bounds.

Definition at line 100 of file bsta_spherical_histogram.txx.

template<class T >
vcl_vector< int > bsta_spherical_histogram< T >::bins_intersecting_cone ( center_az,
center_el,
cone_half_angle 
)

linear index of bins which have centers lying inside the cone.

Definition at line 474 of file bsta_spherical_histogram.txx.

template<class T >
void bsta_spherical_histogram< T >::center ( int  linear_index,
T &  az_center,
T &  el_center 
)

Definition at line 171 of file bsta_spherical_histogram.txx.

template<class T >
void bsta_spherical_histogram< T >::convert_to_cartesian ( azimuth,
elevation,
T &  x,
T &  y,
T &  z 
) const

convenient utilities.

Definition at line 182 of file bsta_spherical_histogram.txx.

template<class T >
void bsta_spherical_histogram< T >::convert_to_spherical ( x,
y,
z,
T &  azimuth,
T &  elevation 
) const

Definition at line 204 of file bsta_spherical_histogram.txx.

template<class T>
T bsta_spherical_histogram< T >::counts ( int  azimuth_index,
int  elevation_index 
) [inline]

counts in a specified bin.

Definition at line 114 of file bsta_spherical_histogram.h.

template<class T>
T bsta_spherical_histogram< T >::counts ( azimuth,
elevation 
) [inline]

Definition at line 123 of file bsta_spherical_histogram.h.

template<class T>
T bsta_spherical_histogram< T >::counts ( int  linear_index) [inline]

Definition at line 129 of file bsta_spherical_histogram.h.

template<class T >
vnl_matrix_fixed< T, 2, 2 > bsta_spherical_histogram< T >::covariance_matrix ( )

covariance matrix of histogram cvar = [(az-mu_az)][(az-mu_az) (el-mu_el)].

[(el-mu_el)]

Definition at line 419 of file bsta_spherical_histogram.txx.

template<class T>
static T bsta_spherical_histogram< T >::deg_to_rad ( ang) [inline, static]

unit conversions.

Definition at line 158 of file bsta_spherical_histogram.h.

template<class T >
T bsta_spherical_histogram< T >::elevation_center ( int  elevation_index) const

Definition at line 156 of file bsta_spherical_histogram.txx.

template<class T >
int bsta_spherical_histogram< T >::elevation_index ( elevation) const

Definition at line 268 of file bsta_spherical_histogram.txx.

template<class T >
void bsta_spherical_histogram< T >::elevation_interval ( int  elevation_index,
T &  elevation_start,
T &  elevation_range 
) const

Definition at line 318 of file bsta_spherical_histogram.txx.

template<class T>
void bsta_spherical_histogram< T >::elevation_interval ( elevation,
T &  elevation_start,
T &  elevation_range 
) const [inline]

Definition at line 99 of file bsta_spherical_histogram.h.

template<class T>
angle_bounds bsta_spherical_histogram< T >::elevation_poles ( ) const [inline]

location of north and south poles on the sphere.

Definition at line 67 of file bsta_spherical_histogram.h.

template<class T >
T bsta_spherical_histogram< T >::elevation_range ( ) const

Definition at line 132 of file bsta_spherical_histogram.txx.

template<class T >
T bsta_spherical_histogram< T >::elevation_start ( ) const

elevation bounds.

Definition at line 121 of file bsta_spherical_histogram.txx.

template<class T>
int bsta_spherical_histogram< T >::lin_index ( azimuth,
elevation 
) [inline]

function name different since T could be int.

Definition at line 80 of file bsta_spherical_histogram.h.

template<class T>
int bsta_spherical_histogram< T >::linear_index ( int  azimuth_index,
int  elevation_index 
) const [inline]

1-d linear indices.

Definition at line 77 of file bsta_spherical_histogram.h.

template<class T >
void bsta_spherical_histogram< T >::mean ( T &  mean_az,
T &  mean_el 
)

mean of histogram distribution.

Definition at line 392 of file bsta_spherical_histogram.txx.

template<class T>
unsigned bsta_spherical_histogram< T >::n_azimuth ( ) const [inline]

number of bins allowed.

Definition at line 70 of file bsta_spherical_histogram.h.

template<class T>
unsigned bsta_spherical_histogram< T >::n_elevation ( ) const [inline]

Definition at line 71 of file bsta_spherical_histogram.h.

template<class T >
T bsta_spherical_histogram< T >::p ( int  azimuth_index,
int  elevation_index 
)

probability of a bin.

Definition at line 378 of file bsta_spherical_histogram.txx.

template<class T>
T bsta_spherical_histogram< T >::p ( azimuth,
elevation 
) [inline]

Definition at line 136 of file bsta_spherical_histogram.h.

template<class T >
void bsta_spherical_histogram< T >::print_to_text ( vcl_ostream &  os)

write bin centers (azimuth elevation) and non_zero counts to stream.

Definition at line 525 of file bsta_spherical_histogram.txx.

template<class T >
void bsta_spherical_histogram< T >::print_to_vrml ( vcl_ostream &  os,
transparency = T(0) 
)

display counts in vrml with reference sphere.

Definition at line 533 of file bsta_spherical_histogram.txx.

template<class T>
static T bsta_spherical_histogram< T >::rad_to_deg ( ang) [inline, static]

Definition at line 159 of file bsta_spherical_histogram.h.

template<class T >
void bsta_spherical_histogram< T >::std_dev ( T &  std_dev_az,
T &  std_dev_el 
)

marginal standard deviations.

Definition at line 464 of file bsta_spherical_histogram.txx.

template<class T >
T bsta_spherical_histogram< T >::total_counts ( )

total number of counts, cached so non-const.

Definition at line 365 of file bsta_spherical_histogram.txx.

template<class T>
ang_units bsta_spherical_histogram< T >::units ( ) const [inline]

angle units e.g. RADIANS, DEG.

Definition at line 63 of file bsta_spherical_histogram.h.

template<class T >
void bsta_spherical_histogram< T >::upcount ( azimuth,
elevation,
mag = T(1.0) 
)

increment the count in a given bin by mag.

Definition at line 341 of file bsta_spherical_histogram.txx.

template<class T >
void bsta_spherical_histogram< T >::upcount_weighted_by_area ( azimuth,
elevation,
mag = T(1.0) 
)

weight the increment by spherical area of the bin, i.e. mag/sin(el).

Definition at line 354 of file bsta_spherical_histogram.txx.

template<class T >
void bsta_spherical_histogram< T >::write_counts_with_center ( vcl_ostream &  os,
int  azimuth_index,
int  elevation_index 
)

output of bin center and counts (zero counts not output).

Definition at line 514 of file bsta_spherical_histogram.txx.

template<class T >
void bsta_spherical_histogram< T >::write_counts_with_interval ( vcl_ostream &  os,
int  azimuth_index,
int  elevation_index 
)

output of bin ranges and counts (zero counts not output).

Definition at line 499 of file bsta_spherical_histogram.txx.


Friends And Related Function Documentation

template<class T >
vcl_ostream & operator<< ( vcl_ostream &  s,
bsta_spherical_histogram< T > const &  h 
) [related]

Write histogram to stream.

template<class T >
vcl_istream & operator>> ( vcl_istream &  is,
bsta_spherical_histogram< T > &  h 
) [related]

Read histogram from stream.


Member Data Documentation

template<class T>
angle_bounds bsta_spherical_histogram< T >::az_branch_cut_ [private]

Definition at line 186 of file bsta_spherical_histogram.h.

template<class T>
T bsta_spherical_histogram< T >::azimuth_range_ [private]

Definition at line 181 of file bsta_spherical_histogram.h.

template<class T>
T bsta_spherical_histogram< T >::azimuth_start_ [private]

Definition at line 180 of file bsta_spherical_histogram.h.

template<class T>
vcl_map<int, T> bsta_spherical_histogram< T >::counts_ [private]

Definition at line 191 of file bsta_spherical_histogram.h.

template<class T>
T bsta_spherical_histogram< T >::delta_az_ [private]

Definition at line 184 of file bsta_spherical_histogram.h.

template<class T>
T bsta_spherical_histogram< T >::delta_el_ [private]

Definition at line 185 of file bsta_spherical_histogram.h.

template<class T>
angle_bounds bsta_spherical_histogram< T >::el_poles_ [private]

Definition at line 187 of file bsta_spherical_histogram.h.

template<class T>
T bsta_spherical_histogram< T >::elevation_range_ [private]

Definition at line 183 of file bsta_spherical_histogram.h.

template<class T>
T bsta_spherical_histogram< T >::elevation_start_ [private]

Definition at line 182 of file bsta_spherical_histogram.h.

template<class T>
unsigned bsta_spherical_histogram< T >::n_azimuth_ [private]

members.

Definition at line 178 of file bsta_spherical_histogram.h.

template<class T>
unsigned bsta_spherical_histogram< T >::n_elevation_ [private]

Definition at line 179 of file bsta_spherical_histogram.h.

template<class T>
T bsta_spherical_histogram< T >::total_counts_ [private]

Definition at line 190 of file bsta_spherical_histogram.h.

template<class T>
bool bsta_spherical_histogram< T >::total_counts_valid_ [private]

Definition at line 189 of file bsta_spherical_histogram.h.

template<class T>
ang_units bsta_spherical_histogram< T >::units_ [private]

Definition at line 188 of file bsta_spherical_histogram.h.


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