Read an archive host's colour off the dwarf sequence at its temperature, and say it was not measured
For an archive-placed host with a temperature and no B magnitude, fetchExoplanets took B−V from Ballesteros' blackbody fit, which runs 0.1 to 0.2 redder than Pecaut & Mamajek's dwarf sequence below 3 800 K, and the luminosity then read its correction off that sequence at that colour: 3 500 K came back as 3 102 K with a correction 1.15 magnitudes too large, anything under about 3 170 K was clamped to B−V 2.00, and the card printed it as a measured "Colour B−V 2.00". CFBDSIR J145829+101343, a 580 K brown dwarf, read "Spectral type ~M6, from colour". temperatureToColorIndex now reads the table itself backwards, interpolating B−V between the two types the temperature falls between, so the temperature and correction read back off the colour are the table's at that temperature; it has no answer outside 2 420 to 31 400 K. The colour is flagged colorFromTemperature, a fifth bit in the photometry byte (the format, README and the ETL's round-trip check follow), and the card prints it "B−V 1.66, from its temperature", marked derived. From cache: 57 archive stars change colour; 54 carry the flag and 3, CFBDSIR J145829+101343 among them, now have none. For the 47 of them the archive gives a luminosity, the one derived from magnitude and colour moves from a median 0.228 dex off it to 0.124; Kepler-445 (3 157 K) from 0.0282 L☉ to 0.0080 against the archive's 0.0079. Its colour goes from 2.00 to 1.67. The card shows the archive's luminosity where it has one since earlier on this branch, so this is the figure used for the rest and for their radii. Controls, each failing its named test: the nearest hotter row taken without interpolating (2 of 803 failed), no refusal outside the table, the flag not encoded, and the card calling the colour measured (1 of 803 each). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -105,15 +105,18 @@ describe('the photometry and distance error columns', () => {
|
||||
{ id: 3, name: 'HD 3', x: 0, y: 0, z: 300, magnitude: 7, magnitudeBand: 'V', spectralType: 'K0', colorIndex: 1.0, colorSystem: 'B-V', distanceError: 0.000001, distanceFromGaia: true, source: 'hyg' },
|
||||
{ id: 4, name: 'Gaia DR3 4', x: 5, y: 5, z: 0, magnitude: 12, spectralType: 'Unknown', colorIndex: null, distanceFromGaia: true, source: 'gaia' },
|
||||
// A Hipparcos parallax smaller than its own error.
|
||||
{ id: 5, name: 'HIP 5', x: 0, y: 200, z: 0, magnitude: 6, magnitudeBand: 'V', spectralType: 'B8', colorIndex: -0.1, colorSystem: 'B-V', distanceError: 1.4, source: 'hyg' }
|
||||
{ id: 5, name: 'HIP 5', x: 0, y: 200, z: 0, magnitude: 6, magnitudeBand: 'V', spectralType: 'B8', colorIndex: -0.1, colorSystem: 'B-V', distanceError: 1.4, source: 'hyg' },
|
||||
// An archive host whose B−V is its temperature's.
|
||||
{ id: 6, name: 'Kepler-445', x: 0, y: 0, z: 90, magnitude: 17.6, magnitudeBand: 'G', spectralType: 'M4', colorIndex: 1.66, colorSystem: 'B-V', colorFromTemperature: true, source: 'exoplanet-archive' }
|
||||
];
|
||||
const encoded = encodeStarCatalog(MEASURED);
|
||||
const decoded = decodeStarCatalog(encoded.index, encoded.positions, encoded.meta);
|
||||
|
||||
it('carries the band, which colour the colour index is, and whose parallax the distance is', () => {
|
||||
expect(decoded.map((star) => star.magnitudeBand)).toEqual(['V', 'G', 'V', undefined, 'V']);
|
||||
expect(decoded.map((star) => star.colorSystem)).toEqual(['B-V', 'BP-RP', 'B-V', undefined, 'B-V']);
|
||||
expect(decoded.map((star) => star.distanceFromGaia)).toEqual([false, true, true, true, false]);
|
||||
expect(decoded.map((star) => star.magnitudeBand)).toEqual(['V', 'G', 'V', undefined, 'V', 'G']);
|
||||
expect(decoded.map((star) => star.colorSystem)).toEqual(['B-V', 'BP-RP', 'B-V', undefined, 'B-V', 'B-V']);
|
||||
expect(decoded.map((star) => star.distanceFromGaia)).toEqual([false, true, true, true, false, false]);
|
||||
expect(decoded.map((star) => star.colorFromTemperature)).toEqual([false, false, false, false, false, true]);
|
||||
});
|
||||
|
||||
it('keeps a distance error to within a step at both ends of its range, and none as none', () => {
|
||||
|
||||
@@ -44,10 +44,10 @@ export const BYTES_PER_STAR_META =
|
||||
* Bits of the photometry column. The band takes two: none (a stand-in magnitude), V or G. None
|
||||
* of it follows from the source, which records where the *position* came from: 62 002 stars
|
||||
* Gaia places keep HYG's V and B−V, and the archive's stars in G have a B−V from their
|
||||
* temperature. The last bit says whose parallax the distance is, which for a HYG star Gaia did
|
||||
* not place can still be Gaia's.
|
||||
* temperature. The next bit says whose parallax the distance is, which for a HYG star Gaia did
|
||||
* not place can still be Gaia's, and the last whether the colour was read off a temperature.
|
||||
*/
|
||||
const PHOTOMETRY = { bandV: 1, bandG: 2, bandMask: 3, colorBpRp: 4, distanceFromGaia: 8 } as const;
|
||||
const PHOTOMETRY = { bandV: 1, bandG: 2, bandMask: 3, colorBpRp: 4, distanceFromGaia: 8, colorFromTemperature: 16 } as const;
|
||||
|
||||
/**
|
||||
* The distance error column holds the square root of the relative error, in 255ths, and 0 where
|
||||
@@ -186,7 +186,8 @@ export function encodeStarCatalog(stars: readonly StarRecord[]): {
|
||||
columns.photometry[index] =
|
||||
(star.magnitudeBand === 'V' ? PHOTOMETRY.bandV : star.magnitudeBand === 'G' ? PHOTOMETRY.bandG : 0) |
|
||||
(star.colorSystem === 'BP-RP' ? PHOTOMETRY.colorBpRp : 0) |
|
||||
(star.distanceFromGaia ? PHOTOMETRY.distanceFromGaia : 0);
|
||||
(star.distanceFromGaia ? PHOTOMETRY.distanceFromGaia : 0) |
|
||||
(star.colorFromTemperature ? PHOTOMETRY.colorFromTemperature : 0);
|
||||
// At least one step, so an error too small to round to one is not read back as none published.
|
||||
columns.distanceErrors[index] =
|
||||
star.distanceError === undefined ? 0 : Math.max(1, Math.round(Math.sqrt(Math.min(1, star.distanceError)) * DISTANCE_ERROR_STEPS));
|
||||
@@ -242,6 +243,7 @@ export function decodeStarCatalog(index: StarCatalogIndex, positions: Float32Arr
|
||||
colorSystem: Number.isNaN(colorIndex) ? undefined : photometry & PHOTOMETRY.colorBpRp ? 'BP-RP' : 'B-V',
|
||||
distanceError: distanceError === 0 ? undefined : (distanceError / DISTANCE_ERROR_STEPS) ** 2,
|
||||
distanceFromGaia: (photometry & PHOTOMETRY.distanceFromGaia) !== 0,
|
||||
colorFromTemperature: (photometry & PHOTOMETRY.colorFromTemperature) !== 0,
|
||||
...(source ? { source: source.id } : {})
|
||||
};
|
||||
}
|
||||
|
||||
@@ -33,6 +33,11 @@ export interface StarRecord {
|
||||
* Mamajek). Absent with it.
|
||||
*/
|
||||
colorSystem?: 'B-V' | 'BP-RP';
|
||||
/**
|
||||
* Whether `colorIndex` was read off the dwarf sequence at the star's effective temperature rather
|
||||
* than measured: the 57 archive-placed hosts with a temperature and no B magnitude.
|
||||
*/
|
||||
colorFromTemperature?: boolean;
|
||||
/**
|
||||
* Relative uncertainty of the distance, σd/d: the relative error of the parallax it was
|
||||
* inverted from, which to first order is the same — or, for a star the Exoplanet Archive places,
|
||||
|
||||
Reference in New Issue
Block a user