Last active
July 7, 2023 05:29
-
-
Save maneesh29s/839cce964c46a8b17363b38bd41f2adb to your computer and use it in GitHub Desktop.
Compares all fits files in 2 given directories, using `fitsdiff`. `fitsdiff` is available in astropy conda/pip package.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| if [[ $# -ne 2 ]] | |
| then | |
| echo "Usage: $0 first_dir second_dir"; | |
| echo "Both inputs are directories containing the FITS images to compare"; | |
| exit 1; | |
| fi | |
| first=$1 | |
| second=$2 | |
| for path in $first/* | |
| do | |
| imageName=`basename $path` | |
| # -k DATE: ignores date | |
| # -q: quite mode, only outputs exit status | |
| # -n 100: will report 100 data differences (image pixel or table element) | |
| fitsdiff -q -n 100 -k DATE $first/$imageName $second/$imageName | |
| if [[ $? -ne 0 ]] | |
| then | |
| echo "fitsfile different: ${imageName}" | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment