Metadata-Version: 2.4
Name: lsdb_rubin
Version: 0.1.0
Author-email: LINCC Frameworks <lincc-frameworks-team@lists.lsst.org>
License: BSD 3-Clause License
        
        Copyright (c) 2024, LINCC Frameworks
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this
           list of conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice,
           this list of conditions and the following disclaimer in the documentation
           and/or other materials provided with the distribution.
        
        3. Neither the name of the copyright holder nor the names of its
           contributors may be used to endorse or promote products derived from
           this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
        
Project-URL: Source Code, https://github.com/astronomy-commons/lsdb_rubin
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: BSD License
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: lsdb>=0.6.4
Requires-Dist: skymap-convert>=0.1.1
Provides-Extra: dev
Requires-Dist: asv==0.6.4; extra == "dev"
Requires-Dist: jupyter; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Dynamic: license-file


<img src="https://cdn2.webdamdb.com/1280_2yYofV7cPVE1.png?1607019137" height="200"> [![LINCC Frameworks](https://github.com/astronomy-commons/lsdb/blob/main/docs/lincc-logo.png)](https://lsstdiscoveryalliance.org/programs/lincc-frameworks/)

# LSDB Rubin

[![Template](https://img.shields.io/badge/Template-LINCC%20Frameworks%20Python%20Project%20Template-brightgreen)](https://lincc-ppt.readthedocs.io/en/latest/)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/astronomy-commons/lsdb-rubin/smoke-test.yml)](https://github.com/astronomy-commons/lsdb-rubin/actions/workflows/smoke-test.yml)
[![Codecov](https://codecov.io/gh/astronomy-commons/lsdb_rubin/branch/main/graph/badge.svg)](https://codecov.io/gh/astronomy-commons/lsdb_rubin)
[![Read The Docs](https://img.shields.io/readthedocs/lsdb-rubin)](https://lsdb-rubin.readthedocs.io/)
[![PyPI](https://img.shields.io/pypi/v/lsdb_rubin?color=blue&logo=pypi&logoColor=white)](https://pypi.org/project/lsdb_rubin/)

Suite of utilities for interacting with Rubin LSST data within LSDB.

## Quickstart
To install, clone the repository (ideally, within a virtual environment): 
```python
git clone https://github.com/astronomy-commons/lsdb-rubin.git
cd lsdb-rubin
pip install .
```

### LSST tract/patch search
Use LSDB to search catalogs by LSST tract and/or patch.
```python
import lsdb
import skymap_convert
from lsdb_rubin import tract_patch_search

gaia = lsdb.read_hats("https://data.lsdb.io/hats/gaia_dr3/gaia")
lsst_skymap = skymap_convert.ConvertedSkymapReader(preset="lsst_skymap")

tract_index = 10_000
lsdb.catalog.Catalog.tract_patch_search = tract_patch_search
gaia.tract_patch_search(skymap_reader=lsst_skymap, tract=tract_index)
```
See the [demo notebook](https://github.com/astronomy-commons/lsdb-rubin/blob/main/docs/notebooks/tract_patch_search.ipynb) for more.

### Plot a LSST light curve
LSST light curves can be tricky to plot, so we've provided an easy method for a single light curve.

```python
import lsdb
from lsdb_rubin.plot_light_curve import plot_light_curve

dia_object = lsdb.open_catalog("<your-path-to>/lsdb-rubin/tests/data/mock_dp1_1000")
dia_object = dia_object.compute()

plot_light_curve(dia_object.iloc[0]["diaObjectForcedSource"])
```
See the [demo notebook](https://github.com/astronomy-commons/lsdb-rubin/blob/main/docs/notebooks/plot_light_curves.ipynb) for more.
