A Guide to SEGUE Bitmasks
SEGUE uses bitmasks to report what category a target is from. These patterns represent different types of stars and calibration targets. The bitmask algorithms page describes bitmasks in general, focusing on the quality of a particular observation. Here we detail how to use bitmasks to extract particular types of stars from the SEGUE sample.
Every target in SEGUE 1 and 2 is given a spectroscopic fiber because it fulfills the selection criteria for a particular category. However, stars frequently pass the criteria for multiple categories. This information is contained in various bitmasks, which vary in what information they provide from table to table. Yes, it's confusing. Stick with us, and we'll clarify!
For SEGUE, there are 4 32-bit bitmasks: segue1_target1, segue2_target1, segue1_target2, and segue2_target2. The first two provide information about which target criteria the star fulfills. The last two identify calibration or other non-science targets.
The parameters with the prefix segue1 are different than those labeled segue2. The two surveys focused on different types of targets. Thus, the parameters in segue1 present information for each target with respect to SEGUE-1 target selection. Those with segue2 use bitmasks for the SEGUE-2 target selection. This applies to both the stellar type target selection (target1) and the calibration identification (target2). We list the different bitmasks for the 4 parameters on the SEGUE Target Selection page.
Three CAS tables contain these four parameters: specObjAll, sppParams, and segueTargetAll. There is some variation to what the values mean between the tables. For SEGUE-1 targets, specObjAll and sppParams, which list identical values for these target flags for each spectrum, report why a spectroscopic fiber was assigned to that particular target. For example, if it was observed spectroscopically as part of the sample of G dwarfs, it will be labeled in segue1_target1 as a G dwarf. These bitmasks thus reflect the photometric and proper motion information for SEGUE-1 targets when they were first assigned fibers. This data used for target selection came from a variety of different sources (see Yanny et al. 2009).
segue2_target1 in specObjAll and sppParams is slightly different. Whereas in SEGUE-1, this parameter included information about why a star was assigned a fiber, for SEGUE-2, segue2_target1 represents the different target categories each star fulfilled when fibers were assigned. Thus, for SEGUE-2, it represents the target bitmasks for each star from DR7, and does not indicate under which category it received a spectroscopic fiber.
In contrast, in segueTargetAll, the bitmask segue1_target1 indicates every single SEGUE-1 or SEGUE-2 target type for which the star meets the criteria in DR9 photometry and astrometry. For these targets, the bitmasks are set for both stellar categories. For instance, a low metallicity G dwarf will have the bits set for both the G dwarf and low metallicity categories. The segue1_target1 bitmask for a star that meets the criteria of multiple categories is a combination of the different bits:
- binary: 10000000000001010000000000000000
- hex: 0x80050000 = 0x80040000 + 0x00010000
- integer: -2147155968 = (-2147483648 + 262144 + 65536)
From the provided example, one can see that for targets that fulfill criteria for multiple categories, it can be much easier to think in terms of hex, rather than binary or integer!
Similarly, for a target that fulfills the criteria for both a low metallicity star and a main sequence turnoff star, segue2_target1 in segueTargetAll will be a combination of the two bitmasks:
- binary: 10000000000000000000000000010001
- hex: 0x80000011 = 0x80000010 + 0x00000001
- integer: -2147483631 = (-2147483648 + 16 + 1)
In summary, for SEGUE-1 and SEGUE-2, segue1/2_target1 in specObjAll and sppParams represents the criteria a target fulfills when fiber assignment occurred. In SEGUE-1, this parameter records why each target was observed spectroscopically. The bitmask for SEGUE-2 is more general. The targets for SEGUE were always selected from DR7 reductions or previous, so the target flags reflect the results of those reductions. The bitmasks in segueTargetAll reflect the different stellar categories each star belongs to in DR9 photometry and astrometry.
If you want every star assigned a fiber for a specific type in SEGUE-1, you would use segue1_target1 from specObjAll or sppParams. If you want every star that meets the criteria of a specific type in SEGUE-1, you should use segue1_target1 from segueTargetAll.
If you want to see which targeting criteria a particular SEGUE-2 star met in DR7, use segue2_target1 in sppParams or specObjAll. To see what criteria it fulfills using updated DR9 photometry and astrometry, use segueTargetall.segue2_target1. As explained on the SEGUE Target Selection, this helps us investigate how the samples for each category have changed as SDSS has refined and recalibrated its data.
Finally, targets that belong in multiple categories require some adjustment of SQL queries. In a query, specifying
segue1_target1 = 0x80040000
is quite different than
(segue1_target1 & 0x40000) != 0
In the first example, the query specifies that the bitmask must be that of a G dwarf, and only a G dwarf. The second query specifies that the bit mask must be that of a G dwarf, but can also fulfill the criteria of other target categories. The first query would not have any targets with segue1_target1 = -2147155968, but the second would.