Metadata-Version: 2.4
Name: ampel-hu-astro
Version: 0.10.0a13
Summary: Astronomy units for the Ampel system from HU-Berlin
License: BSD-3-Clause
License-File: LICENSE
Author: Valery Brinnel
Requires-Python: >=3.12,<4.0
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Typing :: Typed
Provides-Extra: elasticc
Provides-Extra: extcats
Provides-Extra: hop
Provides-Extra: lasair
Provides-Extra: ligo
Provides-Extra: lsst
Provides-Extra: notebook
Provides-Extra: slack
Provides-Extra: sncosmo
Provides-Extra: snpy
Provides-Extra: ztf
Requires-Dist: adjustText (>=1.0.0,<2.0.0)
Requires-Dist: ampel-alerts (>=0.10.1,<0.11)
Requires-Dist: ampel-interface (>=0.10.4.post2,<0.11)
Requires-Dist: ampel-lsst[kafka] (>=0.10.1a5,<0.11) ; extra == "elasticc" or extra == "lsst"
Requires-Dist: ampel-photometry (>=0.10.1,<0.11)
Requires-Dist: ampel-plot (>=0.9.1,<0.10.0)
Requires-Dist: ampel-ztf[fp,kafka] (>=0.10.3a6,<0.11) ; extra == "ligo" or extra == "ztf"
Requires-Dist: astro-parsnip (>=1.4.1,<2.0.0) ; extra == "elasticc"
Requires-Dist: astropy (>=5.0)
Requires-Dist: backoff (>=2,<3)
Requires-Dist: beautifulsoup4 (>=4.10.0,<5.0.0)
Requires-Dist: extcats (>=2.4.2,<3.0.0) ; extra == "extcats"
Requires-Dist: healpy (>=1.16.2,<2.0.0) ; extra == "ligo"
Requires-Dist: hop-client (>=0.12.1,<0.13.0) ; extra == "hop"
Requires-Dist: iminuit (>=2.8.0,<3.0.0) ; extra == "ligo" or extra == "sncosmo"
Requires-Dist: jupyter (>=1.0.0,<2.0.0) ; extra == "notebook"
Requires-Dist: lasair (>=0.1.2,<0.2.0) ; extra == "lasair"
Requires-Dist: light-curve (>=0.10.0,<0.11.0) ; extra == "elasticc"
Requires-Dist: lightgbm (>=4.6.0,<5.0.0) ; extra == "elasticc"
Requires-Dist: ligo-gracedb (>=2.12.0,<3.0.0) ; extra == "ligo"
Requires-Dist: more-itertools (>=10.0.0,<11.0.0)
Requires-Dist: pandas (>=2.0)
Requires-Dist: py-avro-schema (>=3,<4) ; extra == "hop"
Requires-Dist: requests (>=2.26.0,<3.0.0)
Requires-Dist: scikit-learn (>=1.1.3,<2.0.0)
Requires-Dist: scipy (>=1.4)
Requires-Dist: seaborn (>=0.13.0,<0.14.0)
Requires-Dist: sfdmap2 (>=0.2.0,<0.3.0) ; extra == "ligo" or extra == "sncosmo"
Requires-Dist: slack-sdk (>=3,<4) ; extra == "slack"
Requires-Dist: sncosmo (>=2.12,<3.0) ; extra == "ligo" or extra == "sncosmo"
Requires-Dist: snpy (>=2.7.0,<3.0.0) ; extra == "snpy"
Requires-Dist: timeout-decorator (>=0.5,<0.6) ; extra == "elasticc"
Requires-Dist: uncertainties (>=3.1.7,<4.0.0)
Requires-Dist: xgboost (>=2.0.0,<3.0.0) ; extra == "elasticc"
Requires-Dist: ztfquery (>=1.26.1,<2.0.0) ; extra == "ztf"
Project-URL: Homepage, https://ampelproject.github.io
Project-URL: Repository, https://github.com/AmpelProject/Ampel-HU-astro
Description-Content-Type: text/markdown

<img align="left" src="https://user-images.githubusercontent.com/17532220/213287034-0209aa19-f8a1-418f-a325-7472510542cb.png" width="150" height="150"/>
<br>

# AMPEL-HU-astro
<br><br>


Contributed Ampel units from HU/DESY group
==========================================

## Installing

1. [Install poetry](https://python-poetry.org/docs/#installation).
2. `git clone https://github.com/AmpelProject/Ampel-HU-astro.git; cd Ampel-HU-astro`
3. Check your virtualenv setup with `poetry env info`. The output should include:
   ```
   Virtualenv
   Python:         3.12.x
   ```
   If not, point poetry at an installation of Python 3.12 with `poetry env use python3.12` (assuming that python3.12 is in your `PATH`)
4. `poetry install -E "ztf sncosmo extcats notebook"`
5. `cd notebooks`
6. `poetry run jupyter notebook`

This will allow a number of Demo / access / development notebooks to be run. Note that most of them
requires an access token if data is to be retrieved.

## Provided units

<!-- The following are extracted from the docstrings; do not edit by hand -->
<!-- AUTOGENERATED CONTENT, do not edit below this line -->

### T0 units (alert filters):
- [DecentVroFilter](ampel/contrib/hu/t0/DecentVroFilter.py): General-purpose filter for VRO alerts, based on the ZTF DecentFilter.
- [LensedTransientFilter](ampel/contrib/hu/t0/LensedTransientFilter.py)
- [PredetectionFilter](ampel/contrib/hu/t0/PredetectionFilter.py): Filter derived from the DecentFilter.
- [RandFilter](ampel/contrib/hu/t0/RandFilter.py)
- [RcfFilter](ampel/contrib/hu/t0/RcfFilter.py): Filter for the ZTF Redshift Completeness Factor program..
- [RedshiftCatalogFilter](ampel/contrib/hu/t0/RedshiftCatalogFilter.py): Filter derived from DecentFilter designed to only accept transients located close to a galaxy in a catalog, and within redshift bounds.
- [SimpleDecentFilter](ampel/contrib/hu/t0/SimpleDecentFilter.py): General-purpose filter devloped alongside DecentFilter but without use of external catalogs.
- [StellarFilter](ampel/contrib/hu/t0/StellarFilter.py): a.k.a. as the IndecentFilter, i.e. an inversion of the DecentFilter mainly used for finding extragalactic objects.
- [TimeDistributionFilter](ampel/contrib/hu/t0/TimeDistributionFilter.py): Filter derived from the DecentFilter, in addition.
- [TransientInClusterFilter](ampel/contrib/hu/t0/TransientInClusterFilter.py): Filter derived from the DecentFilter, in addition selecting candidates with position compatible with that of nearby galaxy clusters..
- [XShooterFilter](ampel/contrib/hu/t0/XShooterFilter.py): Filter derived from the DecentFilter, in addition selecting very new transients which are visible from the South.

### T2 units (augment):
- [T2BayesianBlocks](ampel/contrib/hu/t2/T2BayesianBlocks.py): T2 unit for running a bayesian block search algorithm to highlight excess regions.
- [T2BrightSNProb](ampel/contrib/hu/t2/T2BrightSNProb.py): Derive a number of simple metrics describing the rise, peak and decline of a lc.
- [T2CatalogMatchLocal](ampel/contrib/hu/t2/T2CatalogMatchLocal.py): Cross matches the position of a transient to those of sources in a set of catalogs.
- [T2ClassificationReport](ampel/contrib/hu/t2/T2ClassificationReport.py): Require and propagate classification information from ParsnipRiseDecline..
- [T2DemoLightcurveFitter](ampel/contrib/hu/t2/T2DemoLightcurveFitter.py): Demonstration class showing how methods of T2BaseLightcurveFitter can be used develop a specific classifier.
- [T2DigestRedshifts](ampel/contrib/hu/t2/T2DigestRedshifts.py): Compare potential matches from different T2 units providing redshifts.
- [T2DustEchoEval](ampel/contrib/hu/t2/T2DustEchoEval.py)
- [T2ElasticcRedshiftSampler](ampel/contrib/hu/t2/T2ElasticcRedshiftSampler.py): Parse the elasticc diaSource host information and returns a list of redshifts and weights.
- [T2ElasticcReport](ampel/contrib/hu/t2/T2ElasticcReport.py): Parse a series of T2 results from T2RunParsnip and T2XgbClassifier, and create combined classifications according to the taxonomy of https://github.com/LSSTDESC/elasticc/blob/main/taxonomy/taxonomy.ipynb.
- [T2FastDecliner](ampel/contrib/hu/t2/T2FastDecliner.py): Determine decline rate in two last obs.
- [T2GetLensSNParameters](ampel/contrib/hu/t2/T2GetLensSNParameters.py)
- [T2InfantCatalogEval](ampel/contrib/hu/t2/T2InfantCatalogEval.py): Evaluate whether a transient fulfills criteria for being a potentially infant (extragalactic) transient.
- [T2InfantReport](ampel/contrib/hu/t2/T2InfantReport.py): Report potential infant transients.
- [T2KilonovaEval](ampel/contrib/hu/t2/T2KilonovaEval.py): Evaluate whether a transient fulfills criteria for being a potential kilonova-like event.
- [T2KilonovaStats](ampel/contrib/hu/t2/T2KilonovaStats.py): Evaluate kilonovaness stats for transient given map distance and number of detections..
- [T2LCQuality](ampel/contrib/hu/t2/T2LCQuality.py): determine the 'quality' of the light curve by computing ratios between the number of detection and that of upper limits.
- [T2LSPhotoZTap](ampel/contrib/hu/t2/T2LSPhotoZTap.py): Query the NOIR DataLab service for photometric redshifts from the Legacy Survey.
- [T2LSSTReport](ampel/contrib/hu/t2/T2LSSTReport.py): Create an LSST report for subsequent distribution.
- [T2LasairReport](ampel/contrib/hu/t2/T2LasairReport.py): Propagate classification results to Lasair..
- [T2LoadRedshift](ampel/contrib/hu/t2/T2LoadRedshift.py): Add redshifts from external .csv.
- [T2MatchBTS](ampel/contrib/hu/t2/T2MatchBTS.py): Add information from the BTS explorer page.
- [T2MinorPlanetCenter](ampel/contrib/hu/t2/T2MinorPlanetCenter.py): Check if the *latest* detection of a transient corresponds matches something known by the MinorPlanetCenter..
- [T2MultiXgbClassifier](ampel/contrib/hu/t2/T2MultiXgbClassifier.py): For a range of xgboost classifier models, find a classification.
- [T2NedSNCosmo](ampel/contrib/hu/t2/T2NedSNCosmo.py): Fits lightcurves using SNCOSMO (using SALT2 defaultwise) with redshift constrained by catalog matching results.
- [T2NedTap](ampel/contrib/hu/t2/T2NedTap.py): See also: https://ned.ipac.caltech.edu/tap/sync?QUERY=SELECT+*+FROM+TAP_SCHEMA.tables&REQUEST=doQuery&LANG=ADQL&FORMAT=text Export all NED: https://ned.ipac.caltech.edu/tap/sync?QUERY=SELECT+*+FROM+NEDTAP.objdir&REQUEST=doQuery&LANG=ADQL&FORMAT=text.
- [T2Observability](ampel/contrib/hu/t2/T2Observability.py): cross match the position of a transient to those of sources in a set of catalogs and attach the required information to the transient..
- [T2RiseDeclineStat](ampel/contrib/hu/t2/T2RiseDeclineStat.py)
- [T2RunParsnip](ampel/contrib/hu/t2/T2RunParsnip.py): Gathers information and runs the parsnip model and classifier.
- [T2RunParsnipRiseDecline](ampel/contrib/hu/t2/T2RunParsnipRiseDecline.py)
- [T2RunPossis](ampel/contrib/hu/t2/T2RunPossis.py): Load a POSSIS kilnova model and fit to a LightCurve object as process is called.
- [T2RunSncosmo](ampel/contrib/hu/t2/T2RunSncosmo.py): Gathers information and runs Sncosmo.
- [T2RunSnoopy](ampel/contrib/hu/t2/T2RunSnoopy.py): Gathers information and runs snoopy.
- [T2RunTDE](ampel/contrib/hu/t2/T2RunTDE.py): Create a TDE model and fit to a LightCurve object as process is called.
- [T2SNCosmo](ampel/contrib/hu/t2/T2SNCosmo.py)
- [T2TNSEval](ampel/contrib/hu/t2/T2TNSEval.py): Evalute whether a transient fulfills criteria for submission to TNS.
- [T2XgbClassifier](ampel/contrib/hu/t2/T2XgbClassifier.py): Load a series of xgboost classifier models (distinguished by number of detections) and return a classification.

### T3 units (react):
- [AstroColibriPublisher](ampel/contrib/hu/t3/AstroColibriPublisher.py): Publish results to AstroColibri.
- [ChannelSummaryPublisher](ampel/contrib/hu/t3/ChannelSummaryPublisher.py): Create a json file with summary statistics for the channel.
- [CostCounter](ampel/contrib/hu/t3/CostCounter.py): Derive metrics for the total cost, as parsed by the provided documents.
- [DCachePublisher](ampel/contrib/hu/t3/DCachePublisher.py): Publish TransientViews to DCache in gzipped JSON format.
- [ElasticcClassPublisher](ampel/contrib/hu/t3/ElasticcClassPublisher.py): This unit is intended to submit classifications to the DESC TOM db during the ELAsTICC LSST alert simulation.
- [ElasticcClassTablePrinter](ampel/contrib/hu/t3/ElasticcClassTablePrinter.py): Unit which will print Elasticc unit classifications to STDOUT and/or an output csv file.
- [HealpixCorrPlotter](ampel/contrib/hu/t3/HealpixCorrPlotter.py): Compare healpix coordinate P-value with output from T2RunSncosmo..
- [PlotLightcurveSample](ampel/contrib/hu/t3/PlotLightcurveSample.py): Unit plots results from lightcurve fitters (RunSncosmo, RunParsnip).
- [PlotTransientLightcurves](ampel/contrib/hu/t3/PlotTransientLightcurves.py): Create a (pdf) plot summarizing lightcurves of candidates provided to the unit.
- [RapidBase](ampel/contrib/hu/t3/RapidBase.py): Trigger rapid reactions.
- [RapidLco](ampel/contrib/hu/t3/RapidLco.py): Submit LCO triggers for candidates passing criteria..
- [RapidSedm](ampel/contrib/hu/t3/RapidSedm.py): Select transients for rapid reactions.
- [ScoreSingleObject](ampel/contrib/hu/t3/ScoreSingleObject.py): Calculate score based on how early a specific SN is detected.
- [ScoreTNSObjects](ampel/contrib/hu/t3/ScoreTNSObjects.py): Calculate score based on detection time reported to TNS, if any..
- [SlackSummaryPublisher](ampel/contrib/hu/t3/SlackSummaryPublisher.py)
- [SubmitTNS](ampel/contrib/hu/t3/SubmitTNS.py): Submit candidates to TNS (unless already submitted).
- [TransientInfoPrinter](ampel/contrib/hu/t3/TransientInfoPrinter.py)
- [TransientTablePublisher](ampel/contrib/hu/t3/TransientTablePublisher.py): Construct a table based on selected T2 output values.
- [TransientViewDumper](ampel/contrib/hu/t3/TransientViewDumper.py)

### T4 units (control):
- [ElasticcTomBridge](ampel/contrib/hu/t4/ElasticcTomBridge.py): Bridge between Elasticc classifications and the DESC TOM system.
- [HealpixTokenGenerator](ampel/contrib/hu/t4/HealpixTokenGenerator.py): Based on a URL to a Healpix map.
- [RandomMapGenerator](ampel/contrib/hu/t4/RandomMapGenerator.py): Generate smoothed circular healpix probability values around a random coordinate..
- [StreamTokenGenerator](ampel/contrib/hu/t4/StreamTokenGenerator.py): Stream based token generator for.

