Description
Filters a file of planet coordinates looking for 'bad' images which may be due to any of the following:
These images may produce poor fit results because of the image itself (e.g. multiple exposures, planet moving within frame, etc...) or simply because the circle fitting algorithm has failed for some reason (e.g. part of bright limb outside frame, inner part of crescent mistakenly identified as limb, etc...). Such images should not be used in the remaining steps of automated processing.
Usage
scancoords.py coordinate-file
Examples
In this example, coordinates for raw images 171-276 have been previously calculated by 'roughalign.py':
3: ~/Projects/Python/AstroPy > scancoords.py 072407/intermediates/coords.171-276.txt 106 entries cx: av = 284.258441, std = 89.344147, min = 124.956457, max = 438.695787 cy: av = 242.930214, std = 45.688804, min = 61.678656, max = 270.911493 rad: av = 186.278416, std = 35.945450, min = 44.732562, max = 207.988332 err: av = 7.715937, std = 5.460076, min = 1.668081, max = 22.293971 072407/raw/im0171.a.fits : planet off bottom edge of frame 072407/raw/im0171.a.fits : radius out of 1.50 std band 072407/raw/im0171.a.fits : err out of 1.50 std band 072407/raw/im0172.a.fits : radius out of 1.50 std band 072407/raw/im0172.a.fits : err out of 1.50 std band 072407/raw/im0173.a.fits : radius out of 1.50 std band 072407/raw/im0173.a.fits : err out of 1.50 std band 072407/raw/im0174.a.fits : radius out of 1.50 std band 072407/raw/im0175.a.fits : radius out of 1.50 std band 072407/raw/im0175.a.fits : err out of 1.50 std band 072407/raw/im0176.a.fits : radius out of 1.50 std band 072407/raw/im0177.a.fits : radius out of 1.50 std band 072407/raw/im0178.a.fits : planet off right edge of frame 072407/raw/im0179.a.fits : radius out of 1.50 std band 072407/raw/im0179.a.fits : err out of 1.50 std band 072407/raw/im0180.a.fits : planet off right edge of frame 072407/raw/im0181.a.fits : planet off right edge of frame 072407/raw/im0182.a.fits : planet off right edge of frame 072407/raw/im0183.a.fits : planet off right edge of frame 072407/raw/im0184.a.fits : planet off right edge of frame 072407/raw/im0184.a.fits : err out of 1.50 std band 072407/raw/im0185.a.fits : planet off right edge of frame 072407/raw/im0185.a.fits : err out of 1.50 std band 072407/raw/im0186.a.fits : planet off right edge of frame 072407/raw/im0187.a.fits : planet off right edge of frame 072407/raw/im0188.a.fits : planet off right edge of frame 072407/raw/im0188.a.fits : err out of 1.50 std band 072407/raw/im0189.a.fits : planet off right edge of frame 072407/raw/im0190.a.fits : planet off right edge of frame 072407/raw/im0191.a.fits : planet off right edge of frame 072407/raw/im0191.a.fits : err out of 1.50 std band 072407/raw/im0192.a.fits : planet off right edge of frame 072407/raw/im0192.a.fits : err out of 1.50 std band 072407/raw/im0193.a.fits : planet off right edge of frame 072407/raw/im0193.a.fits : err out of 1.50 std band 072407/raw/im0194.a.fits : planet off right edge of frame 072407/raw/im0194.a.fits : err out of 1.50 std band 072407/raw/im0201.a.fits : err out of 1.50 std band 072407/raw/im0250.a.fits : planet off left edge of frame 072407/raw/im0252.a.fits : planet off left edge of frame 072407/raw/im0253.a.fits : planet off left edge of frame 072407/raw/im0254.a.fits : planet off left edge of frame 072407/raw/im0255.a.fits : planet off left edge of frame 072407/raw/im0256.a.fits : planet off left edge of frame 072407/raw/im0257.a.fits : planet off left edge of frame 072407/raw/im0258.a.fits : planet off left edge of frame 072407/raw/im0259.a.fits : planet off left edge of frame 072407/raw/im0260.a.fits : planet off left edge of frame 072407/raw/im0261.a.fits : planet off left edge of frame 072407/raw/im0262.a.fits : planet off left edge of frame 072407/raw/im0263.a.fits : planet off left edge of frame 072407/raw/im0264.a.fits : planet off left edge of frame 072407/raw/im0265.a.fits : planet off left edge of frame 072407/raw/im0266.a.fits : planet off left edge of frame 072407/raw/im0267.a.fits : planet off left edge of frame 072407/raw/im0268.a.fits : planet off left edge of frame 072407/raw/im0269.a.fits : planet off left edge of frame 072407/raw/im0270.a.fits : planet off left edge of frame 072407/raw/im0271.a.fits : planet off left edge of frame 072407/raw/im0272.a.fits : planet off left edge of frame 072407/raw/im0273.a.fits : planet off left edge of frame 072407/raw/im0274.a.fits : planet off left edge of frame 072407/raw/im0275.a.fits : planet off left edge of frame 072407/raw/im0276.a.fits : planet off left edge of frame
In this case, the line for radial statistics should be noted:
rad: av = 186.278416, std = 35.945450, min = 44.732562, max = 207.988332
The wide range of radii, and large standard deviation suggest that some of the images should be rejected. Looking at the coordinate file, it can be seen that the first dozen images are responsible for the bad values:
072407/raw/im0171.a.fits 2007-07-24 05:15:21.074047 410.129279 63.700401 58.669169 20.425256 37 072407/raw/im0172.a.fits 2007-07-24 05:15:31.164425 417.853662 66.989585 51.883413 19.803723 37 072407/raw/im0173.a.fits 2007-07-24 05:15:39.674644 426.131517 61.678656 44.732562 19.272439 32 072407/raw/im0174.a.fits 2007-07-24 05:15:48.247884 423.564896 104.029987 70.980214 8.790492 38 072407/raw/im0175.a.fits 2007-07-24 05:15:56.794000 424.356534 68.546373 50.470188 21.318007 30 072407/raw/im0176.a.fits 2007-07-24 05:16:05.362805 413.737971 147.612272 105.709758 9.176313 56 072407/raw/im0177.a.fits 2007-07-24 05:16:13.884905 426.827006 106.442808 65.264456 11.733308 52 072407/raw/im0178.a.fits 2007-07-24 05:16:22.396004 426.968981 211.595898 159.120013 14.436357 55 072407/raw/im0179.a.fits 2007-07-24 05:16:30.942553 417.454471 85.328713 58.109562 18.044092 59 072407/raw/im0180.a.fits 2007-07-24 05:16:39.512806 438.695787 244.481588 191.486302 8.435804 60 072407/raw/im0181.a.fits 2007-07-24 05:16:48.086183 408.868817 242.955775 196.877728 2.438177 59 072407/raw/im0182.a.fits 2007-07-24 05:16:56.621866 431.353290 244.912192 189.767007 11.919673 69 072407/raw/im0183.a.fits 2007-07-24 05:17:05.171297 383.229511 245.088585 201.293635 9.007854 82 072407/raw/im0184.a.fits 2007-07-24 05:17:13.865269 403.761186 249.548622 190.005998 20.606813 60 072407/raw/im0185.a.fits 2007-07-24 05:17:22.535830 410.277455 247.408011 188.804443 20.986685 59 072407/raw/im0186.a.fits 2007-07-24 05:17:31.073167 367.546856 246.822906 207.988332 9.748882 74 072407/raw/im0187.a.fits 2007-07-24 05:17:39.616956 375.612509 245.193769 200.697305 13.479231 90 072407/raw/im0188.a.fits 2007-07-24 05:17:48.189088 373.513936 247.129903 198.562310 19.587994 71 072407/raw/im0189.a.fits 2007-07-24 05:17:56.702397 404.052895 247.446305 190.160339 13.100852 100 072407/raw/im0190.a.fits 2007-07-24 05:18:05.257781 369.998742 248.037625 200.591716 13.485728 100
This is because the alignment program cannot find a good estimate of the bright limb before image 183:

If images 171-182 are removed from the coordinate file and the scan is run again, the results are much better (again, note radial stats):
8: ~/Projects/Python/AstroPy > scancoords.py 072407/intermediates/coords.183-276.txt 94 entries cx: av = 266.653750, std = 79.086024, min = 124.956457, max = 410.277455 cy: av = 256.407750, std = 7.309761, min = 239.368154, max = 270.911493 rad: av = 196.834486, std = 4.512910, min = 187.276921, max = 207.988332 err: av = 6.937188, std = 4.902881, min = 1.668081, max = 22.293971 072407/raw/im0183.a.fits : planet off right edge of frame 072407/raw/im0184.a.fits : planet off right edge of frame 072407/raw/im0184.a.fits : radius out of 1.50 std band 072407/raw/im0184.a.fits : err out of 1.50 std band 072407/raw/im0185.a.fits : planet off right edge of frame 072407/raw/im0185.a.fits : radius out of 1.50 std band 072407/raw/im0185.a.fits : err out of 1.50 std band 072407/raw/im0186.a.fits : planet off right edge of frame 072407/raw/im0186.a.fits : radius out of 1.50 std band 072407/raw/im0187.a.fits : planet off right edge of frame 072407/raw/im0188.a.fits : planet off right edge of frame 072407/raw/im0188.a.fits : err out of 1.50 std band 072407/raw/im0189.a.fits : planet off right edge of frame 072407/raw/im0190.a.fits : planet off right edge of frame 072407/raw/im0191.a.fits : planet off right edge of frame 072407/raw/im0191.a.fits : err out of 1.50 std band 072407/raw/im0192.a.fits : planet off right edge of frame 072407/raw/im0192.a.fits : err out of 1.50 std band 072407/raw/im0193.a.fits : planet off right edge of frame 072407/raw/im0193.a.fits : err out of 1.50 std band 072407/raw/im0194.a.fits : planet off right edge of frame 072407/raw/im0194.a.fits : err out of 1.50 std band 072407/raw/im0196.a.fits : radius out of 1.50 std band 072407/raw/im0200.a.fits : err out of 1.50 std band 072407/raw/im0201.a.fits : err out of 1.50 std band 072407/raw/im0213.a.fits : radius out of 1.50 std band 072407/raw/im0220.a.fits : radius out of 1.50 std band 072407/raw/im0250.a.fits : planet off left edge of frame 072407/raw/im0252.a.fits : planet off left edge of frame 072407/raw/im0253.a.fits : planet off left edge of frame 072407/raw/im0254.a.fits : planet off left edge of frame 072407/raw/im0255.a.fits : planet off left edge of frame 072407/raw/im0256.a.fits : planet off left edge of frame 072407/raw/im0257.a.fits : planet off left edge of frame 072407/raw/im0258.a.fits : planet off left edge of frame 072407/raw/im0259.a.fits : planet off left edge of frame 072407/raw/im0260.a.fits : planet off left edge of frame 072407/raw/im0260.a.fits : radius out of 1.50 std band 072407/raw/im0261.a.fits : planet off left edge of frame 072407/raw/im0262.a.fits : planet off left edge of frame 072407/raw/im0263.a.fits : planet off left edge of frame 072407/raw/im0264.a.fits : planet off left edge of frame 072407/raw/im0265.a.fits : planet off left edge of frame 072407/raw/im0266.a.fits : planet off left edge of frame 072407/raw/im0267.a.fits : planet off left edge of frame 072407/raw/im0268.a.fits : planet off left edge of frame 072407/raw/im0269.a.fits : planet off left edge of frame 072407/raw/im0270.a.fits : planet off left edge of frame 072407/raw/im0271.a.fits : planet off left edge of frame 072407/raw/im0272.a.fits : planet off left edge of frame 072407/raw/im0272.a.fits : radius out of 1.50 std band 072407/raw/im0273.a.fits : planet off left edge of frame 072407/raw/im0274.a.fits : planet off left edge of frame 072407/raw/im0275.a.fits : planet off left edge of frame 072407/raw/im0276.a.fits : planet off left edge of frame 072407/raw/im0276.a.fits : radius out of 1.50 std band
Now images before 195 are flagged because the night side of the planet is out of the right of the frame, while images after 249 are out of the left of the frame:

After editing and rescanning the coordinates again, the results are acceptable for further processing, even though some radii (e.g. 195 above) are outside of the allowable band:
9: ~/Projects/Python/AstroPy > scancoords.py 072407/intermediates/coords.195-249.txt 55 entries cx: av = 290.619903, std = 46.170280, min = 208.172000, max = 365.924031 cy: av = 254.520652, std = 5.664245, min = 239.368154, max = 262.669171 rad: av = 197.605310, std = 3.912316, min = 188.048313, max = 202.990745 err: av = 5.789238, std = 3.517886, min = 1.869160, max = 16.270330 072407/raw/im0195.a.fits : radius out of 1.50 std band 072407/raw/im0195.a.fits : err out of 1.50 std band 072407/raw/im0196.a.fits : radius out of 1.50 std band 072407/raw/im0196.a.fits : err out of 1.50 std band 072407/raw/im0197.a.fits : radius out of 1.50 std band 072407/raw/im0197.a.fits : err out of 1.50 std band 072407/raw/im0198.a.fits : err out of 1.50 std band 072407/raw/im0200.a.fits : err out of 1.50 std band 072407/raw/im0201.a.fits : err out of 1.50 std band 072407/raw/im0213.a.fits : radius out of 1.50 std band 072407/raw/im0220.a.fits : radius out of 1.50 std band 072407/raw/im0230.a.fits : radius out of 1.50 std band
Most of the poor alignments listed here can be corrected by the use of the limb-finding algorithm in 'roughalign2.py'. See the 'roughalign2.py' and 'process.py' pages for examples.
İSky Coyote 2007