begin # Begin blocking entire file for automatic inclusion # James A. Worthey, 1999 Dec 8 # This function was made by simplifying down function # GetByOneNm(), which adjusts the available data to fit # the standard domain, LamDomain(). This still gets a # function of wavelength and returns a working domain # LamLoHi, based on the domain given in the file. This is # intended particularly for the chromaticity of the spectrum, # which should be graphed with all available data, and no # spurious zeroes. see ChromDiag.oms . # function GetAsIs(filnam, descrip, LamLoHi, vec) begin TextLines = read(filnam, "int") descrip = read(filnam, "char", TextLines, 80) LamLoHi = read(filnam, "int", 1) NumData = LamLoHi(2) - LamLoHi(1) + 1 vec = zeros(NumData) # based on the domain of the data file SizeNow = 0 dumb = read(filnam, "double") # This little loop and the temporary row vector "temp" # permit this function to read a data file that's all one # column or not: while SizeNow < NumData and not eof(filnam) begin temp = [] temp = read(filnam, "double") dumb = [dumb , temp] SizeNow = coldim(dumb) end # End while SizeNow < NumData if (SizeNow <> NumData or not eof(filnam)) then begin msg = ["In file ", filnam, ", data count", ... " discrepancy."] errordlg(msg) end # end if then close( filnam ) vec = dumb' end # End function GetAsIs() end # End blocking entire file for automatic inclusion