Skip to content

Commit cf044d4

Browse files
committed
add runs check and return with error is len()=0
1 parent 2d83ac7 commit cf044d4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

psflux/plot_flux_ccdb.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ def main():
105105

106106
# get run list
107107
runs = rcdb_conn.select_runs(RCDB_QUERY, BEGINRUN, ENDRUN)
108+
#print runs
109+
#print len(runs)
110+
if len(runs) == 0:
111+
print("There are no runs matching the query \""+RCDB_QUERY +"\" between runs "+str(BEGINRUN)+" and "+str(ENDRUN))
112+
return
108113

109114
photon_endpoint = array('f')
110115
tagm_tagged_flux = array('f')
@@ -117,7 +122,7 @@ def main():
117122

118123
# Loop over runs
119124
for run in runs:
120-
125+
print run
121126
# select run conditions: AMO, PARA, and PERP and polarization angle
122127
if RCDB_POLARIZATION != "":
123128
conditions_by_name = run.get_conditions_by_name()

0 commit comments

Comments
 (0)