;+ ; This class extends the rows_index_section class to properly manage the rows section ; for a spectral line index file; that is, an index file where each row line represents ; a spectrum. ; ; @file_comments ; This class extends the rows_index_section class to properly manage the rows section ; for a spectral line index file; that is, an index file where each row line represents ; a spectrum. ; ; @inherits rows_index_section ; ; @private_file ;- PRO line_index_section__define ris = { LINE_INDEX_SECTION, $ inherits rows_index_section $ } END ;+ ; Class Constructor ; Here the formats for the rows are determined: how to list them verbosly and ; quietly. ; @private ;- FUNCTION LINE_INDEX_SECTION::init, lun, filename r = self->ROWS_INDEX_SECTION::init(lun, filename) ; all floats and doubles have the same format self.float_format = 'e-16.9' flt = self.float_format ; array that contains all info needed for printing out info + header ; ***NOTE: this order must follow the order of {row_line_info_strct} *self.frmt = [['i-6','#INDEX','a-6'], $ ['a-16','PROJECT','a-16'], $ ['a-32','FILE','a-32'], $ ['i-3','EXTENSION','a-3'], $ ['i-5','ROW','a-5'], $ ['a-16','SOURCE','a-16'], $ ['a-9','PROCEDURE','a-9'], $ ['i-4','E2ESCAN','a-4'], $ ['i-3','SUBSCAN','a-3'], $ ['i-4','SCAN','a-4'], $ ['a-3','POLARIZATION','a-3'], $ ['i-5','PLNUM','a-5'], $ ['i-5','IFNUM','a-5'], $ ['i-4','FEED','a-4'], $ ['i-5','FDNUM','a-5'], $ ['i-3','INT','a-3'], $ ['i-6','NUMCHN','a-6'], $ ['a-3','SIG','a-3'], $ ['a-3','CAL','a-3'], $ ['a-7','SAMPLER','a-7'], $ [flt,'AZIMUTH','a-16'], $ [flt,'ELEVATION','a-16'], $ [flt,'LONGITUDE','a-16'], $ [flt,'LATITUDE','a-16'], $ [flt,'LST','a-16'], $ [flt,'CENTFREQ','a-16'], $ [flt,'RESTFREQ','a-16'], $ [flt,'VELOCITY','a-16'], $ [flt,'RESOLUTION','a-16'], $ ['a-22','DATEOBS','a-22'], $ [flt,'BANDWIDTH','a-16'], $ [flt,'EXPOSURE','a-16'], $ [flt,'TSYS','a-16'], $ ['i-5','NSAVE','a-5'] $ ] ; indicies into above array showing what to print when NOT in verbose mode *self.frmt_quiet = [0,5,9,6,10,12,14,15,17,18] ; uese the above arrays to create format strings self->create_formats return,1 END ;+ ; Returns the specail structure needed for spectal line data ; @returns line_row_info_strct structure ; @private ; - FUNCTION LINE_INDEX_SECTION::get_row_info_strct @line_row_info return, {line_row_info_strct} END ;+ ; When the list command is issued without the verbose command, this method prints only the ; columns selected in self.frmt_quiet, and also prints any additional info requested via the ; many keywords ; @keyword pproj {in}{optional}{type=boolean} prints the column labeled PROJ ; @keyword pfile {in}{optional}{type=boolean} prints the column labeled FILE ; @keyword pext {in}{optional}{type=boolean} prints the column labeled EXT ; @keyword prow {in}{optional}{type=boolean} prints the column labeled ROW ; @keyword pscan {in}{optional}{type=boolean} prints the column labeled SCAN ; @keyword psub {in}{optional}{type=boolean} prints the column labeled SUB ; @keyword pbeam {in}{optional}{type=boolean} prints the column labeled BEAM ; @keyword psig {in}{optional}{type=boolean} prints the column labeled SIG ; @keyword pcal {in}{optional}{type=boolean} prints the column labeled CAL ; @keyword paz {in}{optional}{type=boolean} prints the column labeled AZIMUTH ; @keyword pel {in}{optional}{type=boolean} prints the column labeled ELEVATION ; @keyword plng {in}{optional}{type=boolean} prints the column labeled LONGITUDE AXIS ; @keyword plat {in}{optional}{type=boolean} prints the column labeled LATITUDE AXIS ; @keyword plst {in}{optional}{type=boolean} prints the column labeled LST ; @keyword prest {in}{optional}{type=boolean} prints the column labeled REST FREQ ; @keyword pvel {in}{optional}{type=boolean} prints the column labeled VELOCITY ; @keyword pres {in}{optional}{type=boolean} prints the column labeled RESOLUTION ; @keyword pdate {in}{optional}{type=boolean} prints the column labeled DATE_OBS ; @keyword pband {in}{optional}{type=boolean} prints the column labeled BANDWIDTH ; @keyword pexp {in}{optional}{type=boolean} prints the column labeled EXPOSURE ; @keyword ptsys {in}{optional}{type=boolean} prints the column labeled TSYS ; @private ;- PRO LINE_INDEX_SECTION::list_quiet, rows, pproj=pproj, pfile=pfile, pext=pext, prow=prow, pscan=pscan, psub=psub, pbeam=pbeam, psig=psig, pcal=pcal, paz=paz, pel=pel, plng=plng, plat=plat, plst=plst, prest=prest, pvel=pvel, pres=pres, pdate=pdate, pband=pband, pexp=pexp, ptsys=ptsys compile_opt idl2 row_info = *self.rows frmt_info = *self.frmt frmt_quiet = *self.frmt_quiet ; prepare the header - first the columns that are always displayed header = self.format_header_quiet ; print using 'more' format if self.more_format then openw, out, '/dev/tty', /get_lun, /more ; now add extra header stuff if keyword_set(pproj) then header += ' '+self->get_frmt_header_keyword('PROJ') if keyword_set(pfile) then header += ' '+self->get_frmt_header_keyword('FILE') if keyword_set(pext) then header += ' '+self->get_frmt_header_keyword('EXT') if keyword_set(prow) then header += ' '+self->get_frmt_header_keyword('ROW') if keyword_set(pscan) then header += ' '+self->get_frmt_header_keyword('SCAN') if keyword_set(psub) then header += ' '+self->get_frmt_header_keyword('SUB') if keyword_set(pbeam) then header += ' '+self->get_frmt_header_keyword('BEAM') if keyword_set(psig) then header += ' '+self->get_frmt_header_keyword('SIG') if keyword_set(pcal) then header += ' '+self->get_frmt_header_keyword('CAL') if keyword_set(paz) then header += ' '+self->get_frmt_header_keyword('AZIMUTH') if keyword_set(pel) then header += ' '+self->get_frmt_header_keyword('ELEVATION') if keyword_set(plng) then header += ' '+self->get_frmt_header_keyword('LONGITUTE AXIS') if keyword_set(plat) then header += ' '+self->get_frmt_header_keyword('LATITUDE AXIS') if keyword_set(plst) then header += ' '+self->get_frmt_header_keyword('LST') if keyword_set(prest) then header += ' '+self->get_frmt_header_keyword('REST FREQ') if keyword_set(pvel) then header += ' '+self->get_frmt_header_keyword('VELOCITY') if keyword_set(pres) then header += ' '+self->get_frmt_header_keyword('RESOLUTION') if keyword_set(pdate) then header += ' '+self->get_frmt_header_keyword('DATE_OBS') if keyword_set(pband) then header += ' '+self->get_frmt_header_keyword('BANDWIDTH') if keyword_set(pexp) then header += ' '+self->get_frmt_header_keyword('EXPOSURE') if keyword_set(ptsys) then header += ' '+self->get_frmt_header_keyword('TSYS') ; print the final header self->print_line, header, out ; print each row, collecting default data plus extra requests for i = 0L, (n_elements(rows)-1) do begin ; get the next row r = row_info[rows[i]] ; append default values line = '' for j=0,n_elements(frmt_quiet)-1 do begin if (j ne 0) then line += ' ' line += string(r.(frmt_quiet[j]),format='('+frmt_info[0,frmt_quiet[j]]+')') endfor ; append extra requested values if keyword_set(pproj) then line += ' '+self->get_frmt_row_value('PROJ',r) if keyword_set(pfile) then line += ' '+self->get_frmt_row_value('FILE',r) if keyword_set(pext) then line += ' '+self->get_frmt_row_value('EXT',r) if keyword_set(prow) then line += ' '+self->get_frmt_row_value('ROW',r) if keyword_set(pscan) then line += ' '+self->get_frmt_row_value('SCAN',r) if keyword_set(psub) then line += ' '+self->get_frmt_row_value('SUB',r) if keyword_set(pbeam) then line += ' '+self->get_frmt_row_value('BEAM',r) if keyword_set(psig) then line += ' '+self->get_frmt_row_value('SIG',r) if keyword_set(pcal) then line += ' '+self->get_frmt_row_value('CAL',r) if keyword_set(paz) then line += ' '+self->get_frmt_row_value('AZIMUTH',r) if keyword_set(pel) then line += ' '+self->get_frmt_row_value('ELEVATION',r) if keyword_set(plng) then line += ' '+self->get_frmt_row_value('LONGITUDE AXIS',r) if keyword_set(plat) then line += ' '+self->get_frmt_row_value('LATITUDE AXIS',r) if keyword_set(plst) then line += ' '+self->get_frmt_row_value('LST',r) if keyword_set(prest) then line += ' '+self->get_frmt_row_value('REST FREQ',r) if keyword_set(pvel) then line += ' '+self->get_frmt_row_value('VELOCITY',r) if keyword_set(pres) then line += ' '+self->get_frmt_row_value('RESOLUTION',r) if keyword_set(pdate) then line += ' '+self->get_frmt_row_value('DATE_OBS',r) if keyword_set(pband) then line += ' '+self->get_frmt_row_value('BANDWIDTH',r) if keyword_set(pexp) then line += ' '+self->get_frmt_row_value('EXPOSURE',r) if keyword_set(ptsys) then line += ' '+self->get_frmt_row_value('TSYS',r) ; print the row self->print_line, line, out endfor if self.more_format then free_lun, out END