Beispiel #1
0
        order_v = target_spectrum.get_order(88)

        order_r.plot(ax=ax[1, 0], label=target_spectrum.name)
        order_v.plot(ax=ax[1, 1], label=target_spectrum.name)

        all_spectra.append(target_spectrum)

        s_apo = uncalibrated_s_index(target_spectrum, plots=True)

        star = StarProps(name=target_spectrum.name,
                         s_apo=s_apo,
                         time=target_spectrum.time)
        star.get_s_mwo()
        stars.append(star)

stars_to_json(stars, output_path='data/mwo_stars.json')

ax[0, 0].set_ylabel('Flux')
ax[1, 0].set_ylabel('Flux')
ax[-1, 1].set_xlabel('Wavelength [Angstroms]')
ax[-1, 0].set_xlabel('Wavelength [Angstroms]')
ax[0, 0].set_title('CaII H')
ax[0, 1].set_title('CaII K')
ax[0, 0].set_xlim([3960, 3980])
ax[0, 1].set_xlim([3925, 3945])

ax[1, 0].set_title('R (pseudocontinuum)')
ax[1, 1].set_title('V (pseudocontinuum)')
ax[1, 0].set_xlim([3890, 3910])
ax[1, 1].set_xlim([3990, 4010])
Beispiel #2
0
    # Solve for HAT-P-11 S-indices:
    target_s_mwo_err = np.sqrt((f.value * target_s_apo.value *
                                c1.err_lower)**2 +
                               (c1.value * f.value * target_s_apo.err)**2 +
                               c2.err_lower**2)

    target_s_mwo = Measurement(c1.value * target_s_apo.value + c2.value,
                               err=target_s_mwo_err,
                               time=target_s_apo.time)

    target_apo_calibrated = [
        StarProps(name=target, s_apo=sapo, s_mwo=smwo, time=sapo.time)
        for sapo, smwo in zip(target_s_apo, target_s_mwo)
    ]

    stars_to_json(target_apo_calibrated,
                  'data/{0}_apo_calibrated.json'.format(target))

    #############################################################################
    # Write out results to table
    t = Column([o.s_apo.time.jd for o in target_apo_calibrated])
    e = Column([o.s_mwo.err for o in target_apo_calibrated])
    m = Column([o.s_mwo.value for o in target_apo_calibrated])
    table = Table([t, m, e], names=['JD', '$S_{APO}$', 'Uncertainty'])
    table.sort("JD")
    formats = {"JD": "%.4f", "$S_{APO}$": "%.2f", "Uncertainty": "%.2f"}
    ascii.write(table,
                output='{0}_s_mwo.tex'.format(target),
                format='latex',
                formats=formats,
                overwrite=True)
Beispiel #3
0
        order_r = target_spectrum.get_order(91)
        order_v = target_spectrum.get_order(88)

        order_r.plot(ax=ax[1, 0], label=target_spectrum.name)
        order_v.plot(ax=ax[1, 1], label=target_spectrum.name)

        all_spectra.append(target_spectrum)

        s_apo = uncalibrated_s_index(target_spectrum)

        star = StarProps(name=target_spectrum.name,
                         s_apo=s_apo,
                         time=target_spectrum.time)
        stars.append(star)

stars_to_json(stars, output_path='k2_stars.json')

ax[0, 0].set_ylabel('Flux')
ax[1, 0].set_ylabel('Flux')
ax[-1, 1].set_xlabel('Wavelength [Angstroms]')
ax[-1, 0].set_xlabel('Wavelength [Angstroms]')
ax[0, 0].set_title('CaII H')
ax[0, 1].set_title('CaII K')
ax[0, 0].set_xlim([3960, 3980])
ax[0, 1].set_xlim([3925, 3945])

ax[1, 0].set_title('R (pseudocontinuum)')
ax[1, 1].set_title('V (pseudocontinuum)')
ax[1, 0].set_xlim([3890, 3910])
ax[1, 1].set_xlim([3990, 4010])
##############################################################################
# Solve for HAT-P-11 S-indices:
hat11_s_mwo_err = np.sqrt((f.value * hat11_s_apo.value * c1.err_lower)**2 +
                          (c1.value * f.value * hat11_s_apo.err)**2 +
                          c2.err_lower**2)

hat11_s_mwo = Measurement(c1.value * hat11_s_apo.value + c2.value,
                          err=hat11_s_mwo_err,
                          time=hat11_s_apo.time)

hat11_apo_calibrated = [
    StarProps(name='HAT-P-11', s_apo=sapo, s_mwo=smwo, time=sapo.time)
    for sapo, smwo in zip(hat11_s_apo, hat11_s_mwo)
]

stars_to_json(hat11_apo_calibrated, 'data/hat11_apo_calibrated.json')

#############################################################################
# Write out results to table

t = Column([o.s_apo.time.jd for o in hat11_apo_calibrated])
e = Column([o.s_mwo.err for o in hat11_apo_calibrated])
m = Column([o.s_mwo.value for o in hat11_apo_calibrated])
table = Table([t, m, e], names=['JD', '$S_{APO}$', 'Uncertainty'])
table.sort("JD")
formats = {"JD": "%.4f", "$S_{APO}$": "%.2f", "Uncertainty": "%.2f"}
ascii.write(table,
            output='hat11_s_mwo.tex',
            format='latex',
            formats=formats,
            overwrite=True)
Beispiel #5
0
f = FitParameter.from_text('calibration_constants/calibrated_f.txt')
c1 = FitParameter.from_text('calibration_constants/calibrated_c1.txt')
c2 = FitParameter.from_text('calibration_constants/calibrated_c2.txt')

calstars = json_to_stars('data/mwo_stars.json')
names = [s.name for s in calstars]

calstars_s_apo = Measurement([s.s_apo.uncalibrated.value for s in calstars],
                             err=[s.s_apo.uncalibrated.err for s in calstars],
                             time=[s.s_apo.time.jd for s in calstars])

##############################################################################
# Solve for HAT-P-11 S-indices:
calstars_s_mwo_err = np.sqrt((f.value * calstars_s_apo.value * c1.err_lower)**2 +
                             (c1.value * f.value * calstars_s_apo.err)**2 +
                             c2.err_lower**2)

calstars_s_mwo = Measurement(c1.value * calstars_s_apo.value + c2.value,
                             err=calstars_s_mwo_err,
                             time=calstars_s_apo.time)

calstars_apo_calibrated = [StarProps(name=names, s_apo=sapo, s_mwo=smwo,
                                     time=sapo.time)
                           for sapo, smwo, names in
                           zip(calstars_s_apo, calstars_s_mwo, names)]

stars_to_json(calstars_apo_calibrated, 'data/mwo_apo_calibrated.json')

#############################################################################

construct_standard_star_table(calstars_apo_calibrated)
Beispiel #6
0
        s_apo = uncalibrated_s_index(target_spectrum)

        star = StarProps(name=target_spectrum.name,
                         s_apo=s_apo,
                         time=target_spectrum.time)
        stars.append(star)

        ew = h_alpha_ew(target_spectrum)
        ha_eqw.append(ew.value)

    json.dump(dict(time=[s.time.jd for s in all_spectra], ha=ha_eqw),
              open('data/{0}_ha.json'.format(target_name), 'w'))
    print(dict(time=[s.time.jd for s in all_spectra], ha=ha_eqw))

    stars_to_json(stars, output_path='data/{0}.json'.format(target_name))

    ax[0, 0].set_ylabel('Flux')
    ax[1, 0].set_ylabel('Flux')
    ax[-1, 1].set_xlabel('Wavelength [Angstroms]')
    ax[-1, 0].set_xlabel('Wavelength [Angstroms]')
    ax[0, 0].set_title('CaII H')
    ax[0, 1].set_title('CaII K')
    #ax[0, 0].set_xlim([3960, 3968])
    #ax[0, 1].set_xlim([3926, 3934])
    cah = 3968.468
    cak = 3933.6614
    window = 1.5
    ax[0, 0].set_xlim([cah - window, cah + window])
    ax[0, 1].set_xlim([cak - window, cak + window])
Beispiel #7
0
        order_r = target_spectrum.get_order(91)
        order_v = target_spectrum.get_order(88)

        order_r.plot(ax=ax[1, 0], **plot_kwargs)
        order_v.plot(ax=ax[1, 1], **plot_kwargs)

        all_spectra.append(target_spectrum)

        s_apo = uncalibrated_s_index(target_spectrum)

        star = StarProps(name=target_spectrum.name,
                         s_apo=s_apo,
                         time=target_spectrum.time)
        stars.append(star)

stars_to_json(stars, output_path='data/hat11.json')

ax[0, 0].set_ylabel('Flux')
ax[1, 0].set_ylabel('Flux')
ax[-1, 1].set_xlabel('Wavelength [Angstroms]')
ax[-1, 0].set_xlabel('Wavelength [Angstroms]')
ax[0, 0].set_title('CaII H')
ax[0, 1].set_title('CaII K')
ax[0, 0].set_xlim([3960, 3980])
ax[0, 1].set_xlim([3925, 3945])

ax[1, 0].set_title('R (pseudocontinuum)')
ax[1, 1].set_title('V (pseudocontinuum)')
ax[1, 0].set_xlim([3890, 3910])
ax[1, 1].set_xlim([3990, 4010])