compare

Functions to support comparisons between SIAF files.

Authors

Johannes Sahlmann

References

The format of the difference files was adapted from Colin Cox’ matchcsv.py dict_compare was adapted from https://stackoverflow.com/questions/4527942/comparing-two-dictionaries-in-python/4527957

pysiaf.utils.compare.compare_inspection_figures(comparison_siaf_input, reference_siaf_input=None, report_dir=None, selected_aperture_name=None, skipped_aperture_type=None, tags=None, mark_ref=False, xlimits=None, ylimits=None, filename_appendix='', label=False)[source]

Visualize aperture of two SIAF files.

Parameters:
comparison_siaf_inputstr (absolute file name) or pysiaf.Siaf object

The SIAF that will be compared to the reference_siaf

reference_siaf_inputstr (absolute file name) or pysiaf.Siaf object

The reference SIAF. Defaults to the current PRD content.

report_dir
selected_aperture_name str or list

aperture name(s) to include in plot

skipped_aperture_typestr or list

aperture type(s) not to include in plot

tags
xlimitstuple of limits of output plots
ylimitstuple of limits of output plots
Returns:
pysiaf.utils.compare.compare_siaf(comparison_siaf_input, fractional_tolerance=0.0001, reference_siaf_input=None, report_file=None, report_dir=None, verbose=True, make_figures=False, selected_aperture_name=None, ignore_attributes=None, tags=None)[source]

Compare two SIAF files and write a difference file. Generate comparison figures showing the apertures if specified.

Parameters:
comparison_siaf_inputstr (absolute file name) or pysiaf.Siaf object

The SIAF that will be compared to the reference_siaf

fractional_tolerancefloat

Value above which a fractional difference in parameter value will be written in the report

reference_siaf_inputstr (absolute file name) or pysiaf.Siaf object

The reference SIAF. Defaults to the current PRD content.

report_file
report_dir
verbose
make_figures
selected_aperture_name
pysiaf.utils.compare.compare_transformation_roundtrip(comparison_siaf_input, fractional_tolerance=0.0001, reference_siaf_input=None, report_file=None, report_dir=None, verbose=True, make_figures=False, selected_aperture_name=None, skipped_aperture_type=None, instrument=None, make_plot=False, tags=None)[source]

Compare the forward-backward roundtrip transformations of two SIAF files. and write a difference file.

Parameters:
comparison_siaf_inputstr (absolute file name) or pysiaf.Siaf object

The SIAF that will be compared to the reference_siaf

fractional_tolerancefloat

Value above which a fractional difference in parameter value will be written in the report

reference_siaf_inputstr (absolute file name) or pysiaf.Siaf object

The reference SIAF. Defaults to the current PRD content.

report_file
report_dir
verbose
make_figures
selected_aperture_namestr or list

aperture name(s) to include in plot

skipped_aperture_typestr or list

aperture type(s) not to include in plot

instrument
make_plot
Returns:
roundtrip_tableastropy.table.Table object

table containing roundtrip data

pysiaf.utils.compare.dict_compare(dictionary_1, dictionary_2)[source]

Compare two dictionaries and return keys of the differing items. From https://stackoverflow.com/questions/4527942/comparing-two-dictionaries-in-python/4527957

Parameters:
dictionary_1dict

first dictionary

dictionary_2dict

second dictionary

Returns:
added, removed, modified, sameset

Sets of dictionary keys that were added, removed, modified, or are the same

pysiaf.utils.compare.show_save_plot(report_dir)[source]