AnalyseMCMC
Analyse gravitational-wave parameter-estimation results from SPINspiral and lalinference_mcmc
 All Classes Files Functions Variables Pages
Functions/Subroutines
analyseMCMC_2dpdf_binning.f90 File Reference

(AnalyseMCMC version 0.7.1, revision 448, hash 2f54722 (2013-11-19))

Routines and functions to bin data in 2D and help produce 2D marginalised PDFs. More...

Functions/Subroutines

logical function create_this_2d_pdf (p1, p2, countplots, totplots)
 Determine whether to create a 2D PDF for this combination of j1/j2 or p1/p2. More...
 
subroutine identify_special_combinations_of_parameters (p1, p2, sky_position, binary_orientation, project_map)
 Identify special combinations of parameters. More...
 
subroutine determine_2d_pdf_binning_plot_ranges (ic, p1, p2, project_map, xmin, xmax, ymin, ymax, dx, dy)
 Determine binning/plot ranges for 2D PDFs. More...
 
subroutine bin_and_normalise_2d_data (ic, p1, p2, xmin, xmax, ymin, ymax, z, tr, sky_position, binary_orientation)
 Bin data and 'normalise' 2D PDF. More...
 
subroutine bin_data_2d_a (ndat, xdat, ydat, zdat, nxbin, nybin, xmin1, xmax1, ymin1, ymax1, zz, tr)
 'Bin data' in 2 dimensions - Measure the amount of likelihood in each bin More...
 
subroutine identify_2d_ranges (p1, p2, ni, nx, ny, z, tr)
 Get the 2d probability intervals; z lies between 1 (in 100% range) and ni (in lowest-% range, e.g. 90%) More...
 
subroutine calc_2d_areas (p1, p2, ni, nx, ny, z, tr, area, xmin, xmax, ymin, ymax)
 Compute 2D probability areas. More...
 
integer function injectionrange2d (z, nx, ny, injectionx, injectiony, tr)
 Get the smallest probability area in which the injection values lie. More...
 
subroutine check_binned_data (nxbin, nybin, z)
 Find the fraction of non-zero bins for which more than frac*8 of their neighbours are smaller. More...
 
subroutine prepare_skymap_binning (xmin, xmax, ymin, ymax)
 Prepare binning for a cute sky map in 2D PDF. More...
 
subroutine save_binned_2d_pdf_data (ic, p1, p2, xmin, xmax, ymin, ymax, z, tr, op)
 Save binned 2D PDF data for the given combination of parameters. More...
 

Detailed Description

Routines and functions to bin data in 2D and help produce 2D marginalised PDFs.

Function/Subroutine Documentation

logical function create_this_2d_pdf ( integer, intent(in)  p1,
integer, intent(in)  p2,
integer, intent(in)  countplots,
integer, intent(in)  totplots 
)

Determine whether to create a 2D PDF for this combination of j1/j2 or p1/p2.

Parameters
p1ID of parameter 1
p2ID of parameter 2
countplotsCount of the current plot
totplotsTotal number of plots to make

Referenced by pdfs2d().

subroutine identify_special_combinations_of_parameters ( integer, intent(in)  p1,
integer, intent(in)  p2,
logical, intent(out)  sky_position,
logical, intent(out)  binary_orientation,
logical, intent(out)  project_map 
)

Identify special combinations of parameters.

Parameters
p1ID of parameter 1
p2ID of parameter 2
Return values
sky_positionBinning/plotting sky position?
binary_orientationBinning/plotting binary orientation?
project_mapUsing a map projection?

Referenced by pdfs2d().

subroutine determine_2d_pdf_binning_plot_ranges ( integer, intent(in)  ic,
integer, intent(in)  p1,
integer, intent(in)  p2,
logical, intent(in)  project_map,
real, intent(out)  xmin,
real, intent(out)  xmax,
real, intent(out)  ymin,
real, intent(out)  ymax,
real, intent(out)  dx,
real, intent(out)  dy 
)

Determine binning/plot ranges for 2D PDFs.

Parameters
icChain ID
p1ID of parameter 1
p2ID of parameter 2
project_mapUse map projection?
Return values
xminLower limit of horizontal plot range
xmaxUpper limit of horizontal plot range
yminLower limit of vertical plot range
ymaxUpper limit of vertical plot range
dxWidth of horizontal plot range
dyWidth of vertical plot range

Referenced by pdfs2d().

subroutine bin_and_normalise_2d_data ( integer, intent(in)  ic,
integer, intent(in)  p1,
integer, intent(in)  p2,
real, intent(inout)  xmin,
real, intent(inout)  xmax,
real, intent(inout)  ymin,
real, intent(inout)  ymax,
real, dimension(nbin2dx+1,nbin2dy+1), intent(inout)  z,
real, dimension(6), intent(inout)  tr,
logical, intent(in)  sky_position,
logical, intent(in)  binary_orientation 
)

Bin data and 'normalise' 2D PDF.

Parameters
icChain ID
p1ID of parameter 1
p2ID of parameter 2
xminLower limit of horizontal plot range (I/O)
xmaxUpper limit of horizontal plot range (I/O)
yminLower limit of vertical plot range (I/O)
ymaxUpper limit of vertical plot range (I/O)
z2D binned data (I/O)
trTransformation elements used by PGPlot (I/O)
sky_positionBinning/plotting sky position?
binary_orientationBinning/plotting binary orientation?

References bin_data_2d_a(), calc_2d_areas(), identify_2d_ranges(), and injectionrange2d().

Referenced by pdfs2d().

subroutine bin_data_2d_a ( integer, intent(in)  ndat,
real, dimension(ndat), intent(in)  xdat,
real, dimension(ndat), intent(in)  ydat,
real, dimension(ndat), intent(in)  zdat,
integer, intent(in)  nxbin,
integer, intent(in)  nybin,
real, intent(inout)  xmin1,
real, intent(inout)  xmax1,
real, intent(inout)  ymin1,
real, intent(inout)  ymax1,
real, dimension(nxbin+1,nybin+1), intent(out)  zz,
real, dimension(6), intent(out)  tr 
)

'Bin data' in 2 dimensions - Measure the amount of likelihood in each bin

Parameters
ndatInput data: array size
xdatInput data: x values
ydatInput data: y values
zdatInput data: likelihood values
nxbinDesired number of bins in the x direction
nybinDesired number of bins in the y direction
xmin1Lower limit for the binning range in the x direction - autodetermine if xmin1=xmax1
xmax1Upper limit for the binning range in the x direction - autodetermine if xmin1=xmax1
ymin1Lower limit for the binning range in the y direction - autodetermine if ymin1=ymax1
ymax1Upper limit for the binning range in the y direction - autodetermine if ymin1=ymax1
Return values
zz'Binned' data set z(nxbin,nybin) (real)
trTransformation elements for pgplot tr(6) (real)
Todo:
Should z be replaced?

Referenced by bin_and_normalise_2d_data().

subroutine identify_2d_ranges ( integer, intent(in)  p1,
integer, intent(in)  p2,
integer, intent(in)  ni,
integer, intent(in)  nx,
integer, intent(in)  ny,
real, dimension(nx,ny), intent(inout)  z,
real, dimension(6), intent(in)  tr 
)

Get the 2d probability intervals; z lies between 1 (in 100% range) and ni (in lowest-% range, e.g. 90%)

Parameters
p1Parameter ID 1
p2Parameter ID 2
niNumber of probability intervals
nxNumber of bins in the x direction
nyNumber of bins in the y direction
zBinned data (nx,ny) -> probability-interval data
trTransformation elements used by PGPlot

Referenced by bin_and_normalise_2d_data().

subroutine calc_2d_areas ( integer, intent(in)  p1,
integer, intent(in)  p2,
integer, intent(in)  ni,
integer, intent(in)  nx,
integer, intent(in)  ny,
real, dimension(nx,ny), intent(in)  z,
real, dimension(6), intent(in)  tr,
real, dimension(ni), intent(out)  area,
real, intent(out)  xmin,
real, intent(out)  xmax,
real, intent(out)  ymin,
real, intent(out)  ymax 
)

Compute 2D probability areas.

Parameters
p1Parameter ID 1
p2Parameter ID 2
niNumber of probability intervals
nxNumber of bins in the x direction
nyNumber of bins in the y direction
zBinned data (nx,ny) -> probability-interval data
trTransformation elements used by PGPlot
Return values
areaProbability areas
xminLower limit for the plotting range in the horizontal direction
xmaxUpper limit for the plotting range in the horizontal direction
yminLower limit for the plotting range in the vertical direction
ymaxUpper limit for the plotting range in the vertical direction

Referenced by bin_and_normalise_2d_data().

integer function injectionrange2d ( real, dimension(nx,ny), intent(in)  z,
integer, intent(in)  nx,
integer, intent(in)  ny,
real, intent(in)  injectionx,
real, intent(in)  injectiony,
real, dimension(6), intent(in)  tr 
)

Get the smallest probability area in which the injection values lie.

Parameters
zBinned data (nx,ny) -> probability-interval data
nxNumber of bins in the x direction
nyNumber of bins in the y direction
injectionxInjection value of parameter 1
injectionyInjection value of parameter 2
trTransformation elements used by PGPlot

Referenced by bin_and_normalise_2d_data().

subroutine check_binned_data ( integer, intent(in)  nxbin,
integer, intent(in)  nybin,
real, dimension(nxbin+1,nybin+1), intent(in)  z 
)

Find the fraction of non-zero bins for which more than frac*8 of their neighbours are smaller.

Parameters
nxbinDesired number of bins in the x direction
nybinDesired number of bins in the y direction
zBinned data set z(nxbin,nybin) (real)
subroutine prepare_skymap_binning ( real, intent(inout)  xmin,
real, intent(inout)  xmax,
real, intent(inout)  ymin,
real, intent(inout)  ymax 
)

Prepare binning for a cute sky map in 2D PDF.

Parameters
xminMinimum value of x (RA) range
xmaxMaximum value of x (RA) range
yminMinimum value of y (Dec) range
ymaxMaximum value of y (Dec) range

Referenced by pdfs2d().

subroutine save_binned_2d_pdf_data ( integer, intent(in)  ic,
integer, intent(in)  p1,
integer, intent(in)  p2,
real, intent(in)  xmin,
real, intent(in)  xmax,
real, intent(in)  ymin,
real, intent(in)  ymax,
real, dimension(nbin2dx+1,nbin2dy+1), intent(in)  z,
real, dimension(6), intent(in)  tr,
integer, intent(in)  op 
)

Save binned 2D PDF data for the given combination of parameters.

Parameters
icChain ID
p1ID of parameter 1
p2ID of parameter 2
xminLower limit of horizontal plot range (I/O)
xmaxUpper limit of horizontal plot range (I/O)
yminLower limit of vertical plot range (I/O)
ymaxUpper limit of vertical plot range (I/O)
z2D binned data (I/O)
trTransformation elements used by PGPlot (I/O)
opOutput unit

Referenced by pdfs2d().