It is very desirable to make use of information from all the available diagnostics in order to provide at least a simple context within which to infer the range of electron temperatures and densities that are found within a given nebula. The remaining tasks make use of the TABLES external package in order to provide a simple and powerful data structure and ancillary tools for access to the observed data and the derived results. The input tables may contain line fluxes for many nebulae and/or many regions within nebulae, one object/region per row. The flux(es) for a given emission line (usually, but not necessarily, given relative to H) are placed in separate columns. The tasks locate particular emission line fluxes or ratios of line fluxes via names of specific columns in the input table. These columns have suggestive default names, but are entirely user-definable: see Table 7: A and B .
Since it is very unlikely to find a complete set of diagnostic line ratios for any given object (owing to limited signal-to-noise ratio, finite spectral resolution, wavelength coverage, etc., of the observed spectra) the nebular tasks make maximum use of whatever information is available, and derive missing information whenever possible. For example, one ordinarily obtains from [O III] by forming the ratio of . However, one can still derive if one has and either or , since the intensity ratio of the latter two lines (which come from the same upper level) is set by the ratio of the transition probabilities. If is missing altogether, then and/or can still be used to calculate the O abundance. Indeed, a significant portion of the nebular source code is devoted to this sort of exception handling.
Given an appropriate data structure, it remains to define what information should be stored, particularly when the data may come from a variety of observations of varying quality. For example, there are dozens of published spectra of the planetary nebula NGC 7027, but only some of them resolve the [O II] 3726+3729 Å doublet. Either line, or their sum, can be used to derive the O abundance (see § 3.3 ), but if both line fluxes are known individually, their ratio can be used as a diagnostic for N (see § 2.2 ). Rather than store the fluxes of the individual lines, it makes more sense to store the sum of the fluxes in the line pair, and separately the ratio of the doublet. Nearly all density-sensitive doublets can be stored both as a sum (), and as a ratio () for analysis with nebular.
The diagnostic line ratios are derived from the input line fluxes, and may optionally be corrected for interstellar reddening. The reddening corrected line flux is derived from the input line flux by:
where is the extinction constant (i.e. the logarithmic extinction at H, 4861.3 Å). The extinction function is taken from one of a few possible extinction functions. The choices for Galactic extinction are: Savage and Mathis (1979), Cardelli, Clayton, and Mathis (1989), and the function of Kaler (1976) which is based on Whitford (1958). The choices for extra-Galactic extinction laws are Howarth (1983) for the LMC, and Prevot et al. (1984) for the SMC.
The simplest task that makes use of multiple diagnostics from many ions at once is called ntplot. This task produces curves on a - plot that are consistent with each of the available diagnostics that can be derived from the input table of fluxes. An example of the output for the planetary nebula NGC 7027 is shown in Figure 3 , where each line style denotes ions of roughly similar ionization potential. This task can optionally produce a table containing each curve in a separately named column, along with the reference T and N, for more elaborate plotting with a presentation graphics application, such as the igi task in the TABLES package.