GDL> ; power is the component structure describing the power-low component GDL> power = {name:'power', $ GDL> descr:'Power-law component -- demonstration', $ GDL> init_fun:'', $ GDL> init_data:ptr_new(), $ GDL> eval_fun:'tuto_power', $ GDL> eval_data:ptr_new(/ALLO), $ ; will be filled by ULY_FIT_INIT GDL> para:ptr_new(/ALLO), $ GDL> start:0d, $ ; this will be filled by ULY_FIT_INIT GDL> step:0d, $ ; this will be filled by ULY_FIT_INIT GDL> npix: 0l, $ ; this will be filled by ULY_FIT_INIT GDL> sampling:-1s, $ ; this will be filled by ULY_FIT_INIT GDL> mask:ptr_new(), $ GDL> weight:0d, $ GDL> e_weight:0d, $ GDL> l_weight:0d, $ GDL> lim_weig:[!VALUES.D_NaN,!VALUES.D_NaN] $ GDL> } GDL> GDL> ; We have also to define the para structure, describing the parameter tau: GDL> *power.para = {name:'tau', unit:'', guess:ptr_new(0D), step:1D-2, $ GDL> limits:[-10d,10d], limited:[1,1], fixed:0S, $ GDL> value:0D, error:0D, dispf:''} GDL> GDL> ; Since init_func is empty, ULY_FIT_INIT will fill the WCS information GDL> ; with the values corresponding to the spectrum to fit, and will GDL> ; pass the cmp structure as eval_data.
function tuto_power, eval_data, pars ; pars is the array of parameters, actually only one value: the exponent step = eval_data.step npix = eval_data.npix ; simply return the array: return, exp(findgen(npix)*step*pars[0]) end
GDL> ; Choose a galaxy spectrum to test this model, and try the fit GDL> galaxy = uly_root+'/data/VazMiles_z-0.40t07.94.fits' GDL> ulyss, galaxy, power, KMOMENT=0, MD=0, /PLOT
-------------------------------------------------------------------- INPUT PARAMETERS -------------------------------------------------------------------- The fits file to be analyze is ./data/VazMiles_z-0.40t07.94.fits Name of the output file output.res Degree of multiplicative polynomial 0 No additive polynomial Component1 (power) Power-law component -- demonstration Guess for tau: 0.0000000 [] -------------------------------------------------------------------- SDSS style Assume that the sampling is linear in wavelength The error spectrum does not contain finite values ... ignore it (ie. do as if no errors were given) -------------------------------------------------------------------- PARAMETERS PASSED TO ULY_FIT -------------------------------------------------------------------- Wavelength range used : 3540.3541 7410.6865 [Angstrom] Sampling in log wavelength : 51.501300 [km/s] Number of independent pixels in signal: 4300 Number of pixels fitted : 4300 DOF factor : 1.00000 -------------------------------------------------------------------- number of model evaluations: 16 time= 1.6582990 Number of pixels used for the fit 4296 ---------------------------- chi^2 : 328.40524 ---------------------------- Weight : 193.29153 +/- 0.029005502 [data_unit/cmp_unit] tau : 0.80979726 +/- 0.00072975146 ----------------------------

GDL> g = uly_spect_read(uly_root+'/data/VazMiles_z-0.40t07.94.fits') GDL> g = uly_spect_logrebin(g, /OVERWRITE) GDL> tau = -3d GDL> p = exp(findgen(n_elements(*g.data))*g.step*tau) GDL> *g.data += 0.5 * mean(*g.data)/mean(p) * p GDL> GDL> window, 0 GDL> uly_spect_plot, galaxy, LINECOLOR='Black' GDL> uly_spect_plot, g, /OVERPLOT GDL> GDL> window, 1 GDL> cmp = [power, uly_ssp(MODEL_FILE=uly_root+'/models/Vaz_Miles.fits')] GDL> ulyss, g, cmp, KMOMENT=0, MD=0, /PLOT
SDSS style Assume that the sampling is linear in wavelength The error spectrum does not contain finite values ... ignore it (ie. do as if no errors were given) -------------------------------------------------------------------- INPUT PARAMETERS -------------------------------------------------------------------- Name of the output file output.res Degree of multiplicative polynomial 0 No additive polynomial Component1 (power) Power-law component -- demonstration Guess for tau: 0.0000000 [] Component2 (cmp1) model:./models/Vaz_Miles.fits Guess for age: 8000.0000 [Myr], Fe/H: -0.40000000 [dex] -------------------------------------------------------------------- Read the model ./models/Vaz_Miles.fits read the file ./models/Vaz_Miles.fits model reading time= 0.66786098 model deriving time= 0.20855904 -------------------------------------------------------------------- PARAMETERS PASSED TO ULY_FIT -------------------------------------------------------------------- Wavelength range used : 3540.3541 7410.6865 [Angstrom] Sampling in log wavelength : 51.501300 [km/s] Number of independent pixels in signal: 4300 Number of pixels fitted : 4300 DOF factor : 1.00000 -------------------------------------------------------------------- number of model evaluations: 66 time= 1.2193091 Number of pixels used for the fit 4296 ---------------------------- chi^2 : 1.2476216e-22 ---------------------------- Light fraction : 33.333333 +/- 0.018466303 % Weight : 328.21149 +/- 0.18182558 [data_unit/cmp_unit] tau : -3.0000000 +/- 0.017293929 ---------------------------- Light fraction : 66.666667 +/- 0.020968968 % Weight : 1.00000000 +/- 0.00031453452 [data_unit/cmp_unit] age : 7940.0005 +/- 80.762597 Myr Fe/H : -0.40000001 +/- 0.0054215726 dex ----------------------------


| Contact: ulyss at obs.univ-lyon1.fr |
Last modified: Thu Jul 31 13:57:09 2008. |