; NAME: ; rdphotfile ; ; PURPOSE: ; To read a the photometric system file for xfluxcal. ; ; CATEGORY: ; Data Reduction ; ; CALLING SEQUENCE: ; rdphotfile,filename,nsystems,systems,filters,filenames,vegazero,$ ; CANCEL=cancel ; ; INPUTS: ; filename - The name of the photsystem file. ; ; OUTUTS: ; nsystems - The number of photometric systems ; systems - A string array with the names of the photometric systems ; fiilters - A structure where each field is a string array of ; the names of filters for each system ; filenames - A structure where each field is a string array of ; the files name with the transmissions of each filter ; for each system ; vega - An array of magnitude zero points for Vega ; ; KEYWORD PARAMETERS: ; CANCEL - Set on return if something is wrong. ; ; PROCEDURE'S USED: ; Requires the Astronomy User's Library ; ; PROCEDURE: ; Obvious ; ; REVISION HISTORY: ; 2002-02-10 - Written by M. Cushing, Institute for Astronomy, UH ; pro rdphotfile,filename,nsystems,systems,filters,filenames,vegazero,$ CANCEL=cancel cancel = 0 ; Check parameters if n_params() lt 1 then begin cancel = 1 print, 'Syntax - filename,nsystems,systems,filters,filenames,vegazero,$' print, ' CANCEL=cancel' return endif zparcheck, 'readphotfile', filename, 1,7,0, 'Filename' nsystems = numlines(filename) openr,lun,filename,/GET_LUN line = '' for i = 0,nsystems-1 do begin readf,lun,line parse = strsplit(line,' ',/EXTRACT) key = 'system'+string(i+1,format='(i2.2)') if i eq 0 then begin systems = strtrim(parse[0],2) filters = create_struct(key,strsplit(parse[1],',',/EXTRACT)) filenames = create_struct(key,strsplit(parse[2],',',/EXTRACT)) vegazero = float(parse[3]) endif else begin systems = [systems,strtrim(parse[0],2)] filters = create_struct(filters,key,strsplit(parse[1],',',/EXTRACT)) filenames =create_struct(filenames,key,strsplit(parse[2],',',/EXTRACT)) vegazero = [vegazero,float(parse[3])] endelse endfor end