Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add gaia dr3/edr3 filters #83

Merged
merged 3 commits into from
Jan 10, 2024
Merged

add gaia dr3/edr3 filters #83

merged 3 commits into from
Jan 10, 2024

Conversation

segasai
Copy link
Contributor

@segasai segasai commented Jan 9, 2024

Hi, I added gaia dr3/edr3 filters

It fixes #80

The following code

import speclite.filters
gdr3 = speclite.filters.load_filters('gaiadr3-*')
speclite.filters.plot_filters(gdr3)

produces this
image

Just in case, I also include the code that I used to generate the .ecsvs

import astropy.table as atpy, astropy.units as auni
import numpy as np

T = atpy.Table().read('GaiaEDR3_passbands_zeropoints_version2/passband.dat',
                      format='ascii')

for i in range(3):
    val = T['col%d' % (i * 2 + 2)]  # col2 for i=0
    e_val = T['col%d' % (i * 2 + 3)]
    xind = np.nonzero((val != 99.99) & (val > e_val)
                      & (val > (1e-6 * val.max())))[0]
    N = len(xind)
    x0, x1 = xind[0], xind[-1]
    if x0 > 0:
        x0 = x0 - 1
    if x1 < len(val) - 1:
        x1 = x1 + 1
    xind = slice(x0, x1 + 1)
    val = val[xind] * 1
    val[0] = 0
    val[-1] = 0
    TT = atpy.Table({
        'wavelength': T['col1'][xind] * 10 * auni.Angstrom,
        'response': val
    })
    band = ['G', 'BP', 'RP'][i]
    TT.meta['url'] = 'https://www.cosmos.esa.int/web/gaia/edr3-passbands'
    TT.meta['group_name'] = 'gaiadr3'
    TT.meta['band_name'] = band
    TT.meta['airmass'] = 0
    TT.meta[
        'description'] = f'Bandpass for Gaia {band} band for DR3/EDR3 release'
    TT.write(f'gaiadr3-{band}.ecsv', overwrite=True)

@dkirkby
Copy link
Member

dkirkby commented Jan 9, 2024

This looks good to me. Thanks @segasai.

Copy link
Member

@moustakas moustakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @segasai. Before I approve, can you also please update the documentation by adding a figure of the filters to docs/_static directory and a brief description of the filter curves (especially any references or caveats) to docs/filters.rst, please?

@segasai
Copy link
Contributor Author

segasai commented Jan 10, 2024

Thanks @moustakas, I applied the changes that you asked.

@moustakas moustakas merged commit 80ff712 into desihub:main Jan 10, 2024
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Gaia DR3 pass-bands
3 participants