A histogram on the unit sphere. More...
#include <bsta_spherical_histogram.h>
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. | |
T | azimuth_start () const |
azimuth bounds. | |
T | azimuth_range () const |
T | elevation_start () const |
elevation bounds. | |
T | 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 |
T | azimuth_center (int azimuth_index) const |
T | 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). | |
T | counts (int azimuth_index, int elevation_index) |
counts in a specified bin. | |
T | counts (T azimuth, T elevation) |
T | counts (int linear_index) |
T | total_counts () |
total number of counts, cached so non-const. | |
T | p (int azimuth_index, int elevation_index) |
probability of a bin. | |
T | 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_ |
T | azimuth_start_ |
T | azimuth_range_ |
T | elevation_start_ |
T | elevation_range_ |
T | delta_az_ |
T | delta_el_ |
angle_bounds | az_branch_cut_ |
angle_bounds | el_poles_ |
ang_units | units_ |
bool | total_counts_valid_ |
T | 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. |
A histogram on the unit sphere.
Definition at line 47 of file bsta_spherical_histogram.h.
enum bsta_spherical_histogram::ang_units |
Definition at line 50 of file bsta_spherical_histogram.h.
enum bsta_spherical_histogram::angle_bounds |
Definition at line 51 of file bsta_spherical_histogram.h.
bsta_spherical_histogram< T >::bsta_spherical_histogram | ( | ) |
Definition at line 55 of file bsta_spherical_histogram.txx.
bsta_spherical_histogram< T >::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 |
||
) |
Definition at line 66 of file bsta_spherical_histogram.txx.
bsta_spherical_histogram< T >::~bsta_spherical_histogram | ( | ) | [inline] |
Definition at line 60 of file bsta_spherical_histogram.h.
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.
T bsta_spherical_histogram< T >::azimuth_center | ( | int | azimuth_index | ) | const |
Definition at line 140 of file bsta_spherical_histogram.txx.
int bsta_spherical_histogram< T >::azimuth_index | ( | T | azimuth | ) | const |
indices for individual spherical coordinates.
Definition at line 246 of file bsta_spherical_histogram.txx.
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.
void bsta_spherical_histogram< T >::azimuth_interval | ( | T | azimuth, |
T & | azimuth_start, | ||
T & | azimuth_range | ||
) | const [inline] |
Definition at line 92 of file bsta_spherical_histogram.h.
T bsta_spherical_histogram< T >::azimuth_range | ( | ) | const |
Definition at line 112 of file bsta_spherical_histogram.txx.
T bsta_spherical_histogram< T >::azimuth_start | ( | ) | const |
azimuth bounds.
Definition at line 100 of file bsta_spherical_histogram.txx.
vcl_vector< int > bsta_spherical_histogram< T >::bins_intersecting_cone | ( | T | center_az, |
T | center_el, | ||
T | cone_half_angle | ||
) |
linear index of bins which have centers lying inside the cone.
Definition at line 474 of file bsta_spherical_histogram.txx.
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.
void bsta_spherical_histogram< T >::convert_to_cartesian | ( | T | azimuth, |
T | elevation, | ||
T & | x, | ||
T & | y, | ||
T & | z | ||
) | const |
convenient utilities.
Definition at line 182 of file bsta_spherical_histogram.txx.
void bsta_spherical_histogram< T >::convert_to_spherical | ( | T | x, |
T | y, | ||
T | z, | ||
T & | azimuth, | ||
T & | elevation | ||
) | const |
Definition at line 204 of file bsta_spherical_histogram.txx.
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.
T bsta_spherical_histogram< T >::counts | ( | T | azimuth, |
T | elevation | ||
) | [inline] |
Definition at line 123 of file bsta_spherical_histogram.h.
T bsta_spherical_histogram< T >::counts | ( | int | linear_index | ) | [inline] |
Definition at line 129 of file bsta_spherical_histogram.h.
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.
static T bsta_spherical_histogram< T >::deg_to_rad | ( | T | ang | ) | [inline, static] |
unit conversions.
Definition at line 158 of file bsta_spherical_histogram.h.
T bsta_spherical_histogram< T >::elevation_center | ( | int | elevation_index | ) | const |
Definition at line 156 of file bsta_spherical_histogram.txx.
int bsta_spherical_histogram< T >::elevation_index | ( | T | elevation | ) | const |
Definition at line 268 of file bsta_spherical_histogram.txx.
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.
void bsta_spherical_histogram< T >::elevation_interval | ( | T | elevation, |
T & | elevation_start, | ||
T & | elevation_range | ||
) | const [inline] |
Definition at line 99 of file bsta_spherical_histogram.h.
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.
T bsta_spherical_histogram< T >::elevation_range | ( | ) | const |
Definition at line 132 of file bsta_spherical_histogram.txx.
T bsta_spherical_histogram< T >::elevation_start | ( | ) | const |
elevation bounds.
Definition at line 121 of file bsta_spherical_histogram.txx.
int bsta_spherical_histogram< T >::lin_index | ( | T | azimuth, |
T | elevation | ||
) | [inline] |
function name different since T could be int.
Definition at line 80 of file bsta_spherical_histogram.h.
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.
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.
unsigned bsta_spherical_histogram< T >::n_azimuth | ( | ) | const [inline] |
number of bins allowed.
Definition at line 70 of file bsta_spherical_histogram.h.
unsigned bsta_spherical_histogram< T >::n_elevation | ( | ) | const [inline] |
Definition at line 71 of file bsta_spherical_histogram.h.
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.
T bsta_spherical_histogram< T >::p | ( | T | azimuth, |
T | elevation | ||
) | [inline] |
Definition at line 136 of file bsta_spherical_histogram.h.
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.
void bsta_spherical_histogram< T >::print_to_vrml | ( | vcl_ostream & | os, |
T | transparency = T(0) |
||
) |
display counts in vrml with reference sphere.
Definition at line 533 of file bsta_spherical_histogram.txx.
static T bsta_spherical_histogram< T >::rad_to_deg | ( | T | ang | ) | [inline, static] |
Definition at line 159 of file bsta_spherical_histogram.h.
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.
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.
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.
void bsta_spherical_histogram< T >::upcount | ( | T | azimuth, |
T | elevation, | ||
T | mag = T(1.0) |
||
) |
increment the count in a given bin by mag.
Definition at line 341 of file bsta_spherical_histogram.txx.
void bsta_spherical_histogram< T >::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).
Definition at line 354 of file bsta_spherical_histogram.txx.
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.
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.
vcl_ostream & operator<< | ( | vcl_ostream & | s, |
bsta_spherical_histogram< T > const & | h | ||
) | [related] |
Write histogram to stream.
vcl_istream & operator>> | ( | vcl_istream & | is, |
bsta_spherical_histogram< T > & | h | ||
) | [related] |
Read histogram from stream.
angle_bounds bsta_spherical_histogram< T >::az_branch_cut_ [private] |
Definition at line 186 of file bsta_spherical_histogram.h.
T bsta_spherical_histogram< T >::azimuth_range_ [private] |
Definition at line 181 of file bsta_spherical_histogram.h.
T bsta_spherical_histogram< T >::azimuth_start_ [private] |
Definition at line 180 of file bsta_spherical_histogram.h.
vcl_map<int, T> bsta_spherical_histogram< T >::counts_ [private] |
Definition at line 191 of file bsta_spherical_histogram.h.
T bsta_spherical_histogram< T >::delta_az_ [private] |
Definition at line 184 of file bsta_spherical_histogram.h.
T bsta_spherical_histogram< T >::delta_el_ [private] |
Definition at line 185 of file bsta_spherical_histogram.h.
angle_bounds bsta_spherical_histogram< T >::el_poles_ [private] |
Definition at line 187 of file bsta_spherical_histogram.h.
T bsta_spherical_histogram< T >::elevation_range_ [private] |
Definition at line 183 of file bsta_spherical_histogram.h.
T bsta_spherical_histogram< T >::elevation_start_ [private] |
Definition at line 182 of file bsta_spherical_histogram.h.
unsigned bsta_spherical_histogram< T >::n_azimuth_ [private] |
members.
Definition at line 178 of file bsta_spherical_histogram.h.
unsigned bsta_spherical_histogram< T >::n_elevation_ [private] |
Definition at line 179 of file bsta_spherical_histogram.h.
T bsta_spherical_histogram< T >::total_counts_ [private] |
Definition at line 190 of file bsta_spherical_histogram.h.
bool bsta_spherical_histogram< T >::total_counts_valid_ [private] |
Definition at line 189 of file bsta_spherical_histogram.h.
ang_units bsta_spherical_histogram< T >::units_ [private] |
Definition at line 188 of file bsta_spherical_histogram.h.