; START - - - - - - hist_write_template.pro - - - - - ; Include and modify the following code to output data ; to an rdb histogram file ; ; column names hist_struct = {bin: 0.0, count:0.0, err:0.0} hist = REPLICATE(hist_struct, n_elements(data_loc)) ; ; fill the strucuture from desired arrays... hist.bin = data_loc/1000.0 ; mm hist.count = data_norm*norm hist.err = data_perror*norm ; ; create header information ; each line is an element in the string array ; each line should start with a "#" ; optional parameters have the format: ; "# param_name[:][TAB]value_string" ; ; customize for application... your_header=['# created by p1d_anal.pro, '+SYSTIME(),$ '# AXAF XRCF Mg-K PSF/1D scan data', $ '# trw_id: '+p1d(idata(0)).trw_id, $ '# runid: '+run_id_str, $ '# grating: '+grat, $ '# order: '+ord_str, $ '# ap_str: '+ap_str ] ; ; parameters that hist routines might use: hist_header=['# for histogram routines use:', $ '# title: '+ptitle, $ '# bin_axis: Position', $ '# bin_unit: mm' ] header = [your_header, hist_header] ; ; and write it out to desired file hist_file = '/nfs/spectra/d6/p1d/p1d'+run_id_str+'_hist.rdb' rdb_write, hist_file, hist, HEAD = header ; END - - - - - - hist_write_template.pro - - - - -