|
| Table of Contents > Section A > Section B > Section C > Section D > | |||||||
|
E. Importing experimental ASCII data The ASCII input section of the program is designed to read ASCII files having the general format: x, y1, y2, y3. The input fields in each row must be separated by at least one space, comma, etc. The x data should be sorted according to increasing or decreasing frequency and consecutive x,y pairs should be defined on roughly equally spaced frequency intervals. When this latter condition is not satisfied, there is also a method to import stick spectra having discontinuous x,y pairs (see below). The x,y ASCII data is first linearized in frequency and the ydata is converted to (4-byte float precision) binary format. The procedure makes use of a cubic spline interpolation routine to calculate the best representation of the intensities at even frequency intervals on the output file. It is also designed for patching together sections of spectra covering various spectral regions that are not necessarily contiguous. The undefined data regions are padded with zeros. The procedures for converting these types of files are described in more detail below. 1. Importing an ASCII x,y file. To follow the example given, restart jb95.exe and open the working directory file,1fnMW_Scan1.wkf. From the MAIN WINDOW, select the FILE MENU/ASCII INPUT option. The ASCII DATA INPUT CONVERSION DIALOG will appear. Use the OPEN button to locate the ASCII file, 1fnMW_Scan1.asc. After opening this file, the fields in the INPUT section of this dialog will be filled in. If the file contains a header line or tailer line (none in this example),select valid regions of the file using either the vertical scroll bars or enter the line numbers directly. The number of accepted lines, 14470 in this example, will be indicated. Also note the input resolution (INPUT RES) field represents the average frequency spacing over all ASCII data points. If frequency gaps exist in the ASCII file that are larger than the MAX FREQ STEP (10MHz in this example), these regions will be zeroed. The GAPS ZEROED field indicates the number of such regions found. Likewise, the ASCII data is checked against the MIN FREQSTEP (0.025 MHz in this example) to prevent the cubic spline routine from becoming unstable. In the OUTPUT section of the dialog, click the radio button to the right of Y1 under FILECOLUMN 2. This will associate the intensity data in the second column of the ASCII file with the binary file given in the edit field under the heading BINARY FLNM. Enter a binary filename,1fnMW_Scan1. If the file exists (has non-zero length), the OUTPUT BINARY FREQ RANGE will be set to include both the ranges covered by the ASCII data and the existing binary data. The output resolution (OUTPUT RES) will be automatically set to that of the existing binary data. In this example, the input and output ranges and resolutions will be identical. If the binary file does not exist, the INPUT ASCII FREQ RANGE and the OUTPUT BINARY FREQ RANGE should have the same values. In this case, be sure to enter the desired output resolution. In most cases, simply copy (cntl c) the INPUT RESOLUTION and paste it (cntl v) in the OUTPUT RES edit box. You may also edit the output (final) frequency range to cover a region that is greater than the input range. Entering zero in either field will reset it to the ASCII frequency value. To convert the ASCII file over a smaller output frequency range, change the input frequency range using the scroll bars as described above. Depress the CONVERT button. If the binary file already exists, you will be prompted with a question to add to it or alternatively, to overwrite it. If you want to overwrite a subset of the existing binary file with the new ASCII intensity data, answer YES to ADD TO OUTPUTFILE question (see below). If you want to create a new binary file containing only the ASCII data, answer NO. If you want to abort, select CANCEL. The progress of the conversion is shown in the MAIN WINDOW STATUS BAR. The message ASCII FILE CONVERTED is displayed and the binary file length is updated when the conversion is complete. In this example, since the binary file existed prior to conversion, the file length of 14,470 lines will not change. Select OK to exit the dialog. The new data should be displayed in the MAIN WINDOW. The binary data will be automatically scaled and offset to fill the full vertical dimension. Following linearization, the frequency calibration information (the initial absolute frequency and FSR parameters) given in the ANALYSIS OPTIONS DIALOG are modified. Use the floppy-disk tool-bar option to save this calibration information to a working file having a WKF extension after each conversion. As a final note, if the binary file exists and you wish to overwrite it, modify the output frequency range and resolution after selecting and editing the binary file name field. Otherwise, the range and resolution fields will be automatically set after clicking in the binary filename field. 2. Patching an ASCII x, y file into an existing binary file. Continuing with the example given above, from the MAIN WINDOW, select the FILEMENU/ASCII INPUT option again. Use the OPEN button to locate the ASCII file,1fnMW_Scan2.asc. After opening, 1,532 lines should be accepted. If the radio button for Y1 column 2 is still selected, the output frequency range will automatically be updated to include the frequency range of the new ASCII data. Typically, these preset values should be used when patching files together. Depress CONVERT and answer YES to the ADD TO OUTPUT FILE question. Select OK to exit the dialog to view the new data. In this example, the binary file1fnMW_Scan1 will now have 16,000 lines and cover a range from 12,000 to 20,000 MHz. Always save the new calibration information to a working file after ASCII file conversions. 3. Importing ASCII over a marked region within an existing binary file. It is sometimes convenient to visually mark from within the MAIN WINDOW the upper and lower file positions over which to substitute the ASCII data. Of course, part or all of the input frequency range must lie within this marked interval or nothing will change. To mark a region within the main window, position the cursor and click the tool-bar button M-> to mark the lower position and <-M to mark the upper position. In the ASCII DATA INPUT CONVERSION DIALOG, check the box marked DATA SUBSTITUTION STATUS. Convert the ASCII file as before. Data outside of the marked region will remain unaltered. 4. Importing ASCII stick spectra. The cubic spline routine for interpolating intensities will fail horribly when large discontinuities exist along the x frequency axis. This might be the case when, for instance, the ASCII file is a stick spectrum containing discrete x,y pairs only for points having non-zero intensities. In this case, check the STICK SPECTRUM STATUS box before converting. The cubic spline routine will be bypassed and the program will simply add the intensities into a zeroed array. Be sure to set the output resolution to a reasonable value.
|