; There is a program called , which may be used
; to generate a set of XRT observations from a DEM(T) curve.
; (See that program for an explanation of its usage.)
;
; We can use these faux observations to illustrate the usage of
; the solver, since you can compare the "real" original DEM
; against the estimated DEM. Here is a simple tutorial using both
; programs. First, create a simple DEM curve.
; IDL> demt = findgen(26)*0.1 + 5.5 ;; Temps are logarithms.
; IDL> dem = demt * 0
; IDL> dem[15] = 1.3e22
; IDL> print, demt[15]
; 7.00000
; IDL> wdef, 0, 1000
; IDL> plot, demt, dem, psym=10, /ytype, yr=[1e20,1e23]
;
; Now generate the set of observations XRT would see.
; IDL> obs = xrt_dem2obs(demt, dem)
; IDL> help, obs ;; 14 XRT channels
; OBS STRUCT = -> Array[14]
; IDL> help, obs[0], /st
; ** Structure <26648d4>, 3 tags, length=28, data length=28, refs=1:
; CHANNEL_NAME STRING 'Al-mesh'
; OBS FLOAT 8344.32
; OBS_UNITS STRING 'DN s^-1 pix^-1'
;
; Just to be clear, prepare input variables for the solver.
; IDL> obs_val = obs.obs
; IDL> obs_index = obs.channel_name
; IDL> help, obs_index, obs_val
; OBS_INDEX STRING = Array[14]
; OBS_VAL DOUBLE = Array[14]
;
; If you were starting from real data, you would put it
; into the format of OBS_INDEX and OBS_VAL. The header for
; provides more details about this.
;
; Run the solver.
; IDL> xrt_dem_iterative, obs_index, obs_val, logT_out, dem_out
; IDL> help, logT_out, dem_out
; LOGT_OUT FLOAT = Array[26]
; DEM_OUT DOUBLE = Array[26]
;
; Overplot the solution.
; IDL> oplot, logT_out, dem_out, psym=10, linesty=2