Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 38 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,39 @@
.py[cod]

# C extensions
*.so

# Packages
*.egg
*.egg-info
dist
build
*.pyc
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
lib
lib64
__pycache__

# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
.tox
nosetests.xml

# Translations
*.mo

# Mr Developer
.mr.developer.cfg
.project
.pydevproject

# Sublime Text
*.sublime*
5 changes: 3 additions & 2 deletions python/Centroid.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import division, absolute_import, print_function
from __future__ import division, absolute_import, print_function, unicode_literals

"""Measure centroids.

Note: as with all PyGuide routines, the coordinate system origin
Expand Down Expand Up @@ -131,7 +132,7 @@ def _fmtList(alist):
_MaxIter = 40 # max # of iterations
_MinPixForStats = 20 # minimum # of pixels needed to measure med and std dev

class CentroidData:
class CentroidData(object):
"""Centroid data, including the following fields:

flags; check before paying attention to the remaining data:
Expand Down
4 changes: 3 additions & 1 deletion python/Constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from __future__ import division, absolute_import, print_function
from __future__ import unicode_literals

"""Constants and parameters

History:
Expand Down Expand Up @@ -36,7 +38,7 @@
NaN = float("nan")

# Misc
class CCDInfo:
class CCDInfo(object):
"""Info about the CCD

- bias ccd bias (ADU)
Expand Down
13 changes: 9 additions & 4 deletions python/FakeData.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
from __future__ import division, absolute_import, print_function
from __future__ import absolute_import, division, print_function, unicode_literals

import numpy
import numpy.random

from . import ImUtil


"""Generates fake ccd data

History:
Expand All @@ -12,12 +19,10 @@
2005-05-16 ROwen Modified addNoise to take ccdInfo instead of 3 args.
2009-11-20 ROwen Modified to use numpy.
"""

__all__ = ["fakeStar", "addNoise"]

import numpy
import numpy.random

from . import ImUtil

_MaxValUInt16 = 2**16 - 1

Expand Down
2 changes: 2 additions & 0 deletions python/FindStars.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from __future__ import division, absolute_import, print_function
from __future__ import unicode_literals

"""Find Stars.

Note: as with all PyGuide routines, the coordinate system origin
Expand Down
7 changes: 5 additions & 2 deletions python/ImUtil.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from __future__ import division, absolute_import, print_function
from __future__ import unicode_literals


"""Image processing utilities.

History:
Expand Down Expand Up @@ -65,7 +68,7 @@ def getQuartile(sortedData, qnum):
return ((sortedData[ind0] * ratios[0]) + (sortedData[ind0+1] * ratios[1])) / (ratios[0] + ratios[1])


class ImStats:
class ImStats(object):
"""Information about an image
(including the settings use to obtain that info).

Expand Down Expand Up @@ -166,7 +169,7 @@ def skyStats(
)


class SubFrame:
class SubFrame(object):
"""Create a subframe and provide useful utility methods.

Inputs:
Expand Down
6 changes: 5 additions & 1 deletion python/StarShape.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
from __future__ import division, absolute_import, print_function
from __future__ import unicode_literals



"""StarShape

Fit a a star to a symmetrical double gaussian.
Expand Down Expand Up @@ -102,7 +106,7 @@
# minimum radius
_MinRad = 3.0

class StarShapeData:
class StarShapeData(object):
"""Guide star fit data

Attributes:
Expand Down
1 change: 1 addition & 0 deletions python/Version.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from __future__ import unicode_literals
__version__ = "2.3.0"
1 change: 1 addition & 0 deletions python/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
some of the subtleties.
"""
from __future__ import absolute_import
from __future__ import unicode_literals
from .Version import __version__
from .Constants import *
from .Centroid import *
Expand Down
19 changes: 11 additions & 8 deletions releaseNewVersion.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
To use:
./releaseNewVersion.py
"""
from __future__ import print_function
from __future__ import unicode_literals

from __future__ import with_statement
import os
import re
Expand All @@ -18,7 +21,7 @@
import Version # noqa must come after modifying sys.path

queryStr = "Version from %s.Version = %s; is this OK? (y/[n]) " % (PkgName, Version.__version__,)
versOK = raw_input(queryStr)
versOK = input(queryStr)
if not versOK.lower() == "y":
sys.exit(0)

Expand All @@ -29,24 +32,24 @@
if versMatch:
histVersStr = versMatch.groups()[0]
if histVersStr == Version.__version__:
print "Version in VersionHistory.html matches"
print("Version in VersionHistory.html matches")
break
else:
print "Error: version in VersionHistory.html = %s != %s" % (histVersStr, Version.__version__)
print("Error: version in VersionHistory.html = %s != %s" % (histVersStr, Version.__version__))
sys.exit(0)

print "Status of git repository:"
print("Status of git repository:")

subprocess.call(["git", "status"])

versOK = raw_input("Is the git repository up to date? (y/[n]) ")
versOK = input("Is the git repository up to date? (y/[n]) ")
if not versOK.lower() == "y":
sys.exit(0)

print "Git repository OK"
print("Git repository OK")

if UploadToPyPI:
print "Uploading to PyPI"
print("Uploading to PyPI")
status = subprocess.call(["python", "setup.py", "sdist", "upload"])
if status != 0:
print "Build and upload failed!"
print("Build and upload failed!")
3 changes: 2 additions & 1 deletion scripts/doPyGuide.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
2009-11-20 ROwen Modified to use numpy.
Stop setting NUMERIX.
"""
from __future__ import unicode_literals
import sys
import pyfits
import PyGuide
Expand Down Expand Up @@ -341,7 +342,7 @@ def showDef():
globalDict = globals()
for paramName in FindParamNames:
print("%s = %s" % (paramName, globalDict[paramName]))
print
print()

def help():
print("""The following variables are available:
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python

from distutils.core import setup, Extension
import sys
import os
Expand Down
Loading