FUNCTION pf2eps, data0, $ LOGARITHMIC=logarithmic, $ REVERSE=reverse, $ TO_LOG=to_log, $ FROM_LOG=from_log, $ SILICON=silicon, $ SOLABUFILE=solabufile @compile_opt @solabu_var IF N_ELEMENTS(solabufile) EQ 0 THEN solabufile='' solabu, FILE=solabufile ;make local copy IF N_ELEMENTS(data0) NE 0 THEN data=data0 ndata=N_ELEMENTS(data) IF N_ELEMENTS(silicon) EQ 0 THEN silicon=0 IF N_ELEMENTS(logarithmic) EQ 0 THEN logarithmic=0 IF N_ELEMENTS(to_log) EQ 0 THEN to_log=logarithmic IF N_ELEMENTS(from_log) EQ 0 THEN from_log=logarithmic ion=1 offset=12 IF silicon THEN BEGIN ion=14 offset=6 ENDIF PRINT,' [PF2EPS] WARNING: the following piece of code has not been debugged.' i=(WHERE(data.z EQ ion))[0] IF i NE -1 THEN BEGIN ; should use H or Si from data xX=data[i].abu IF (NOT logarithmic) AND (not from_log) THEN $ xX=ALOG10(xX) ENDIF ELSE BEGIN ; use solar value if not present xX=alog10(sol_el_mol[sol_z2el[ion]]) ENDELSE shift=-offset+xX-ALOG10(sol_el_mol[sol_z2el[data.z]]) IF N_ELEMENTS(reverse) EQ 0 THEN reverse=0 IF reverse EQ 1 THEN shift*=-1 ; in the following the first case can do both, however, the second ; case does not require conversion if linear ; (I could have written it the other way as well, of course, but the ; logarithmic case seems to be the more common one) IF to_log NE from_log THEN BEGIN IF from_log NE 0 THEN data=logy2y(data,/rev) data.abu-=shift IF to_log NE 0 THEN data=logy2y(data) ENDIF ELSE BEGIN IF logarithmic EQ 0 THEN BEGIN data.abu/=10.D0^shift data.sigma/=10.D0^shift ENDIF ELSE BEGIN data.abu-=shift ENDELSE ENDELSE RETURN, data END