FUNCTION read_iso_fc_grid_data,mfl_model,freq,load_frequency_list=load_frequency_list,nocrt=nocrt,verbose=verbose,path=path
ntheta = 1801L
if ~keyword_set(path) then begin
root_rpws = getenv('ROOT_RPWS')
path = root_rpws+'/bin/'
endif
iso_fc_file = 'iso_fc_grid_'+mfl_model
if keyword_set(nocrt) then iso_fc_file += '_nocrt'
iso_fc_file += '_'+strtrim(string(ntheta),2)+'.bin'
openr,lun,path+iso_fc_file,/swap_if_big_endian,/get_lun
nn0 = 0l
nf = 0l
readu,lun,nn0
if nn0 ne ntheta then message,'-- Inconsistent data lenght detected, please check input file...'
readu,lun,nf
ff_iso_fc = fltarr(nf)
readu,lun,ff_iso_fc
point_lun,-lun,ptr_pos
if keyword_set(load_frequency_list) then begin
return,ff_iso_fc
endif else begin
w_iso_fc = where(ff_iso_fc eq freq,cnt)
if cnt eq 0 then begin
message,/info,"Some input frequencies cannot be processed."
message,/info,"Frequency should be either one of the HFR frequencies or a multiple of 5kHz."
message,"Aborting!"
endif
point_lun,lun,long64(w_iso_fc(0))*52LL*long64(ntheta)+long64(ptr_pos)
iso_fc_data = {iso_fc_grid_1801}
readu,lun,iso_fc_data
close,lun
free_lun,lun
return,iso_fc_data
endelse
end