;+ ; ; PROJECT: ; RHESSI ; ; NAME: ; soxs_readfile ; ; PURPOSE: Read SOXS data file ; PREVIOUSLY (before 8-nov-2006): ; Read a single .out soxs file and return data and time array ; The soxs files are text files containing a bunch of rows that look like: ; record counter, hour, min, sec, msec, 256 energy channels ; We're rejected the first two and last two energy bins (Rajmal's instructions) ; We're taking the time to be the start of the accumulation. There are two ; accumulation modes - 3s and .1s, but we found times that are not spaced by ; 3 or .1 s, so we've eliminated those data points. ; AFTER 8-Nov-2006: ; Read the SOXS .les binary file. Code to read this binary file was supplied by PRL. ; Files are named either soxs_dd-mmm-yyyy.les (or sometimes on their web site, just ; dd-mmm-yyyy.les) for the Si detector, and cztsoxs_dd-mmm-yyyy.les for the CZT ; detector. The first time in the file is used as a base time, and ; subsequent times are generated by adding 3 s or 100 msec depending on the mode of the ; data (given by b(3)). As before, reject first 2 and last 2 energy bins. ; The energy bin edges are not contained in the input file. Later we call soxs_drm and ; that returns the energy edges. ; ; CATEGORY: ; SPEX ; ; CALLING SEQUENCE: ; soxs_readfile, file, data, ut_edges, timeshift=timeshift, $ ; err_code=err_code, _extra=_extra ; ; INPUTS: ; FILE - Name of file to read (with path) ; ; Input keywords: ; timeshift - number of seconds to shift data array by ; ; OUTPUTS: ; data - data array (nenergy x ntime) ; ut_edges - time array (2 x ntime) in seconds since 79/1/1 ; ; OUTPUT KEYWORDS: ; detector - string containing 'Si' or 'CZT' for detector ; err_code - 0/1 indicates success / failure ; ; EXAMPLE: ; soxs_readfile, f, data, ut, timeshift=90. ; ; Written: Kim Tolbert, June 2006 ; ; Modification History: ; 21-Aug-2006, Kim. Use break_file instead of file_basename for