;+ ; Contains the read_iso_fc_grid_data function ; ; :Author: ; Baptiste Cecconi ; ; :History: ; 2009/06/14: Created ; ; 2009/06/14: Last Edit ;- ; ;+ ; read_iso_fc_grid_data is a function that <behavior desc here> ; ; :Returns: ; <return desc here> ; ; :Params: ; mfl_model: in, required, type=sometype ; A parameter named mfl_model ; freq: in, required, type=sometype ; A parameter named freq ; ; :Keywords: ; load_frequency_list: in, optional, type=sometype ; A keyword named load_frequency_list ; nocrt: in, optional, type=sometype ; A keyword named nocrt ; verbose: in, optional, type=sometype ; A keyword named verbose ; path: in, optional, type=sometype ; A keyword named path ;- 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 ; reading data size nn0 = 0l nf = 0l readu,lun,nn0 ; should be equal to ntheta, testing: 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