{ } Raw JSON

bundles / astropy 7.0.1 / astropy / io / fits / convenience / printdiff

function

astropy.io.fits.convenience:printdiff

source: /astropy/io/fits/convenience.py :840

Signature

def   printdiff ( inputa inputb * args ** kwargs )

Summary

Compare two parts of a FITS file, including entire FITS files, FITS HDUList objects and FITS HDU objects.

Parameters

inputa : str, `HDUList` object, or ``HDU`` object

The filename of a FITS file, HDUList, or HDU object to compare to inputb.

inputb : str, `HDUList` object, or ``HDU`` object

The filename of a FITS file, HDUList, or HDU object to compare to inputa.

ext, extname, extver

Additional positional arguments are for HDU specification if your inputs are string filenames (will not work if inputa and inputb are HDU objects or HDUList objects). They are flexible and are best illustrated by examples. In addition to using these arguments positionally you can directly call the keyword parameters ext, extname.

By HDU number

printdiff('inA.fits', 'inB.fits', 0)      # the primary HDU
printdiff('inA.fits', 'inB.fits', 2)      # the second extension HDU
printdiff('inA.fits', 'inB.fits', ext=2)  # the second extension HDU

By name, i.e., EXTNAME value (if unique). EXTNAME values are not case sensitive:

printdiff('inA.fits', 'inB.fits', 'sci') printdiff('inA.fits', 'inB.fits', extname='sci') # equivalent

By combination of EXTNAME and EXTVER as separate arguments or as a tuple

printdiff('inA.fits', 'inB.fits', 'sci', 2)    # EXTNAME='SCI'
                                               # & EXTVER=2
printdiff('inA.fits', 'inB.fits', extname='sci', extver=2)
                                               # equivalent
printdiff('inA.fits', 'inB.fits', ('sci', 2))  # equivalent

Ambiguous or conflicting specifications will raise an exception

printdiff('inA.fits', 'inB.fits',
          ext=('sci', 1), extname='err', extver=2)
**kwargs

Any additional keyword arguments to be passed to FITSDiff.

Notes

The primary use for the printdiff function is to allow quick print out of a FITS difference report and will write to sys.stdout. To save the diff report to a file please use FITSDiff directly.

Aliases

  • astropy.io.fits.printdiff