Skip to content

Commit

Permalink
Try only catching KeyError for no 'dist'/'distance' column.
Browse files Browse the repository at this point in the history
  • Loading branch information
farr committed Oct 14, 2016
1 parent 095bc16 commit 970dd0f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/run_sky_area
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ if __name__ == '__main__':
if args.enable_distance_map:
try:
dist = data['dist']
except (ValueError, KeyError):
except KeyError:
try:
dist = data['distance']
except (ValueError, KeyError):
except KeyError:
parser.error("The posterior samples file '{0}' does not have a distance column named 'dist' or 'distance'. Cannot generate distance map.".format(args.samples))
pts = np.column_stack((data['ra'], data['dec'], dist))
KDEClass = sac.Clustered3DKDEPosterior
Expand Down

0 comments on commit 970dd0f

Please sign in to comment.