From 22f118d961ac636808c7ee9fa3796ba5d4fefa56 Mon Sep 17 00:00:00 2001 From: Bryan Steinbach Date: Sun, 3 Oct 2010 15:13:39 -0700 Subject: [PATCH] added file existence check to problem1 --- week4/problem1/starcam-plot.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/week4/problem1/starcam-plot.py b/week4/problem1/starcam-plot.py index 9daf2b9..4e08436 100755 --- a/week4/problem1/starcam-plot.py +++ b/week4/problem1/starcam-plot.py @@ -4,10 +4,18 @@ AY250 HW4 Problem 1 Make a nice plot Author: Bryan Steinbach ''' + +import os + import numpy as np import pylab -azs,dazs,model_dazs,els,dels,model_dels = np.load('starcamdata-20100828.npy') +fn = 'starcamdata-20100828.npy' +if not os.path.exists(fn): + print "Couldn't find %s"%fn + exit() + +azs,dazs,model_dazs,els,dels,model_dels = np.load(fn) nsource = 15 total_time = 6.1 -- 2.11.4.GIT