Methods using X-ray fluorescence have been developed to identify cometary material captured in aerogel during the NASA Stardust mission to Comet 81P/Wild 2. These analytical methods are necessitated by the levels of trace contaminants present in the aerogel. The cometary material disaggregates during deceleration in the aerogel, so fluorescence mapping of the entire track (which can be several millimeters long) is necessary. Distinguishing those pixels which have cometary material and aerogel from those which have only cometary material can be very challenging. We have chosen a “dual threshold” method, with some pixels clearly having only aerogel (plus contaminants) and other pixels clearly having cometary and aerogel material. Between these two threshold levels is a set of pixels which cannot be easily ascribed to one or the other. By leaving these pixels out of the analysis, the estimate of cometary material is improved.