;+ ; This class extends the rows_index_section class to properly manage the rows section ; for a continuum index file; that is, an index file where each row line represents ; a continuum. ; ; @file_comments ; This class extends the rows_index_section class to properly manage the rows section ; for a continuum index file; that is, an index file where each row line represents ; a continuum. ; ; @inherits rows_index_section ; @private_file ; ;- PRO cntm_index_section__define ifile = { CNTM_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 CNTM_INDEX_SECTION::init, lun, filename r = self->ROWS_INDEX_SECTION::init(lun, filename) ; array that contains all info needed for printing out info + header ; ***NOTE: this order must follow the order of {row_cntm_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-8','FIRSTROW','a-8'], $ ['i-7','NUMROWS','a-7'], $ ['i-6','STRIDE','a-6'], $ ['a-8','SOURCE','a-8'], $ ['a-9','PROCEDURE','a-9'], $ ['i-4','E2ESCAN','a-4'], $ ['i-7','SUBSCAN','a-7'], $ ['i-4','SCAN','a-4'], $ ['a-3','POLARIZATION','a-3'], $ ['i-5','IFNUM','a-5'], $ ['a-3','SIG','a-3'], $ ['a-3','CAL','a-3'], $ ['i-5','NSAVE','a-5'] $ ] ; indicies into above array showing what to print when NOT in verbose mode *self.frmt_quiet = [0,7,11,8,12] ;self.format_string = '(i5,2x,a16,2x,a32,2x,i5,2x,i7,2x,i5,2x,i5,2x,a8,2x,a8,2x,i4,2x,i3,2x,i4,2x,a2,2x,i3,2x,a1,2x,a1)' ;self.format_header = '#INDEX PROJ FILE EXT 1ST_ROW N_ROWS STRIDE SOURCE PROC SCAN SUB MC_S POL IF SIG CAL' ;self.format_string_quiet = '(i5,2x,a8,2x,i5,2x,a8,2x,2a)' ;self.format_header_quiet = '#INDEX SOURCE SCAN PROC POL' ; all floats and doubles have the same format self.float_format = 'e-16.9' ; use the above arrays to construct format and header strings self->create_formats return, r END ;+ ; Returns the specail structure needed for spectral cntm data ; @returns cntm_row_info_strct structure ; @private ; - FUNCTION CNTM_INDEX_SECTION::get_row_info_strct @cntm_row_info return, {cntm_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 1ST_ROW ; @keyword pnrow {in}{optional}{type=boolean} prints the column labeled N_ROWS ; @keyword pstride {in}{optional}{type=boolean} prints the column labeled STRIDE ; @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 ; @private ;- PRO CNTM_INDEX_SECTION::list_quiet, rows, pproj=pproj, pfile=pfile, pext=pext, prow=prow, pnrow=pnrow, pstride=pstride, pscan=pscan, psub=psub, pbeam=pbeam, psig=psig, pcal=pcal 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 ; 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('1ST_ROW') if keyword_set(pnrow) then header += ' '+self->get_frmt_header_keyword('N_ROWS') if keyword_set(pstride) then header += ' '+self->get_frmt_header_keyword('STRIDE') 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') ; print the final header print, header ; 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('1ST_ROW',r) if keyword_set(pnrow) then line += ' '+self->get_frmt_row_value('N_ROWS',r) if keyword_set(pstride) then line += ' '+self->get_frmt_row_value('STRIDE',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) ; print the row print, line endfor END