Skip to content

Commit

Permalink
Added limit of 5 spectra to inventory(plot=True) method call.
Browse files Browse the repository at this point in the history
  • Loading branch information
hover2pi committed Mar 4, 2016
1 parent 1ac3598 commit b15c2e8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion astrodbkit/astrodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,9 @@ def inventory(self, source_id, plot=False, fetch=False, fmt='table'):

# Plot all the spectra
if plot and table.lower()=='spectra' and data:
for i in self.query("SELECT id FROM spectra WHERE source_id={}".format(source_id), unpack=True)[0]:
if len(data)>5: print 'Only plotting first 5 spectra. Run plot_spectrum() method to plot individually.'

for i in self.query("SELECT id FROM spectra WHERE source_id={} LIMIT 5".format(source_id), unpack=True)[0]:
self.plot_spectrum(i)

else: pass
Expand Down

0 comments on commit b15c2e8

Please sign in to comment.