264 | 264 |
if abs(RADeg1 - RADeg2[index]) < tolerance and abs(decDeg1 -decDeg2[index]) < tolerance:
|
265 | 265 |
r[index]=0.0
|
266 | 266 |
else:
|
267 | |
raise Exception, "astCoords: calcAngSepDeg - encountered nan not due to equal RADeg, decDeg coords"
|
|
267 |
raise Exception("astCoords: calcAngSepDeg - encountered nan not due to equal RADeg, decDeg coords")
|
268 | 268 |
elif type(RADeg1) == numpy.ndarray:
|
269 | 269 |
if abs(RADeg2 - RADeg1[index]) < tolerance and abs(decDeg2 -decDeg1[index]) < tolerance:
|
270 | 270 |
r[index]=0.0
|
271 | 271 |
else:
|
272 | |
raise Exception, "astCoords: calcAngSepDeg - encountered nan not due to equal RADeg, decDeg coords"
|
|
272 |
raise Exception("astCoords: calcAngSepDeg - encountered nan not due to equal RADeg, decDeg coords")
|
273 | 273 |
else:
|
274 | 274 |
r=0.0
|
275 | 275 |
|
|
400 | 400 |
else:
|
401 | 401 |
#print sizeDiff, bestGuess, bestGuess-minGuess, bestGuess-maxGuess
|
402 | 402 |
if bestGuess == None:
|
403 | |
raise Exception, "bestGuess is None"
|
|
403 |
raise Exception("bestGuess is None")
|
404 | 404 |
guessRange = abs((maxGuess-minGuess))
|
405 | 405 |
maxGuess = bestGuess+guessRange/4.0
|
406 | 406 |
minGuess = bestGuess-guessRange/4.0
|
|
414 | 414 |
#guessStep = (maxGuess-minGuess)/20.0
|
415 | 415 |
guesses = numpy.linspace(minGuess, maxGuess, 1000)
|
416 | 416 |
if converged == False:
|
417 | |
raise Exception, "calcRADecSearchBox failed to converge"
|
|
417 |
raise Exception("calcRADecSearchBox failed to converge")
|
418 | 418 |
results.append(bestGuess)
|
419 | 419 |
|
420 | 420 |
RAMax = results[0]
|
|
424 | 424 |
|
425 | 425 |
# Sanity check
|
426 | 426 |
if (RAMax-RAMin)+(2*tolerance) < 2*targetHalfSizeSkyDeg:
|
427 | |
raise Exception, "calcRADecSearchBox failed sanity check"
|
|
427 |
raise Exception("calcRADecSearchBox failed sanity check")
|
428 | 428 |
|
429 | 429 |
return [RAMin, RAMax, decMin, decMax]
|
430 | 430 |
|