Title of Invention: APPARATUS AND METHOD FOR OPTIMIZING DATA CAPTURE AND DATA CORRECTION FOR SPECTROSCOPIC ANALYSIS Abstract: A method and an apparatus for increasing the accuracy of a spectrometer system corrects for light source quality, exposure time, distortion in y direction, distortion in x direction, temperature dependence, pixel alignment variability, dark pixels, bad pixels, pixel read noise, and pixel dark current noise. The method and apparatus produces an algorithm for optimizing spectral data and for measuring a sample within the spectrometer system using the optimization algorithm. The spectrometer apparatus comprises a composite external light source, a source light collector, an illumination light structuring component, a sample, a sample light collector, a spectrometer light structuring component, a light dispersing engine, photo detectors, an electrical signal converter, a data preprocessing unit, and a data analyzer. The method and apparatus can include a corrected photo detector algorithm, sample illumination correction algorithm, LDE-PD alignment procedure, SLSC-LDE alignment procedure, distortion correction matrix, and an algorithm for optimizing of spectral data. Detailed Description: FIELD OF INVENTION The present invention relates to an apparatus and method for optimizing data capture for spectroscopic analysis. BACKGROUND OF THE INVENTION Spectroscopy is a tool for remote, non-destructive, non-invasive, or minimally invasive analysis of elemental content or molecular composition of samples. Spectral content of the electromagnetic radiation (EM radiation) that is emitted by the sample under specific conditions, or produced by external source and modified as a result of interaction with the sample may be analyzed using spectroscopy. Applications of spectroscopy include chemical composition determination, sample identification and differentiation and may be used in applications such as food processing, food sorting, petrochemical analysis; chemical composition identification of ore, minerals, pharmaceutical agents; differentiation between healthy and disease affected tissues; analysis of chemical composition of solids, powders, fluids, gases, and mixtures of states of matter; identification of chemical composition of fume exhausts, gas clouds, plasma clouds or mist clouds, detection of impurities, detection of foreign bodies, detection of biological abnormalities, identification of electromagnetic discharge, sorting of materials for industrial purposes, sorting of materials prior to processing of said materials, identification of materials prior to processing, plant identification in agriculture, environmental testing, identification of dangerous substances, identification of aromatic substances. Over a range of wavelengths from about 175 nm to about 10,000 nm (wavelengths below 175 nm and above 10,000 nm may also be included), optical methods may be used to perform analysis of spectral composition of electromagnetic radiation. This part of the electromagnetic spectrum (from about 175 nm to about 10,000 nm) may be referred to as the optical spectrum, or “light”. Methods used to analyze the spectral composition of EM radiation in an optical spectral range spatially separate different components of the spectra (i.e. spatially dispersive methods) may use dispersive optical components like prisms, periodical light-scattering structures, nanostructures, micro-mirror arrays, MEMS (microelectromechanical system) structures, diffraction gratings, or a combination thereof, as would be known to one of skill in the art. The capability of instruments using dispersive components can be dramatically expanded by using two dimensional detector arrays. Reflecting diffraction gratings, ruled, etched or holographic, or etched, holographic or volume transmission gratings may be used for the dispersion of light. Regardless of the structure of the spectroscopic system using optical diffractive components, the general light propagation path, including conversion of information contained in the spectrum of electromagnetic radiation to an electrical signal, and treatment of this electrical signal, is similar for most if not all instruments. Dispersive spectroscopic systems generally include a source of EM radiation, for example an external light source. Radiation from the EM source is collected using a source light collector (SLC), and the collected light is transformed into a spatial light distribution that is optimal for sample illumination. The spatial light distribution or structured illumination light, is produced using an illumination light structuring component (ILSC) and interacts with a sample to produce light that contains information about the composition of the sample. Following interaction with the sample, the information containing light may then be analyzed spectrally. The information containing light obtained from the sample is collected with sample light collector (SaLC) and delivered to spectrometer light structuring component (SLSC), which produces a spatial light distribution that is optimal for the performance of a light dispersing engine (LDE). The light dispersing engine accepts the light delivered by SLSC, and restructures the spatial intensity light distribution to obtain an efficient detection and separation of different spectral components of the light with photo detectors (PD). The photo detectors convert the optical signal into an electrical digital signal using an electrical signal converter (ESC) while preserving information extracted with spectroscopic system. The electrical digital signal is transferred to a data pre-processing unit (DPPU), where data is prepared for analysis in a data analyzer (DA) so that desired chemical information may be extracted from spectroscopically collected physical data. Sunlight may be used as a natural source of light for many spectrometric systems, especially those which are used to analyze optical properties of the earth or any object on the earth's surface. For many applications; however, the light is produced by some artificial or synthetic means such as incandescent, halogen, metal-halogen, high pressure vapor, high pressure gas, low pressure gas and vapors, light emitting diodes (LEDs), lasers and others as would be known to one of skill in the art, can be used as a single light source or in combination to produce light with required optical characteristics. For example, light from plurality of light sources can be combined to produce light with broadband spectrum to fit requirements of the used spectral analyzer whose technical characteristics might be optimized to extract maximum information from the measured samples. Both spatial and spectral structuring of light is beneficial to optimize information to be obtained during sample analysis. By combining multiple sources comprising different spectral behaviors together, light may be structured spectrally so that it is optimized to match the properties of the sample, the spectroscopic system, or the detector. The spectral and spatial structuring of light from one or plurality of light sources through the illumination light structuring component, may include various optical stigmatic or (and) astigmatic optical components such as lenses and mirrors transforming the collected light into a convergent, divergent or collimated light beams with different characteristics for two orthogonal propagation planes, light guiding rods, pipes and optical fibers, diffusers to scatter light for scattered light spectroscopy, polarizers to select preferred polarization of light, filters to filter out an undesired part of light, neutral density filters to adjust signal level to that acceptable by light measuring component, as well as light combiners such as beam splitters, polarization beam splitters, fiber optic combiners, prisms, dichroic mirrors, diffractive elements and others for enhancement of this light with additional band light produced by suitable light sources (various spectral lamps), or with narrow bands of light produced by LED and lasers (U.S. Pat. No. 6,767,669; to Pawluczyk, which is incorporated herein by reference, shows two light sources being combined, for example). Light produced in such way is used as a tool to extract required spectral information from the tested samples and as a carrier to deliver that information to spectral light analyzer. The light obtained from a single light source or from combined light sources may need to be structured in different ways depending on the application. For example: to focus light delivered by a light source, for example a laser, into a point on the sample as for example with confocal microscopes, Raman confocal microscope, Laser Induced Breakdown Spectroscopy (LIBS); to create a high intensity light distribution along the straight or curved line, or plurality of lines, along the sample, for spectral imaging optical instrument; to create a high intensity light distribution of high intensity point or plurality of points along the sample in a pre-determined manner, for spectral imaging optical instrument; to collimate the light, to illuminate transparent samples in cuvettes with plane, parallel transparent walls; to produce diffused illumination for light scattering samples for diffused light spectroscopy. Other spatial and spectral distributions optimized for the purpose of collecting optimal information from the sample may also be used. For example, in some cases it may be important to know the initial spectral composition of light delivered to the sample from an external source or plurality of sources. This may be achieved by dividing the light delivered to the sample into two light paths from which one path, for example, the more powerful path is used to illuminate the sample, while the second path is directed to separate detector to monitor the variability of light intensity produced by the light source(s). Alternatively, the intensity and spectral content of the used light may be monitored by periodically switching the light path from illumination of samples to directly coupling into the light analyzing unit through the spectrometer light structuring component (SLSC). Upon interaction with a sample, spectrally and spatially structured light is modified as photons are absorbed, reflected, scattered, transmitted, spectrally shifted or deflected by the atoms, molecules and structures in the sample. The sample itself may also become a source of light in this process, since electromagnetic radiation of various wavelength may be emitted by the sample when for example the sample is heated to high temperatures, the sample is evaporated, electrical currents are conducted through the sample, plasma is produced using electrical current (plasma excitation), as well as other mechanisms, including luminescence, fluorescence, electroluminescence, Raman, temperature related emission, vapor or plasma emission, impact fluorescence and other light effects produced by different physical processes. Once light interacts with, or is produced by the sample, this sample-affected light may then be processed with the subsequent parts of the dispersive spectral system. When an Illumination Light Structuring Component (ILSC) is used, there may be a need to collect the sample-affected light and restructure it for the delivery to the light dispersing engine. In this case the sample-affected light is collected with the sample light collector (SaLC) and delivered to the spectrometer light structuring component (SLSC) which produces a distribution of spatial light that is optimal for the light dispersing engine (LDE). This step may require transformation or restructuring of the collected light so that the intensity of light is spatially structured as one, or a plurality of lines projected on straight slit or slits of the LDE. These lines may also comprise a different shape, for example, to compensate for astigmatism produced by the LDE. Restructuring of the collected light can be achieved for example, using fiber optic bundles which have a different spatial distribution of fibers at both ends of fiber optic bundle. For example, at one end, fibers can be tightly compressed into a circle, while at another end those fibers are rearranged into one or a plurality of lines to fit slit of the LDE. Alternatively, various optical components like lenses, light-conducting roads, optical fibers, light attenuators, spectral light-shaping filters, polarizers, and other optical components can be used to modify various optical properties of analyzed light, to achieve a desired performance of the spectroscopic system. Light collected with the SaLC may form a circular spot of a diameter much larger than the width of entrance of slit of the LDE, this light may be transformed by SLSC into the form of a straight line. For example, the transformation of light may involve optical devices such as cylindrical lenses, non-spherical or spherical mirrors, prisms and lenses, or fiber optics which collect light from a circular spot at one end and arrange the light in a line at the end which couples to the LDE. Another example of light restructuring involves splitting the circular spot of light in two half circles placed one over another producing an elongated light source, thereby illuminating an elongate slit (US 2011/0299075, to Jeffrey T. MEADE et al.). Detection of dispersed light produced by the LDE may involve the use of scanning systems, for example monochromators, which extract, step by step, narrow spectral bands of light received from the LDE following sample illumination with narrow light bands. Alternatively, Czerney-Turner or Seya-Namioka spectrometers may be used. These spectrometers use a broad band spectrum of light to illuminate the sample and extract narrow bands of sample affected light for measurement. This approach presents the amplitude of a signal for a single narrow spectral band of light that is collected by a single photo detector (PD) at a given point in time. Multiple measurements for adjacent bands can be collected and processed over time for the entire wavelength range of interest. These systems are inefficient in light collection since resolution dependent, narrow bands are collected for analysis, while other bands are ignored. Therefore efficiency of these instruments deteriorates with resolution, thereby increasing measurement time and increasing the amount of unused light. The unused light contributes to increased background scatter light and further deteriorates the quality of the obtained results. Traditional LDE present spectral information in the form of a one dimensional array of data, which shows the amplitude of signal for a given wavelength, the wavelength shift, or the frequency of light. Another method of generating data using an LDE is to use dispersive optics to spatially separate narrow bands of wavelengths of light and direct these bands to spatially differentiated points, where differentiated detector elements are located. The measurements are then performed with a linear array of photo detectors such as a line-scan camera, a plurality of adjacent photodiodes, an array of adjacent CCD (charge coupled devices), CMOS (complementary metal oxide semiconductor), an array of adjacent photomultipliers, an array of photodiodes, or other detectors as would be known to one of skill. This type of light detection is more efficient than the single photo detector method, yet the final spectral intensity distribution is presented in a one dimensional array. The Light Dispersing Engines described above do not differentiate information collected at different spatial points along the spectrometer entrance. Furthermore, some instruments, such as Seya-Namioka spectrometers compress narrow spectral bands of light emerging from a slit to fall on a single detector without distinguishing the information content coming from different points of that slit. These spectrometers do not present information variability contained in a spatial distribution of spectrally dispersed light. However, the spatial distribution of spectrally dispersed light contains additional information about the sample under observation and the lack of differentiation of spatial distribution diminishes the utility of traditional one dimensional LDEs. Two dimensional detectors are typically used in a manner similar to one dimensional detectors. Binning is used to produce a one dimensional array of information collected from a larger area, thus improving signal strength (“binning mode” where an electronic readout of the 2D detector is compressed to contain information in a one dimensional vector). More complex spectroscopic data collection and spatial differentiation of spectrally dispersed light requires differentiation of both spatially and spectrally distributed light. Such systems include light dispersing systems which use an entrance slit or slits, illuminated by electromagnetic radiation delivered from a plurality of points, containing both spatial and spectral information. These advanced light dispersing systems may be used to analyze spectral information from plurality of points simultaneously and require specialized optical designs, such as aberration corrected optical design for imaging reflective gratings, optics, or the use of aberration corrected imaging lens based optics and transmission gratings (see for example U.S. Pat. No. 7,315,371; U.S. Pat. No. 6,266,140; US2005162646A1). The light exiting currently available light dispersing engines is presented as either a one dimensional array of intensities varying for different points along the light spectrum, or a two dimensional array of intensities where one direction provides location along the light spectrum, and the other direction of the array provides information about the spatial location from which the signal was collected. Usually, these two signals cannot be considered as independent, as presence of geometric distortions shifts the spectral array for different positions along the spectral direction. The signal magnitude of each element or “pixel” of the two dimensional matrix typically corresponds to the number of photons which have been detected on the given element of the photo detector. This data is typically transformed into a digital signal by the electric signal converter which converts the optical signal (photons) into electron current. The electron current is digitized and delivered to a data pre-processing unit (DPPU) for initial processing and data optimization and finally to a data analyzer (DA) and, or display. These photon counts are typically divided into spectral bands, and typically photons of a specific narrow band of light contribute to a pixel. Photons hitting a single pixel may also include photons which have not been sorted, but are scattered or noise photons. At each step of this process, including capturing photons, converting photons into current, and digitization, statistical processes are involved and noise elements are introduced in the analysis. Furthermore, when conversion of photons into electrons occurs, other electromagnetic radiation such as cosmic rays may also influence the conversion, in addition to scattered photons being registered on a pixel. The electronic noise of the photo detector also contributes to the overall noise. Noise of photo detector arrays is typically classified as spatial and time dependent. Furthermore, most electronic detector arrays are significantly impacted by sensor temperature. The equation: SNR = PQ e  t ( P + B )  Q e  t + Dt + N r 2 Describes the noise level of each individual pixel, where: SNR is the Signal to Noise Ratio of the detector, P is the incident photon flux, Qe is the Quantum efficiency of the electronic detector, t is the integration time (in seconds), B is background photon flux due to scatter of the entire optical system, D is the dark current value (electrons/pixel/second), and Nr represents the read noise (electrons rms/pixel), governs the Signal to Noise Ratio or the inherent noise level of the photo detector. Dark current is dependent on temperature, and tends to increase as temperature of the detector increases. Many methods have been developed for reduction of noise in both imaging application and spectroscopic applications. The typical approaches of averaging, binning or taking multiple measurements is flawed, as the noise profile of only the photo detector is taken into account, and the systemic noise sources of spectroscopic system are not all considered. Most methods to process signals and reduce noise are directed to image creation, and are not optimized for spectroscopic analysis. However, many modern spectrometers utilize the photo detector signal to collect spatial and spectral information within a two-dimensional matrix with both dimensions of a matrix corresponding to the coding of spatial geometry, rather than form an image. Methods that increase the information content of the signal, and increase the signal to noise ratio are desired. SUMMARY OF THE INVENTION The present invention relates to an apparatus and method for optimizing data capture and data correction for spectroscopic analysis. It is an object of the invention to provide an improved method for data capture and data correction for spectroscopic analysis. The present invention provides methods allowing for maximum information extraction from spectral instruments that use dispersive components and two dimensional detector arrays. As described herein, there is provided a for increasing accuracy of a spectrometer system comprising, correcting for, one or more of a quality of light source, an exposure time, a distortion in y direction, a distortion in x direction, a temperature dependence, a variability of pixel alignment, dark pixels, bad pixels, pixel read noise, pixel dark current noise, and a combination thereof, in a spectrometer system, to produce an algorithm for optimizing of spectral data, and measuring a sample within the spectrometer system using the algorithm for optimizing spectral data. The increase in accuracy may be determined by comparing a measurement of the sample obtained on the spectrometer system before the method of correcting is carried out, with the measurement of the sample obtained on the spectrometer system after the method of correcting is carried out. Following the step of correcting as defined above, a step of monitoring quality of the light source using one or more sample illumination monitoring channels may be performed to produce a sample illumination correction algorithm, and the sample measured within the spectrometer system using the algorithm for optimizing of spectral data, and the sample illumination correction algorithm. Additionally, in the method as defined above, following the step of correcting, an alignment of a spectrometer light structuring component with the light dispersing engine may be performed to produce an LDE-PD alignment procedure, and the sample is measured within the spectrometer system using the algorithm for optimizing of spectral data, the sample illumination correction algorithm, the LDE-PD alignment procedure, and a combination thereof. The method may also include a step of alignment of a spectrometer light structuring component with the light dispersing engine to produce an SLSC-LDE alignment procedure, and measuring the sample within the spectrometer system after the SLSC-LDE procedure has been followed The method as described above may also include a step of focusing of the light dispersing engine and photo detector, focusing of the spectrometer light structuring component and the light dispersing engine, or both, is performed. In the method as described above the algorithm for optimizing spectral data may be obtained with the photo detector removed from the spectrometer system. Alternatively, a uniform broadband illumination or a monochromatic light source may be used to produce the algorithm for optimizing spectral data, and the algorithm for optimizing spectral data (corrected photo detector algorithm) is obtained with the photo detector installed in the spectrometer system. In the method as described above, the dark pixels and the bad pixels may be identified by illuminating the photo detector with a uniform light for a period of time below saturation level of each pixel in the photo detector, determining the signal output from each pixel, and identifying the pixel as the dark pixel, the bad pixel, or both, if an estimated mean of the signal output of the pixel varies by more than 3 standard deviations from a mean signal output of neighboring pixels, to produce the algorithm for optimizing spectral data (or corrected photo detector algorithm). Furthermore, the pixel dark current noise may be determined by measuring a dark current value at each pixel under dark conditions and a read noise value from each pixel is determined by measuring the average dark noise under different exposure times and constant temperature conditions, to produce the algorithm for optimizing spectral data. The pixel noise resulting from temperature fluctuations may also be determined by varying temperature while maintaining the photo detector under dark conditions, and measuring the dark current value and the read noise value from each pixel to produce the algorithm for optimizing spectral data (corrected photo detector algorithm). Alternatively, the pixel noise may be corrected for the read noise by maintaining the photo detector under constant temperature and constant illumination, while varying an intensity of light, and an exposure time, and measuring the read noise value from each pixel to produce the algorithm for optimizing spectral data. The method as described above may also include determining a spatial variation in pixel intensity and using the spatial variation to produce the algorithm for optimizing spectral data. The method as described above may also include a step of correcting for an effect of one or more electromagnetic fields within the spectrometer system on the read noise, by periodically measuring the read noise during use of the spectrometer system and monitoring for fluctuations in the read noise. Also provided herein is the method as described above, wherein in step of monitoring the quality of the light source, the one or more measurement, monitoring and calibration channel collects: i) a portion of the light from the source and passes this light to the one or more measurement, monitoring and calibration channel; ii) a portion of the light from the illumination light structuring component and passes this light to the one or more monitoring and calibration channel; iii) a portion of the light after its interaction with the sample and the sample light collector, and passes the light to the one or more measurement, monitoring and calibration channel; iv) a portion of the light generated by one or more sources that when combined provide a plurality of narrow spectral bands with very well defined spectral characteristics, or a plurality of broadband bands with very well defined spectral characteristics or a combination thereof to produce combined light, and the combined light is passed onto the one or more measurement, monitoring and calibration channel; v) the light after interaction with a reference sample to produce a reference light and passes the reference light to the one or more measurement, monitoring and calibration channel; vi) a portion of the light generated by a broadband source to produce broad band light, and passes the broad band light to the one or more measurement, monitoring and calibration channel; or vii) a combination thereof. Further an output of the one or more sample illumination monitoring channels described above may be formed into a single line, a single curved line, two or more parallel lines, two or more curved lines, two or more non-parallel lines, a structured spatial distribution, a two dimensional array and directed onto a light dispersing engine, to produce the sample illumination correction algorithm. In the method as described above, the LDE-PD alignment procedure may further include a step of alignment of the light dispersing engine with the photo detector using: i) alignment channels that are selected at geometric center, and near each of the edges of the photo detector to produce the LDE-PD alignment procedure. ii) a horizontal axis of the photo detector that is aligned with a spectral dispersion of the light dispersing engine to produce the LDE-PD alignment procedure iii) the spectrometer light structuring component that is illuminated with light that produces discrete narrow bands of light, and three or more bands of the narrow bands of light are used to monitor and correct an orientation of the spectrometer light structuring component, to produce the LDE-PD alignment procedure, or iv) a combination thereof. In the method as described above, the SLSC-LDE alignment procedure may further comprise a step of alignment of the spectrometer light structuring component with the light dispersing engine using: i) alignment channels are selected at geometric center, and near each of the edges of the photo detector to produce the SLSC-LDE alignment procedure ii) a vertical axis of the photo detector is aligned with a spatial distribution of the light dispersing engine to produce the SLSC-LDE alignment procedure iii) the spectrometer light structuring component is illuminated with light that produces discrete narrow bands of light, and three or more bands of the narrow bands of light are used to monitor and correct an orientation of the spectrometer light structuring component, to produce the SLSC-LDE alignment procedure, or iv) a combination thereof. The step of alignment as described above may be followed by a step of correcting for smile (y axis), keystone (x axis) or both, to a generate distortion correction matrix. Furthermore, in the method described above, in the step of focusing of the light dispersing engine, one or more alignment channels may be illuminated with a light source that produces one or more narrow bands of light, one or more maximum signals of the narrow bands are identified on the photo detector, and the signal is focused by adjusting an optical entrance component of the light dispersing engine, an optical output component of the light dispersing engine, or both. A method of increasing accuracy of a spectrometer system is also provided that comprises, correcting for, quality of light source, exposure time, distortion in y direction, distortion in x direction, temperature dependence, variability of pixel alignment, dark pixels, bad pixels, pixel read noise, pixel dark current noise, and a combination therefore, in a spectrometer system, to produce an algorithm for optimizing of spectral data, and measuring a sample within the spectrometer system using the algorithm for optimizing spectral data. Also described herein is a spectrometer system comprising, a composite external light source in optical communication with, and in optical sequence with, a source light collector, an illumination light structuring component, a sample, a sample light collector, a spectrometer light structuring component, a light dispersing engine, and one or more photo detectors, and electrical signal converter, the electrical signal convertor in communication with a data preprocessing unit, and a data analyzer, the spectrometer system further comprising one or more of corrected photo detector algorithm, a sample illumination correction algorithm, an LDE-PD alignment procedure, a SLSC-LDE alignment procedure a distortion correction matrix, an algorithm for optimizing of spectral data, or a combination thereof. The methods described herein remove variability between spectroscopic systems so that spectrometers using different components, designs and manufacturing can be cross-calibrated and data obtained will be essentially the same if the resolution and spectral bandwidth are the same. As described herein, in order to optimize the data collected in a two dimensional matrix, with each dimension of the matrix corresponding to an independent variable (one spatial, and one spectral), sources of error which contribute to the generation of the matrix or which impact the orthogonality of the two variables, are considered. Furthermore, methodology that monitors any time dependence on errors and that minimizes these errors in data used for final spectroscopic analysis is provided. Reflecting diffraction gratings or holographic transmission gratings may be used for the dispersion of light. Systems with transmission gratings may be used in the invention. However, the improvements described herein may also be used in systems with reflective diffractive gratings or other dispersive components. This summary of the invention does not necessarily describe all features of the invention. BRIEF DESCRIPTION OF THE DRAWINGS These and other features of the invention will become more apparent from the following description in which reference is made to the appended drawings wherein: FIG. 1 shows the general layout of a prior art spectrometer system for the spectral measurement of light. FIG. 2 shows various sources of light used in spectroscopy and for spectroscopic analysis. Functional parts of a sample illuminating track comprise a composite external light source 10, that may include natural external light 12, lasers 14, LEDs 16, incandescent light 18, vapour halogen, high pressure vapour and gas sources, and a combination thereof. Each of these sources may be used as stand-alone light source or in combination with other light sources. A source light collector (SLC) 20, for collection of light from a composite external light source 10 may contain lenses (shown schematically as clear rectangular shapes) to collect light from a single or plurality sources, light combiners, filters (shown schematically as circular hatched filled shapes), attenuators (shown schematically as circular grey filled shapes), and optical components required for functionality and predestination of spectroscopic system. An illumination light structuring component (ILSC) 30. The ILSC may contain optical components such as a source light collector (SLC) and include optical light guiding rods and fiber-optic components (shown schematically as lines and rods). FIG. 3 shows schematic examples of optical paths and typical optical elements that may be used for shaping of light collected from one or more sources 10 or a sample 40 for spectral measurement of light. Several optical paths of light from the composite external light source 10 to the sample 40, and from the sample 40 to the light dispersing engine 70 are shown. The sample light collector 50 and spectrometer light structuring component 60 can be used to project and spatially distribute the light collected from the sample into the entrance of the light dispersing engine 70. Source light collector 20; sample light collector 50; spectrometer light structuring component 60; light dispersing engine 70. FIG. 4 shows a block diagram of components of an example of an optical dispersive spectral engine or light dispersing engine (LDE) and shows an optical entrance component 74, a light dispersing element 76, and an optical output component 78. FIG. 5 shows a schematic of possible spectrometer systems which relate to detection of dispersed light, conversion to an electrical signal and a data analyzing unit; photo detectors 80, electrical signal converter 90, data pre-processing unit 100, and data analyzer 110. FIG. 6 shows a flowchart outlining several steps that may be used for light collection and management, including light path formation, optimization, collection and delivery of the light into the spectral engine (light collection and management path). FIG. 7 shows example of shapes that the spectroscopic light structuring component may take. FIG. 8 shows a flow chart outlining several steps that may be used for photo detector correction. One or more of these steps may be used to obtain an algorithm for optimizing spectral data (corrected photo detector algorithm). FIG. 9 shows a normal distribution and the probability curve (a Gaussian distribution) indicating one sigma, two sigma, three sigma and four sigma standard deviations from the mean and associate cumulative % for each of these standard deviations. FIG. 10 shows a flow chart outlining several steps that may be used to optimize the spectrometer system including photo detector calibration, alignment, focusing and wavelength calibration. FIG. 11 shows a flowchart outlining several steps that may be used to detect and correct for distortion. FIG. 12 shows examples of smile distortion and corrected smile distortion. FIG. 13 shows a flow chart outlining several steps that may be used for spectrometer measurement correction. FIG. 14 shows an example of an array of a non-aligned spectroscopic system and an array of an aligned spectroscopic system. DETAILED DESCRIPTION The following description is of a preferred embodiment. A method for generating, collecting, monitoring and pre-processing electronic data in a two-dimensional matrix which corresponds to spatial and spectral distribution of signal, for the purposes of spectroscopic analysis is provided herein. With reference to FIG. 1, there is shown a typically spectrometer system 200 comprising a source of EM radiation 10, for example but not limited to an external light source. Radiation from the EM source 10 is collected using a source light collector (SLC; 20). The collected light is transformed into a spatial light distribution that is optimal for sample illumination, for example structured illumination light, that is produced using an illumination light structuring component (ILSC; 30). Interaction of the structured illumination light with the sample 40 produces light that contains information about the composition of the sample which is then analyzed spectrally. The light from the sample is collected with sample light collector (SaLC; 50) and delivered to spectrometer light structuring component (SLSC; 60), which produces spatial light distribution optimal for the performance of light dispersing engine (LDE; 70). The light dispersing engine 70 accepts the light delivered by SLSC 60, restructures spatial intensity light distribution to obtain an efficient detection and separation of different spectral components of the light with two dimensional array of photo detectors (PD; 80). The photo detectors 80 converts the optical signal into an electrical digital signal, preserving information extracted with spectroscopic system, using an electrical signal converter (ESC; 90). The electrical digital signal is transferred to a data pre-processing Unit (DPPU; 100), where data is prepared for analysis in a data analyzer (DA; 110), for the extraction of desired chemical information from spectroscopically collected physical data. Multiple factors affect the integrity of a signal which is generated by the ESC 90 and data which is made available for analysis by the DPPU 100. The quality of signal for analysis by the DPPU 100 is a combination of time-dependent time-fluctuations of one or more components, including all of the components, of the spectroscopic system, the optical aberrations and noise produced by the opto-mechanical design of the spectroscopic system, and of electronic noise and artefacts introduced by the mechanical and electronic devices converting photon flux to electronic signal. Additional features of the sample illumination track are shown in FIG. 2. The EM radiation source may comprise a composite external light source (generally shown as 10), and may include a large variety of light sources used in spectroscopy, including natural external light 12 and various human-produced light sources as, lasers 14 LEDs 16, incandescent light 18, halogen, high pressure, gas and vapour, vapour, and a combination thereof. The SLC 20 is used for the efficient collection of light from the composite external light source 10 and can comprise lenses to collect light from a single or plural source, light combiners, filters, attenuators, and other optical parts which are required for proper functionality and predestination of the spectroscopic measurement system. The role of some of those parts can be performed by a free space light path, light conducting rods, light wave guides, single optical fibre, multi-fibre bundles, multi-fibre branched bundles, and so on (shown schematically as solid lines and rods in FIG. 2). The light coming from the light source used to create the composite external light source 10 can be branched using various of optical elements known for those skilled in the art to generate one or more branches (or channels, see below) for each or selected individual light sources, or light produced by the composite external light source 10 for testing and evaluation. For example, evaluation of spectral composition of light delivered by each or selected light source(s) as well as the light coming from the composite external light source 10 for the measurement of stability to use it to provide reference for spectral measurement of the sample. This is described in more detail below. The ILSC 30 may comprises optical parts, including lenses (schematically shown as a grey filled shape in FIG. 2; 32a) and focusing lens to create collimated light beam for: concentration measurement in cuvettes with plane parallel windows; point illumination for confocal microscopy; light line forming component for line imaging or simultaneous Raman excitation for Raman line imaging, as would be known in the art. A diffuser, beam splitter, polarizing component or related component is schematically shown as a clear rectangular shape 32b, and a spectrum shaping filter, attenuator, absorber, narrow band filter, band pass filter, laser line narrowing filter is represented by a hatched filled shape 32c. Components 32d can be interpreted as various lights guiding ways including: free space light path for example air, light conducting rods (rod like shape in FIG. 2), light wave guides, single optical fibre, multiple fibres bundles, multi-fibre branched bundles (shown as solid lines), and so on. Component 32e represents an optical component which is placed directly in front of a sample and comprise one or more lenses, Fresnel lenses, binary components, special light structuring components producing various patterns of light intensity distribution on samples: small spot of focused light, illumination of samples with multiple small spots of focused light, light distributed along straight or curved line which can create any closed figures like circles, squares, hexagonal patterns and so on. Component 32f may represent free space or a window placed in front of a sample 40 which can may or may not function as a light shaping filter, heat rejection filter, attenuator, polarizer, and diffuser and so on. As one of skill in the art would recognize, the function and order of the optical parts used in the set of optical components within the ILSC 30 can be changed depending on the role and specific requirements of final spectrometric system as shown by optical component arrangements 34 and 36. Moreover, one of skill in the art understands that the optical functions of the ILSC 30 can be shared with the SLC 20 and these two components together with the composite external light source 10 determine the final spectral spatial illuminating condition for a sample under the spectroscopic test performed with the use of spectroscopic measurement system 200. FIG. 3 shows several possible optical paths of light from the composite external light source 10 to the sample 40 and from the sample 40 to the LDE 70. Various light paths are also shown in FIG. 6. The SLC 30 and SaLC 50 may comprise various optical components for efficient light collection from the sample that is used to deliver structured light via the SLSC 60 to the LDE 70. The Sample 40 may be any state of matter such as liquid, solid, gas or vapour, plasma; remote objects like stars, galaxies, inter-galactic clouds, planets, or any object on the surface of the planet, including both living and non-living objects. Moreover, it can also be medical, industrial, chemical or other substances, pieces of arts, created by nature or human-produced, or any combination of the above. The SLC 50 may comprise similar components as the SLC 20. These optical components may vary in number, functionality and order. The LDE 70 (FIG. 4) comprises an entrance port 72 that receives light produced by the SLSC 60. An optical entrance component 74 then collects the delivered spectral and spatial structured light and transforms this light to a light distribution optimized for the light dispersing element 76. The light dispersing element 76 angularly changes the propagation direction of each spectral component of the delivered light. The light angularly is redirected according to its wavelength and is captured by an optical output component 78. The optical output component 78 orders the light delivered by the Light Dispersing Element 76. A photo detector 80 (FIG. 5) is used to register the light produced by LDE 70. Any type of PD 80 may be used as would be known by one of skill in the art. The LDE 70 may be designed so that a light of narrow spectral band of light around certain wavelength is captured by a single detector 82 at a certain moment of time. Additional spectral bands, placed close to the first band, may be registered in the same manner, and the collection of measurements obtained may be represented in the form of a graph, presenting intensity of the collected light as a function of wavelength. The PD 80 may also comprise a one dimensional detector 84. In this configuration, the LDE 70 projects a narrow band of light with different central wavelength on the different sensors of the linear array. As a result, simultaneous different parts of spectra may be registered and presented in a similar way as with a single detector 82. The main difference is that single detector collects different spectral components at different moment of time, while the linear array of detectors allows registering different spectral components simultaneously. Application of two dimensional array of detectors 86 allows registration of a two dimensional distribution of light intensity produced by the LDE 70 which transforms the light structured with the SLSC 60 to the light distribution presenting spectral dependence on a spatial position of an analyzed point, and this permits simultaneous measurement of spectral characteristics at different points of the sample 40 at the same time. Each point on the structured light intensity distribution corresponds to a line of detectors assigning each part of the detector to a particular wavelength of the light. As a result two dimensional light distribution containing information related to the position of source points from structured spatial light intensity distribution and spectral data related to the light coming from each point are mapped on the surface of detectors. Since these two components are fully independent, from the mathematical point of view they create two mathematically orthogonal sets; therefore, for mathematical analysis it is beneficial to represent the result in the form of two dimensional array with one dimension representing only spatial position of light source and the second dimension representing only spectral distribution. During exposure to the light, the detectors perform energy conversion of absorbed light photons into electron charge, proportional to the total light absorbed by the detector. The ESC 90, measures the electrical charge produced by PD 80 and the size of the charge is presented in the digital form. This information about the charge is transferred to DPPU 100 for optimization for use by the DA 110. The data analyzer 110 extracts useful chemical information about the tested sample from the data produced by the Spectroscopy Measurement System. Algorithms within the DA 110 are used to process the incoming data obtained from the sample and may be of any type as would be determined by one of skill in the art. As described herein, in order to optimize the data collected in a two dimensional matrix, with each dimension of the matrix corresponding to an independent variable (one spatial, and one spectral), all sources of error which contribute to the generation of the matrix need to be considered. Furthermore, methodology that monitors any time dependence of errors and that minimizes these errors in data used for final spectroscopic analysis needs to be developed. These methods consider the sources of noise, distortions time dependent and fluctuations both in spatial and spectral domain of spectroscopic systems which include sub-components shown in FIG. 1, including the light source 10, the SLC 20, the ILSC 30, the sample 40, the SLC 10, the SaLSC 50, the LDE 70, the PD 80, the ESC 90 and the DPPU 100. Two dimensional photo detector arrays 80 permit spatially distinguishing spectroscopic information obtained from different positions along the entrance of the LDE 70. The ability to spatially distinguish spectroscopic information is used, as described herein, to provide multiple spatially and spectrally distinguished spectral channels for the purposes of monitoring, measuring and calibrating the light coupled into the LDE 70. Channels are formed by collecting light into the SLSC 60 which assigns a spatial position of each channel to a specific position at the entrance of the LDE 70. The use of spectral channels in optimizing spectroscopic data provided for spectroscopic analysis by the DPPU 100 is described below. The light source 10 is a source of signal errors, distortions and time dependent fluctuations in spectroscopic data. In addition to monitoring the light source 10, using standard methods as known in the art as previously described, it may be necessary to monitor the light which is used to illuminate the sample 40. This may be done by forming a separate, sample illumination light monitoring spectral channel. A portion of light used to illuminate the sample 40 is collected and coupled directly to the SLSC 60 at the entrance of the LDE 70 in such a way that a part of the LDE 70 is used to disperse the sample illuminating light without interacting with the sample, and subsequently collected on the corresponding portion of the PD 80. This approach allows for continuous and simultaneous monitoring of light used to illuminate the sample 40 at the same time that light collected from the sample 40 is being collected and processed by the SLSC 60, the LDE 70, the PD 80, the ESC 90, and the DPPU 100. Also contemplated is the use of one or more measurement, monitoring and calibration channels may also be used as follows (see FIG. 3 and FIG. 6 which show various channels the light path may use): 1) A sample illumination monitoring channel (described above). This monitoring channel obtains a portion of the light from the source 10 and passes this light to the SLSC 60 (or the measurement, monitoring and calibration channel); 2) A sample measuring channel which collects light after its interaction with the sample 40 and after collection by the SLC 50 and which passes light to the SLSC 60 (or the measurement, monitoring and calibration channel). 3) A spectral integrity monitoring channel which collects light generated by a source 10 such as a spectral lamp, a combination of several well defined spectrally LEDs, or a combination of several well defined lasers, which when combined provide a plurality of narrow spectral bands with very well defined spectral characteristics, and passes light to the SLSC 60 (or the measurement, monitoring and calibration channel). This channel permits the real time monitoring of thermo-mechanical disturbances to the spectroscopic system which may cause small spatial shifts in wavelength band captured on the photo detector 80 array. 4) A reference sample monitoring channel which collects light after interaction with a reference sample 42 and passes this light to the SLSC 60 (or the measurement, monitoring and calibration channel). This channel permits the real time monitoring of differences between the sample 40 being tested and a reference sample 42. For example, a synthetically created reference sample 42 which has similar properties to one or more samples 40 being tested (e.g. the reference sample may be referred to as “a phantom,”) can be used to detect very small changes in spectral composition of light after its interaction with the sample 40 being tested. 5) A spatial integrity monitoring channel which collects light generated by a broadband source 10. This channel permits the real time monitoring of the spectroscopic system environment as well as local system fluctuations by detecting small changes in signal intensity due to thermal, electronic and mechanical disturbances. This channel collects light generated by a broadband source 10 and passes the light to the SLSC 60 (or the measurement, monitoring and calibration channel), or 6) a combination thereof. A plurality of channels as described above may be used to monitor the performance of the spectroscopic system 200. Any combination of one or
{'application_number': '<application-reference appl-type="utility">\n<document-id>\n<country>US</country>\n<doc-number>13842628</doc-number>\n<date>20130315</date>\n</document-id>\n</application-reference>', 'publication_number': '<publication-reference>\n<document-id>\n<country>US</country>\n<doc-number>20140268136</doc-number>\n<kind>A1</kind>\n<date>20140918</date>\n</document-id>\n</publication-reference>', 'source_file': './application/2014/ipa140918.xml', 'source_data': 'USPTO-Application'}