pro plotdata ; This procedure plots the data that has been written, in the same ; format as specified in fmt below, from the opacities.pro routine. ; At the moment, there is nothing fancy, limits are set by the program ; and not me; the lines are all plain lines; there are no titles nor ; labels, but IT WORKS! ; Copied almost verbatim from page 153 of Practical IDL Programming ; maxrec=200L ; from page 153 of idl book openr, lun, 'opacities.dat', /get_lun openw, 3, 'checkplot.dat' ; fmt = '(1x, f7.2, 2x, f7.4, 3(2x, f8.5))' ; the above line screwed up the plotting, so ignore it record = {temp:0.0, pelog:0.0, loganuh:0.0, loganuhng:0.0, $ logsigtot:0.0} data = replicate(record, maxrec) nrecords = 0L recnum = 1L while (eof(lun) ne 1) do begin on_ioerror, bad_rec error = 1 readf, lun, record ;, format=fmt did bad things error = 0 data[nrecords] = record nrecords = nrecords + 1L if (nrecords eq maxrec) then begin free_lun, lun message, 'what a complete idiot: max reached - increase maxrec' endif bad_rec: if (error eq 1) then print, 'bad data at record ', recnum recnum = recnum + 1 endwhile data = data[0 : nrecords -1] plot, data.temp, data.loganuh, linestyle=2, title='Opacities', $ xtitle='Temperature(k)', ytitle='log Opacity' oplot, data.temp, data.loganuhng, linestyle=3 oplot, data.temp, data.logsigtot, linestyle=0 ; free_lun, lun free_lun, 3 end