gaiaspec.standard¶
Build standard-star catalogs from the Gaia archive.
gaiaspec.standard ¶
Build standard-star catalogs from the Gaia archive.
Query the Gaia DR3 archive (via astroquery) for candidate standard stars —
around given sky positions or from an explicit source-id list — download their
XP spectra, cross-match spectral types with Simbad, apply Gaia quality-flag
selections and write the resulting source / spectra tables to parquet. These are
the offline tables later consumed by :mod:gaiaspec.getGaia.
login ¶
login()
Log in to the Gaia TAP+ archive (interactive credentials).
Source code in gaiaspec/standard.py
18 19 20 | |
get_spType ¶
get_spType(llist)
Function to get star spectral type from Simmbad
Parameters¶
llist : list(str) List of star ids.
Returns¶
res : pandas df two cols: (target,spectral type).
Source code in gaiaspec/standard.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | |
get_type_gaia ¶
get_type_gaia(sourceidlist, Gaia_object, user='cravoux')
Fetch Gaia astrophysical-parameter temperatures for a list of sources.
Uploads the source ids as a user table, joins against
gaiadr3.astrophysical_parameters and returns the effective-temperature
and spectral-type columns.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sourceidlist
|
iterable[int]
|
Gaia DR3 source ids. |
required |
Gaia_object
|
A logged-in |
required | |
user
|
str
|
Gaia archive user name (for the uploaded table). |
'cravoux'
|
Returns:
| Type | Description |
|---|---|
|
pandas.DataFrame: The selected temperature / spectral-type columns. |
Source code in gaiaspec/standard.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | |
get_ddf ¶
get_ddf()
To get DDFs (name and position)
Returns¶
df : TYPE DESCRIPTION.
Source code in gaiaspec/standard.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | |
chunks_data_split ¶
chunks_data_split(lst, n)
Yield successive length-n chunks of a sequence.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lst
|
Sequence
|
Sequence to split. |
required |
n
|
int
|
Maximum chunk size. |
required |
Yields:
| Name | Type | Description |
|---|---|---|
Sequence |
Successive slices of |
Source code in gaiaspec/standard.py
134 135 136 137 138 139 140 141 142 143 144 145 | |
create_standard_catalog ¶
create_standard_catalog(query=None, source_id_list=None, dl_threshold=5000)
Query Gaia sources and download their XP spectra in chunks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
ADQL query selecting the sources. Combined with
|
None
|
source_id_list
|
iterable[int]
|
Explicit source ids. |
None
|
dl_threshold
|
int
|
Maximum number of ids per download chunk. |
5000
|
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If neither |
Source code in gaiaspec/standard.py
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | |
create_standard_catalog_around_fields ¶
create_standard_catalog_around_fields(ra_centers, dec_centers, delta_ra, delta_dec, mag_max, name, star_type_selection=None)
Build a standard catalog from Gaia sources around several sky fields.
For each field centre, queries non-variable, well-behaved Gaia sources with
XP spectra inside a RA/Dec box brighter than mag_max, optionally filters
by Simbad spectral type, downloads the spectra and writes the source /
spectra parquet tables.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ra_centers
|
Sequence[float]
|
Field-centre right ascensions (deg). |
required |
dec_centers
|
Sequence[float]
|
Field-centre declinations (deg). |
required |
delta_ra
|
float
|
Half-width of the RA box (deg). |
required |
delta_dec
|
float
|
Half-width of the Dec box (deg). |
required |
mag_max
|
float
|
Faint G-magnitude limit. |
required |
name
|
str
|
Output base name ( |
required |
star_type_selection
|
Sequence[str]
|
Spectral-type first
letters to keep (e.g. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
|
Source code in gaiaspec/standard.py
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 | |
catalog_selection ¶
catalog_selection(df, sel_variable_flag=None, sel_ruwe=False, sel_c_star=None, sel_proc_mode=None, sel_n_transit=None, sel_percentage_blended_transit=None, sel_percentage_contaminated_transit=None, drop_used_flag_columns=True)
select photometric catalog according to Gaia Flags inputs
df : pandas dataframe containg the photometric catalog the files are in /sps/ztf/data/calibrator/gaiaspectra/Photometry/
sel_variable_flag: string (CONSTANT or VARIABLE) --- select the catalog according to variability flag of Gaia (NB in gaia the flags CONSTANT or VARIABLE, NOT AVAILABLE, the function assume the NOT AVAILABLE objects are constant)
sel_ruwe: bool ---- selection according to ruwe flag (ruwe<1.4) clean a sample from cases showing photocentric motions due to unresolved objects (see Riello et al 2021, Montegriffo et al 2022)
sel_c_star: float --- selection according to color_execess_factor C defined in Riello et al 2021, select star with C< sel_c_star * sigmaC (sigmaC std of C* distribution)
sel_proc_mod: int (0,1,2) --- select sample according to photometry processing mode: 0 gold sample, 1 silver, 2 bronze
sel_n_transit: int --- select sample according total number of transit done to generate total Xp spectra (xp_transit = rp_transit + bp_transit)
sel_percentage_blended_transit: float [0,1] --- select sample according to beta parameter defined in Riello et al 2021 (beta= (bp_n_blended_transit + rp_n_blended_transit)/ xp_transit
sel_percentage_contaminated transit: same as blended flag
drop_used_flag_columns: bool --- chose if you want to remove the flag column in the dataframe after the selection
see gaia_source or xp_summary files in gaia documentation for more info¶
return dataframe after selection
Source code in gaiaspec/standard.py
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 | |
write_tables ¶
write_tables(path, gaia_source_table, gaia_spectra_table)
Write the Gaia source and spectra tables to parquet in a directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Output directory. |
required |
gaia_source_table
|
Astropy table of Gaia sources. |
required | |
gaia_spectra_table
|
Astropy table of Gaia XP spectra. |
required |
Source code in gaiaspec/standard.py
431 432 433 434 435 436 437 438 439 440 441 442 443 444 | |