Compare IMPHTTAB Tables

Tools for comparing two IMPHTTAB tables from the same instrument and detector.

exception reftools.imphtcomp.ImphtcompError
class reftools.imphtcomp.ImphttabComp(tab1, tab2)

Class for comparing two IMPHTTAB tables from the same instrument and detector.

Parameters
  • tab1 (str) – Filename of first IMPHTTAB for comparison.

  • tab2 (str) – Filename of second IMPHTTAB for comparison.

tab1_name

Filename of first IMPHTTAB.

Type

str

tab2_name

Filename of second IMPHTTAB.

Type

str

modes

Obsmodes present in both input files.

Type

ndarray

flams1

PHOTFLAM values from tab1 for obsmodes in modes.

Type

ndarray

plams1

PHOTPLAM values from tab1 for obsmodes in modes.

Type

ndarray

bws1

PHOTBW values from tab1 for obsmodes in modes.

Type

ndarray

flams2

PHOTFLAM values from tab2 for obsmodes in modes.

Type

ndarray

plams2

PHOTPLAM values from tab2 for obsmodes in modes.

Type

ndarray

bws2

PHOTBW values from tab2 for obsmodes in modes.

Type

ndarray

flamdiff

Percent differences between flams1 and flams2 calculated as (flams1 - flams2) / flams1.

Type

ndarray

plamdiff

Percent differences between plams1 and plams2 calculated as (plams1 - plams2) / plams1.

Type

ndarray

bwdiff

Percent differences between bws1 and bws2 calculated as (bws1 - bws2) / bws1.

Type

ndarray

make_plot(outname='imphttab_comp.pdf')

Make a plot with histograms of the percent differences between PHOTFLAM, PHOTPLAM, and PHOTBW for the IMPHTTAB tables.

Differences plotted are 100 * (table1 - table2) / table1.

Parameters

outname (str, optional) – Filename of output plot, including extension.

print_diffs(orderby='photflam', lines=25)

Print obsmodes and parameters ordered by orderby parameter, with the largest absolute differences in that parameter at the top. This is for seeing which obsmodes have the largest difference in the specified parameter. Print the number of modes given in the lines parameter.

Differences shown are calculated as 100 * (table1 - table2) / table1.

Parameters
  • orderby ({'photflam', 'photplam', 'photbw'}, optional) – The parameter by which to order the printed results, with modes having the largest absolute difference in this parameter printed at the top.

  • lines (int, optional) – The number of lines to print.

Raises

ImphtcompError – If orderby does not match a valid option.

reftools.imphtcomp.plot_table_diffs(table1, table2, outname='imphttab_comp.pdf')

Make a plot with histograms of the percent differences between PHOTFLAM, PHOTPLAM, and PHOTBW for the IMPHTTAB tables.

Differences plotted are 100 * (table1 - table2) / table1.

Parameters
  • table1 (str) – Filename of first IMPHTTAB for comparison.

  • table2 (str) – Filename of the second IMPHTTAB for comparison.

  • outname (str, optional) – Filename of output plot, including extension.

reftools.imphtcomp.print_table_diffs(table1, table2, orderby='photflam', lines=25)

Compare two IMPHTTAB tables and print their differences to the terminal. Print any obsmodes which are in either table but not in both.

Also print the obsmodes and parameters for the modes which most differ in the parameter given in orderby. This is for seeing which obsmodes have the largest percent difference in the specified parameter. Print the number of modes given in the lines parameter.

Differences shown are calculated as 100 * (table1 - table2)/table1.

Parameters
  • table1 (str) – Filename of first IMPHTTAB for comparison.

  • table2 (str) – Filename of the second IMPHTTAB for comparison.

  • orderby ({'photflam', 'photplam', 'photbw', 'all'}, optional) – The printed results are ordered according to the absolute difference in the specified parameter, with the mode with the largest absolute difference at the top of the list. Specifying 'all' will print 3 tables, one ordered by each of the parameters.

  • lines (int, optional) – Number of lines of differences to print.

Raises

ImphtcompError – If orderby does not match a valid option.