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:
- tab1str
Filename of first IMPHTTAB for comparison.
- tab2str
Filename of second IMPHTTAB for comparison.
- Attributes:
- tab1_namestr
Filename of first IMPHTTAB.
- tab2_namestr
Filename of second IMPHTTAB.
- modesndarray
Obsmodes present in both input files.
- flams1ndarray
PHOTFLAM values from
tab1
for obsmodes inmodes
.- plams1ndarray
PHOTPLAM values from
tab1
for obsmodes inmodes
.- bws1ndarray
PHOTBW values from
tab1
for obsmodes inmodes
.- flams2ndarray
PHOTFLAM values from
tab2
for obsmodes inmodes
.- plams2ndarray
PHOTPLAM values from
tab2
for obsmodes inmodes
.- bws2ndarray
PHOTBW values from
tab2
for obsmodes inmodes
.- flamdiffndarray
Percent differences between
flams1
andflams2
calculated as(flams1 - flams2) / flams1
.- plamdiffndarray
Percent differences between
plams1
andplams2
calculated as(plams1 - plams2) / plams1
.- bwdiffndarray
Percent differences between
bws1
andbws2
calculated as(bws1 - bws2) / bws1
.
Methods
make_plot
([outname])Make a plot with histograms of the percent differences between PHOTFLAM, PHOTPLAM, and PHOTBW for the IMPHTTAB tables.
print_diffs
([orderby, lines])Print obsmodes and parameters ordered by orderby parameter, with the largest absolute differences in that parameter at the top.
- 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:
- outnamestr, 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.
- linesint, 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:
- table1str
Filename of first IMPHTTAB for comparison.
- table2str
Filename of the second IMPHTTAB for comparison.
- outnamestr, 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 thelines
parameter.Differences shown are calculated as
100 * (table1 - table2)/table1
.- Parameters:
- table1str
Filename of first IMPHTTAB for comparison.
- table2str
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.- linesint, optional
Number of lines of differences to print.
- Raises:
- ImphtcompError
If
orderby
does not match a valid option.