Contribution functions (CF) files --------------------------------- Folders: 'cf_VAL'+init_model+element - e.g. 'cf_VALCHYD', 'cf_VALEMG', ... init_model=['A','B','C','D','E','F'] element= ['HYD','CA','MG'] Each folder contains 2989 files 'conf'+ID+'.DAT' obtained from scaled models ID = 5-digit string from '00000' to '02988' - e.g. 'conf01478.DAT' The models are scaled in temperature (parameter tp) and column mass (parameter mp). tp=-0.03+k*0.001 k=0-60; 61 values in the range -0.03,...,0,...,0.03 mp= 0.2+j*0.1 j=0-48; 49 values in the range 0.2,...,1,...,5 original initial VAL models correspond to tp=0 (k=30) and mp=1 (j=8) Each initial VAL model is scaled to 49*61=2989 versions. The original initial VAL model is at the position k=30, j=8, i.e., 49*30+8 = 1478 of the range 0--2988. The CF files are ordered in the same way as the models, i.e., they have the same ID number = 49*k+j. ---------------------------------------------------- Retrieval of tp, mp from ID number: k = ID/49 j = ID mod 49 tp = -0.03+k*0.001 = -0.03+(ID/49)*0.001 mp = 0.2+j*0.1 = 0.2+(ID mod 49)*0.1 Retrieval of ID number from tp, mp: k = fix((tp+0.03)*1000) j = fix((mp-0.2)*10) ID = 49*k+j, that is, ID = 49*fix((tp+0.03)*1000)+fix((mp-0.2)*10) ------------------------------------------------------ Some scaled models did not converge and contain NaNs; the corresponding CF files were deleted from the database. ------------------------------------------------------ Each CF file 'conf?????.DAT' contains 2 columns and variable number of rows. Columns: tau, cf ------------------------ tau = optical depth cf = contribution function Number of rows is given by the number of spectral lines calculated for the given element, number of wavelengths for each line, and 102 depths in the model atmosphere (depths[1:102]). ------------------------------------------------------ READCF_ID.PRO PRO readcf_id,line,init_model,id,cf,tau,h,prof,dlamax ; ; Reading contribution functions from the database ; ; INPUTS: ; line - line name (string): ; 'La','Lb','Lc','Ld', 'Ha','Hb','Hc', 'Pa','Pb','Ba' for hydrogen ; 'CaK','CaH', '8498','8542','8662' for calcium II ; 'Mgk','Mgh', '2790.8','2797.9','2798.0' for magnesium II ; init_model (string) in the form 'C' defines the folder name ; id (integer) - ID number of the model in the folder 'Models/VAL_'+init_model ; dlamax - maximum delta lambda [A] for plotting (optional) ; ; OUTPUTS: ; cf - contribution function, 2D FLOAT array [delta_lambda, height] ; tau - optical depth in the line, 2D FLOAT array [delta_lambda, height] ; h - geometrical height in the model [km] ; prof - synthetic profile of the line, DOUBLE(2,*) [delta_lambda, intensity] ; units [A, erg/cm^2/s/sr/Hz], delta_lambda starts at 0 A ; ; CALLING: READ_MODEL_ID.PRO, READ_PROFILE_ID.PRO, CGLOADCT.PRO ; ; EFFECT: Makes a contour plot from max(cf)/1000 to max(cf) in logarithmic scale, ; together with the line profile (red) and tau=1 contour (blue). READCF_TM.PRO PRO readcf_tm,line,init_model,tp,mp,cf,tau,h,prof,dlamax ; ; Reading contribution functions from the database ; ; INPUTS: ; line - line name (string): ; 'La','Lb','Lc','Ld', 'Ha','Hb','Hc', 'Pa','Pb','Ba' for hydrogen ; 'CaK','CaH', '8498','8542','8662' for calcium II ; 'Mgk','Mgh', '2790.8','2797.9','2798.0' for magnesium II ; init_model (string) in the form 'C' defines the folder name ; tp - temperature parameter in the range -0.03 to 0.03 ; mp - column-mass parameter in the range 0.2 to 5 ; dlamax - maximum delta lambda [A] for plotting (optional) The rest is identical with READCF_ID.PRO. ---------------------------------------------------