PRO load_seeing_coef ,file,field,n
;
;+
; NAME:
;  load_star_coef
;
; PURPOSE:
;  loading the seeing weight coefficients from Ariel's 
;
; CALLING SEQUENCE:
;  called from within systematics_weight.pro 
;  load_star_coef, file_name, field, n_line
;
; OPTIONAL INPUTS:
;
; OUTPUTS:
;  field (which is loaded into memory) 
;                                
; COMMENTS:
;
; EXAMPLES:
;
; REQUIREMENTS:
; 
; REVISION HISTORY:
;   26-sep-2012 Written by Shirley Ho (CMU)
;-

print, 'begin reading seeing systematics file.'
close,10
openr,10,file
n=0L
imin= 0.0   ; i_fib2_min
imax = 0.0  ; i_fib2_max 
imean = 0.0 ; i_fib2 
A = 0.0     ; A (coef for seeing weighting) 
delta_A = 0.0; error on A ; we are not using them here 
B = 0.0     ; B (coef for seeing weighting)
delta_B = 0.0; error on B ; we are not using them here 
C = 0.0     ; C (coef for seeing weighting)
delta_C = 0.0; error on C ; we are not using them here 


hdr = strarr(1)
readf,10,hdr
print,'read this header',hdr
while not(eof(10)) do begin
    readf,10,A, delta_A, B, delta_B, C, delta_C
    n=n+1L
endwhile

close,10
openr,10,file
print,'n is ',n
tag_size=n
field=fltarr(tag_size,6)
tmp = fltarr(6,tag_size)
;; read off the header
readf,10,hdr
readf,10,tmp
field = transpose(tmp)

close,10

print,'done with reading the seeing systematics file'

end
