This section requires a certain general knowledge of IDL. You should know how to deal with variables and arrays, and how to pass information into and out of functions and procedures.
The procedure read_stxm5.pro is used to read STXM 5 data files on the IDL command line. In most cases, it will be enough to pass the following arguments:
IDL> read_stxm5, filename, sm_par, khz
filename is the name of the file you want to read and can include a full path specification. Set sm_par to a named variable which will contain the sm_par structure with tons of more or less interesting scan parameters (see Sec. 10.4), and khz to a named variable which will contain the image, usually calibrated to photon count rate in kHz (photons per msec).
Sometimes, you might want to extract more information:
IDL> read_stxm5, filename, sm_par, khz, $
fast_dist_um, slow_dist_um, $
ev=ev, $
image_data_khz=image_data_khz, $
image_data_raw=image_data_raw, $
image_data_intraw=image_data_intraw, $
disp_name=disp_name, $
/header_only
Set fast_dist_um and slow_dist_um to named variables which will hold one-dimensional arrays for the fast and slow scan axis with the micron positions of each scan pixel in the coordinates of the microscope. You can set ev to a named variable which will hold the photon energy of the scan, which will be an array of values if one of the scan axes was the monochromator.
Set image_data_khz, image_data_raw and / or image_data_intraw to named variables which will contain the 3-dimensional data array in various flavors as described in Chapter 9.
Set disp_name to a string if you want anything other than the "standard image" image returned into the khz variable. "Standard" means the signal which was displayed when the file was stored (which has the disp_name associated with it which is stored in sm_par.disp_name). See Sec. 9.3 for details.
Set the keyword /header_only if you want to read only the scan header (the sm_par structure), but not the actual scan data.