PyGuide Version History
Documentation update 2015-07-07
2.3.0 2017-03-14
- Added "from __future__ import division, absolute_import, print_function" to library modules.
- Replaced ==/!= None with is/is not None to improve compatibility with modern numpy and modernize the code. I would have done the same with True and False but no such equality comparisons were found.
- Use the modern numpy API to eliminate warnings. This turned out to be trivial: define a new constant, import from a different header file and switch from NP_IN_ARRAY and cousins to NP_ARRAY_IN_ARRAY.
- Simplify setup.py, taking advantage of advances in disutils.
- Removed support for "--ups" from setup.py because it was broken and was for an ancient version of ups.
- Update releaseNewVersion.py for git.
- Added a link to the new github repository to docs/Manual.html.
- Fixed a typo in a FindStars doc string.
2.2.2b1 2015-05-08
- Removed obsolete "except (SystemExit, KeyboardInterrupt)" clause from python code and changed except clauses to use "as".
- Corrected remaining references to numarray in the manual.
2.2.1 2013-03-01
- Updates to the manual (which still listed numarray as a requirement).
2.2.0 2012-04-12
- Modified to use numpy and scipy instead of numarray
- Results are more robust if bias is unrealistically high (the bias is reduced internally if larger than the mean radial profile at any point).
2.1.5 2008-10-01
- doPyGuide minor improvements:
- Set environment variable NUMERIX so pyfits uses numarray
- Improved initial output to include information about defaults
- Added short help strings to doFindStars and doCentroid
- Changed bias from int to float
2.1.4 2008-01-02
- Added doSmooth argument to centroid function, as suggested by Adam Ginsburg.
- Fixed a bug in StarShapeData.__repr__ (reported by Adam Ginsburg).
2.1.3 2007-06-27
- src/RadProfModule.c: Use PyMODINIT_FUNC as the type of return for the init function instead of void (apparently recc. for python 2.3 and later).
- Detabbed all source code.
- Changed #!/usr/local/bin/python to #!/usr/bin/env python in all executable python code.
- Moved the distribution from my anonymous ftp site to my web site and updated the links in the manual accordingly.
2.1.2 2006-06-07
doPyGuide
- Added __version__ to PyGuide and modified setup.py to read it.
- doPyGuide improvements
- Output of star data output is more uniform and robust. One subroutine is used for all star output and if formatting fails, the data is printed unformatted (along with the error message).
- Bug fix: doCentroid would fail without a saturation mask (output formatting errors).
- Reorganized the files in the distribution.
2.1.1 2006-05-03
This is primarily a bug-fix release. However, doFindStars was also renamed to doPyGuide.
- Optionally installs information for the Fermilab/Princeton UPS runtime loader (install using "python setup.py install --ups").
- doPyGuide:
- Renamed from doFindStars
- Added to setup.py in such a way that its #!..../python line is corrected (if necessary) during installation.
- Bug fix: doCentroid mis-handled return values from loadFiles.
- PyGuide.Centroid:
- Bug fix: checkSignal returned the wrong thing in some cases.
- Workaround: some older versions of numarray would raise an exception if the initial guess that was too far off the image (due to mishandling empty regions).
- python/StarShape.py
- Bug fix: _fitRadProfile had bogus diagnostic print.
- Removed unused constants _FWHMMin/Max/Delta.
- python/FitUtil.py: two raised exceptions were misspelled.
- python/ImUtil.py
- Renamed subIJPosOK->subIJOK to match subXYOK.
- Renamed subIJPosOK argument subIJPos -> subIJ to match other args.
- Renamed subXYOK argumeng subXYPos -> subXY to match other args.
- Bug fix: subIJPosOK had an argument name issue.
- Bug fix: test code broken.
2.1 2005-10-14
- Float32 is now the basic image data type, rather than UInt16. This makes it far more compatible with various image formats, including calibrated CCD data. It is also more compatible with pyfits.
- Saturated pixels are now marked by a saturation mask, rather than by comparing pixel values to a saturation level. This was done because calibrated images may not have a fixed saturation level. Note that ccdInfo.satLevel is still available, but is no longer used by PyGuide. You may find it useful for generating a saturation mask.
2.0 2005-06-19
This is a major overhaul of PyGuide. The main purpose was to make centroiding and star shape fitting more robust. In particular centroiding should no longer attempt to centroid random noise. However, I also took the opportunity to clean up a number of other issues.
Incompatible changes:
- centroid and starShape return data even when they fail. The returned objects now have an isOK flag that you must check and a msgStrs field for warning and error messages (if isOK is false then msgStrs[-1] will contain an error message). CentroidData also includes nSat, the number of saturated pixels, which you should check.
- findStars:
- Returns a list of centroid data and an ImStats object containing statistics for the entire masked image. Formerly it returned an isSaturated flag, a list of centroid data and a median. (Note: findStars still does not return data for centroids that fail.)
- Returns centroided data for stars with saturated pixels. Formerly it ignored such stars. It is up to you to decide if the star has so many saturated pixels that it is unusable. Please be careful because saturated stars are likely to turn up first in the list of returned stars.
- Argument ccdInfo replaces four old arguments.
- Argument dataCut renamed to thresh (to match the 3.5m hub).
- Argument ds9 renamed to doDS9.
- New argument rad; if specified it overrides radMult.
- centroid:
- Overhauled to verify that there is signal before attempting to centroid the data. It uses essentially the same algorithm as findStars for this purpose. To avoid this check, use the new routine basicCentroid.
- Returns CentroidData even if the centroid fails (instead of raising an exception). CentroidData now includes the following important new fields:
- isOK: if False the centroid failed
- msgStr: contains an error message if isOK is false and may contain a warning message even if isOK is true.
- nSat: the number of saturated pixels. It is your responsibility to determine if there are so many saturated pixels that you should not trust the centroid.
- New argument ccdInfo replaces four old arguments.
- New argument thresh
- New argument verbosity replaces debugging constants.
- Argument ds9 renamed to doDS9.
- starShape:
- Returns StarShapeData even if shape fitting fails (instead of raising an exception). StarShapeData now includes the following important new fields:
- isOK: if False the star shape fitting failed
- msgStr: contains an error message if isOK is false and may contain a warning message even if isOK is true.
- New argument rad replaces predFWHM.
- New debugging arguments verbosity and doPlot replace debugging constants.
- FakeData.addNoise: new argument ccdInfo replaces three exising arguments.
- ImUtil:
- subFrameCtr returns a SubFrame object. This object has methods to return a pointer to the subframe array as well as methods for coordinate conversion.
- skyStats returns an ImStats object. It also accepts any kind of array, not just a numarray.ma masked array, Finally, it now accepts a new argument "thresh" and computes dataCut.
Other changes:
- centroid now (optionally) checks for valid signal both before and after centroiding. As a result, the returned background stats are properly centered at the centroid position (rather than being centered on the initial guess).
- findStars now performs the full "valid signal" before and after check when centroiding. This eliminates invalid centroids in areas of high background (where findStars thinks there is usable signal, but there is not).
- starShape algorithm tweaked. It now appears to be pickier about what it will fit, but often seems to give a better answer for reasonable data. Tweaks include:
- The initial guess has been greatly improved (at the expense of speed). It explores a wide range of possible fwhm (from 1 to rad*1.5 pixels).
- Modified to use Jim Gunn's original weighting function. This seems to give somewhat better its and fewer surprising failures (at least for the test code). However, chiSq is no longer even remotely normalized.
- Modified to use Jim Gunn's original weighting function. This seems to give somewhat better its and fewer surprising failures (at least for the test code). However, chiSq is no longer even remotely normalized.
- The initial guess has been greatly improved (at the expense of speed). It explores a wide range of possible fwhm (from 1 to rad*1.5 pixels).
- Uses Brent's method to fit. Note: the implementation of Brent's method was borrowed from scipy, but is built into PyGuide.
- ImUtil.skyStats now uses ma.compressed() instead of ma.compressed().raw_data() on masked arrays. This is the right way to do it, but I'm not sure if it actually makes a difference.
- ImUtil.getQuartile now raises ValueError for arrays with less than 3 elements.
- doFindStars (a utility module which now does so many things that it should be renamed):
- Added doCentroid function
- Added loadFiles function.
- Added an invertMask argument to the doFindStars function.
- Moved the python source code up one level (and modifies setup.py accordingly) to make the layout more logical.
1.2.1 2005-03-31
Improved doFindStars so that the mask can be specified as a file name and that parameters may be specified as keyword arguments (to easily override a default value).
Minor tweaks:
- findStars ds9 display (if ds9 true): displays the smoothed masked data in frame 3 if verbosity >= 2. Otherwise does not set frame 3, for a more space-efficient display.
- centroid: improved the debug output for where the walk is going. Slightly improved the efficiency of the test for "walked too far".
- radProf.radAsymmWeighted: fixed two errors in the doc string regarding the arguments and tweaked the description of ijCtr and rad arguments in all doc strings.
Bug fix: findStars failed while trying to display star data if verbosity >= 2.
1.2 2005-02-08
Modified the main routines (listed below) to use conventional xy position instead of ij array index-based position: the axes are swapped and the zero point is has changed (see the manual for more information). As a result, the following routines have modified arguments and the first two also have modified return data:
- findStars
- centroid
- starShape
- FakeData.fakeStar
- ImUtil.subFrameCtr
Added coordinate conversion routines to ImUtil to convert between ij position, xy position and ds9 position.
1.1.1 2005-01-31
Bug fixes:
- FakeData.py had __all__ == instead of __all__ =.
1.1 2004-12-01
Visible Changes:
- doFindStars:
- Renamed function from starUtil to doFindStars to match module name.
- Replaced arguments with globals to make it easier to change settings.
- Constants: added NaN
- StarShape: StarShapeData: made NaN the default for all arguments.
Bug fixes:
- doFindStars: if starShape failed, crashed trying to set starData.
Internal Changes:
- Added __all__ to StarShape.py, ImUtil.py, FakeData.py
1.0 2004-10-22
First public release.