#pragma TextEncoding = "MacRoman" #pragma rtGlobals=3 // Use modern global access method and strict wave access. // Load Remo Data // // The data file contains information about some number of peaks // with a block of measurements for each peak introduces by "Peak 1", "Peak 2", etc. // For each peak, the file contains measurements for four parameters: Area, center, width and shape. // For each parameter, the file contains the value of the parameter, a standard error, a T-value, // an upper confidence limit and a lower confidence limit. // // The LoadRemoData procedure loads this data into a single Igor 3D wave. // The output wave's rows dimension corresponds to peak number (e.g., 1..34). // Its columns dimension corresponds to a parameter as follows: // Column 0: Area // Column 1: Center // Column 2: Width // Column 3: Shape // Its layers dimension corresponds to a measurement as follows: // Layer 0: Value // Layer 1: StdError // Layer 2: TValue // Layer 3: ConfLower // Layer 4: ConfUpper // // To load a file, choose Data->Load Waves->Load Remo Data. // // You can display a single parameter like this: // Display outputData[][%Area][%Value] as "Area value for all peaks" // Display outputData[][%Center][%TValue] as "Center T value for all peaks" // // For background information about dealing with multi-dimension waves, execute these commands: // DisplayHelpTopic "Multidimensional Waves" // DisplayHelpTopic "Editing Multidimensional Waves" // DisplayHelpTopic "Subrange Display" Menu "Load Waves" "Load Remo Data...", LoadRemoData("", "") End Function FindFirstDataLines(pathName, fileName, linesWave) String pathName // Name of an Igor symbolic path or "" String fileName // Name of file or full path to file Wave linesWave // Line numbers returned here Redimension/N=1000 linesWave Variable numDataBlocksFound = 0 Variable refNum Open/R/P=$pathName refNum as fileName String buffer, text Variable lineNumber = 0 // Find "Parameter Statistics" do FReadLine refNum, buffer if (strlen(buffer) == 0) Close refNum return -1 // Error: No more data. endif lineNumber += 1 text = buffer[0,19] if (CmpStr(text,"Parameter Statistics") == 0) break endif while(1) // Find each occurrence of "Peak " do FReadLine refNum, buffer if (strlen(buffer) == 0) Close refNum // HR, 000308. break // Hit end of file endif text = buffer[0,3] if (CmpStr(text, "Peak") == 0) linesWave[numDataBlocksFound] = lineNumber + 2 numDataBlocksFound += 1 endif lineNumber += 1 while(1) Redimension/N=(numDataBlocksFound) linesWave return 0 End // CreateRawDataWave(name, numBlocks) // Creates a 3D wave that will hold the matrix of data for each peak // in a layer of the wave. // The rows dimension represents the parameter: Area, Center, Width, Shape // The columns dimension represents the value: Value, StdError, TValue, ConfLower, ConfUpper // The layers dimension represents the peak number: e.g., 1 through 34 Function/WAVE CreateRawDataWave(name, numBlocks) String name Variable numBlocks Make/O/D/N=(4,5,numBlocks) $name Wave rawData = $name // Set row dimension labels SetDimLabel 0, 0, Area, rawData SetDimLabel 0, 1, Center, rawData SetDimLabel 0, 2, Width, rawData SetDimLabel 0, 3, Shape, rawData // Set columns dimension labels SetDimLabel 1, 0, Value, rawData SetDimLabel 1, 1, StdError, rawData SetDimLabel 1, 2, TValue, rawData SetDimLabel 1, 3, ConfLower, rawData SetDimLabel 1, 4, ConfUpper, rawData return rawData End // CreateOutputDataWave(name, numBlocks) // Creates a 3D wave that will hold the output data. // The rows dimension represents the peak number: e.g., 1 through 34 // The columns dimension represents the parameter: Area, Center, Width, Shape // The layers dimension represents the value: Value, StdError, TValue, ConfLower, ConfUpper Function/WAVE CreateOutputDataWave(name, rawData) String name Wave rawData Variable numRows = DimSize(rawData,2) // Layers become rows Variable numColumns = DimSize(rawData,0) // Rows become columns Variable numLayers = DimSize(rawData,1) // Columns become layers Make/O/D/N=(numRows,numColumns,numLayers) $name Wave outputData = $name // Set row dimension labels and X scaling Variable i for(i=0; i