Skip to content

Commit

Permalink
fix smallanyana skeletons
Browse files Browse the repository at this point in the history
  • Loading branch information
SpheMakh committed Jun 7, 2024
1 parent 9648029 commit 4509dee
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Tigger/bin/tigger_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ def convert_coordinates(coords):
# recompute 'r' attribute (unless --center is in effect, in which case it's going to be done anyway below)
if options.refresh_r:
for src in model2.sources:
src.setAttribute('r', Coordinates.angular_dist_pos_angle(ra0, dec0, *model.fieldCenter())[0])
src.setAttribute('r', Coordinates.angular_dist_pos_angle(src.pos.ra, src.pos.dec, *model.fieldCenter())[0])
print("Appended %d sources from %s (%s)" % (len(model2.sources), filename, append_doc))

# apply center, if specified
Expand Down Expand Up @@ -515,8 +515,8 @@ def convert_coordinates(coords):
tags = ff[3:] if len(ff) > 3 else []
except:
parser.error("Invalid --add-brick setting %s" % brickspec)
if [src.name for src in sources if src.name == name]:
print("Error: model already contains a source named '%s'" % name)
if [src.name for src in sources if src.name == srcname]:
print("Error: model already contains a source named '%s'" % srcname)
# add brick
from astropy.io import fits as pyfits
from astLib.astWCS import WCS
Expand Down
2 changes: 1 addition & 1 deletion Tigger/bin/tigger_make_brick.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def main():
src.flux.I = max_flux
src.shape.ex, src.shape.ey = sx, sy
src.shape.nx, src.shape.ny = nx, ny
src.shape.pad = pad
src.shape.pad = options.pad
break
# not contained, make new source object
else:
Expand Down
2 changes: 1 addition & 1 deletion Tigger/bin/tigger_restore.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def main():
if not isinstance(dum, float):
raise TypeError("Primary beam expression does not evaluate to a float")
except Exception as exc:
print("Bad primary beam expression '%s': %s" % (pb, str(exc)))
print("Bad primary beam expression '%s': %s" % (options.pb, str(exc)))
sys.exit(1)
if not freq:
print("Model must contain a reference requency, or else specify one with --freq.")
Expand Down
2 changes: 1 addition & 1 deletion Tigger/bin/tigger_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def lookupObject(src, tagname):
# else some other type is specified -- use it to convert the value
elif typename:
try:
newval = getattr(__builtin__, typename)(value)
newval = getattr(globals()["__builtin__"], typename)(value)
except:
print("Can't parse \"%s\" as a value of type %s" % (value, typename))
sys.exit(2)
Expand Down
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ tigger-tag = "Tigger.bin.tigger_tag:main"
tigger-restore = "Tigger.bin.tigger_restore:main"
tigger-make-brick = "Tigger.bin.tigger_make_brick:main"


[tool.poetry.group.tests]
optional = true
[tool.poetry.group.tests.dependencies]
pytest = "^7.1.3"
flake8 = "*"



[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

0 comments on commit 4509dee

Please sign in to comment.