Skip to main content

For clening ATLAS light curves

Project description

ATLAS Object

Package for "cleaning" ATLAS light curves by doing variance-weighted rolling mean or sigma clipping.

repo license Python Version PyPI


Conda environment

It is recommended to create an environment before installing ATLAS Object:

conda create -n atlas pip
conda activate atlas
pip install atlas_object

Usage example

First, make sure that your data has the same output format as given by the ATLAS API. One can easily plot the light curves:

import numpy as np
import matplotlib.pyplot as plt
import atlas_object as ao

# let's download a test file
ao.utils.download_test_data()

lc_file = 'test_lc.csv'  # downloaded ATLAS forced photometry file
obj = ao.atlas_object(lc_file)
obj.plot_lcs(58600, 58800)  # the user can choose the x-axis range

ATLAS1

The user can choose to do a sigma clipping within the rolling mean:

sigclip_kwargs = {'n_sigma':3}
obj.rolling(3, center=False, sigma_clip=True, **sigclip_kwargs)
obj.plot_lcs(58600, 58800)

ATLAS2

sigclip_kwargs needs to have the same input parameters as obj.sigma_clip(). All the changes occur on obj.lcs, while obj.init_lcs contains the initial light curves.

The user also has access to the indices of the data removed by the sigma clipping, for each band (e.g. obj.lcs.o.indices):

mags = np.empty(0)

fig, ax = plt.subplots(figsize=(8, 6))
for filt in 'co':
    lc = obj.init_lcs[filt]
    time = lc.time
    mag = lc.mag
    mag_err = lc.mag_err
    mask = ~obj.lcs[filt].indices
    ax.errorbar(time, mag, mag_err, 
                fmt='o', c=lc.color, mec='k',
                alpha=0.2)
    ax.errorbar(time[mask], mag[mask], mag_err[mask], 
                fmt='o', label=filt, c=lc.color, mec='k'
               )
    mags = np.r_[mags, mag]

ax.set_ylabel('Appartent Magnitude', fontsize=18)
ax.set_xlabel('MJD', fontsize=18)
ax.tick_params(labelsize=18)
ax.set_ylim(mags.min()-0.5, mags.max()+0.5)
ax.set_xlim(58600, 58800)
ax.invert_yaxis()
ax.legend(fontsize=18)
plt.show()

ATLAS3

ATLAS forced photometry

For information about public ATLAS forced photometry, check: https://fallingstar-data.com/forcedphot/. For specific information about the data, check: https://fallingstar-data.com/forcedphot/resultdesc/.

Contributing

To contribute, either open an issue or send a pull request (prefered option). You can also contact me directly.

Citing ATLAS Object

If you make use of ATLAS Object, please cite:

coming soon... 

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ATLAS Object-0.1.0.tar.gz (8.4 kB view hashes)

Uploaded Source

Built Distribution

ATLAS_Object-0.1.0-py3-none-any.whl (10.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page