Skip to content

Commit

Permalink
Updated to delete DS9 region file if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
DaftPict authored and ttdu committed Jul 16, 2024
1 parent 308deca commit bab72a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@
"source": [
"from astroquery.mast import Mast\n",
"from ipyaladin import Aladin\n",
"from selectSIAF import defineApertures, getVertices, computeStcsFootprint, computeRegionFootprint\n",
"from regions import Regions\n",
"from selectSIAF import defineApertures, getVertices, computeStcsFootprint, computeRegionFootprint\n",
"\n",
"import matplotlib.pyplot as plt\n",
"import os\n",
"import pysiaf\n",
"import time"
]
Expand Down Expand Up @@ -296,7 +297,9 @@
" regionList.append(apertureRegion)\n",
" \n",
"# Provide a writeable file location on your system\n",
"regionFile = 'e:\\\\Projects\\\\Scratch\\\\regionTest.reg'\n",
"regionFile='e:\\\\Projects\\\\Scratch\\\\regionTest.reg'\n",
"if os.path.isfile(regionFile):\n",
" os.remove(regionFile)\n",
"combinedRegion = Regions(regionList)\n",
"combinedRegion.write(regionFile)"
]
Expand Down Expand Up @@ -403,7 +406,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.3"
"version": "3.11.5"
}
},
"nbformat": 4,
Expand Down
5 changes: 1 addition & 4 deletions notebooks/multi_mission/display_footprints/selectSIAF.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def getVertices(apertureSiaf):
xVertices = apertureSiaf.V2Ref
yVertices = apertureSiaf.V3Ref
if (apertureSiaf.observatory == 'HST' and apertureSiaf.AperShape == 'PICK'):
print('Unsupported shape ',apertureSiaf.AperShape)
print('Unsupported shape ', apertureSiaf.AperShape)
xVertices = None
yVertices = None

Expand All @@ -258,9 +258,6 @@ def computeStcsFootprint(apertureSiaf, skyRa, skyDec):
elif apertureSiaf.AperShape == 'CIRC':
radius = apertureSiaf.maj/3600.0
apertureSregion = 'CIRCLE ICRS {} {} {} '.format(skyRa, skyDec, radius)
#elif apertureSiaf.AperShape == 'PICK':
#radius = apertureSiaf.maj/3600.0
#apertureSregion = 'POLYGON ICRS {} {} {} '.format(skyRa, skyDec, radius)
else:
print('Unsupported shape {}').format(apertureSiaf.AperShape)

Expand Down

0 comments on commit bab72a7

Please sign in to comment.