Comparison-specific tools

Tools related to comparing sets (>2 images) of similar polarized images. Probably not broadly useful outside the context of comparing polarized GRRT schemes.

imtools.comparison.compare_all_with(data, name, polar=False, compare_abs=True, **kwargs)

Compare each other element in ‘data’ with the named element compare_abs specifies an absolute difference, otherwise the relative difference is taken relative diff is clipped to [-1,1]

imtools.comparison.generate_table(data, fn)

Generate a comparison table between several images.

Parameters
  • data – a dictionary of Image objects keyed by names

  • fn – a function which takes two Image objects and returns a list of 4 results (see e.g. ‘stats.mses’)

Returns

table: a 2D array of each comparator output, indexed by the keys() list in each direction (i.e. table[i,i] == 0 for most comparison metrics)

imtools.comparison.print_table(table, names, color=False, cmap='RdBu_r', n_stokes=4, figsize=(6, 10))

Make a table from a 2D array indexed by the list ‘names’ on each axis. Usually for showing output of generate_table for comparisons

imtools.comparison.table_color_plot(table, names, cmap='RdBu_r', n_tables=4, figsize=(14, 4), labels=('Stokes I', 'Stokes Q', 'Stokes U', 'Stokes V'), clabels=('%', '%', '%', '%'), is_percent=(True, True, True, True), polar=False, vmax=None, shrink_text_by=2.5, upper_tri_only=True)

Plot a 2D array indexed by the list ‘names’ on each axis. Usually for plotting output of generate_table for comparisons

imtools.comparison.table_interleave_plot(table, names, cmap='RdBu_r', vmax=None, n_stokes=4, figsize=(8, 5), cbarlabel='')

Plot a 2D array indexed by the list ‘names’ on each axis. Usually for plotting output of generate_table for comparisons

imtools.comparison.table_interleave_plot_rotated(table, names, cmap='RdBu_r', vmax=None, n_stokes=4, figsize=(8, 5), cbarlabel='')

Plot a 2D array indexed by the list ‘names’ on each axis. Usually for plotting output of generate_table for comparisons