antares-devkit 0.6.3__tar.gz → 0.6.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/PKG-INFO +1 -1
  2. antares_devkit-0.6.4/antares_devkit/filters/lsst_transient_quality_scimma/__init__.py +92 -0
  3. antares_devkit-0.6.4/antares_devkit/filters/shadow_virgo/__init__.py +50 -0
  4. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/young_rubin_transients_soraisam/__init__.py +27 -23
  5. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/utils.py +3 -1
  6. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/pyproject.toml +1 -1
  7. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/LICENSE.txt +0 -0
  8. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/README.md +0 -0
  9. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/__init__.py +0 -0
  10. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/bad_detection/__init__.py +0 -0
  11. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/bad_seeing/__init__.py +0 -0
  12. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/crash_filter/__init__.py +0 -0
  13. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/desi_target/__init__.py +0 -0
  14. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/dwarf_nova_outburst/__init__.py +0 -0
  15. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/ecl_transient_1/__init__.py +0 -0
  16. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/ecl_transient_2/__init__.py +0 -0
  17. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/extragalactic/__init__.py +0 -0
  18. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/highamp/__init__.py +0 -0
  19. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/highfluxchange/__init__.py +0 -0
  20. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/highsnr/__init__.py +0 -0
  21. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/if_anomaly_detection/__init__.py +0 -0
  22. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/if_anomaly_detection/data/__init__.py +0 -0
  23. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/if_anomaly_detection/data/paleo2_106IFmodel_472727objs_nest=1000_cont=0.001_transf.pkl +0 -0
  24. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/imbh/__init__.py +0 -0
  25. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/inm31/__init__.py +0 -0
  26. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/laiss_rfc_ad_filter/__init__.py +0 -0
  27. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/laiss_rfc_ad_filter/data/__init__.py +0 -0
  28. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/laiss_rfc_ad_filter/data/cls=binary_n_estimators=100_max_depth=35_rs=11_max_feats=35_cw=balanced.pkl +0 -0
  29. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/lsst_ddf/__init__.py +0 -0
  30. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/malanchev_anomaly_transient_dmdt/__init__.py +0 -0
  31. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/malanchev_anomaly_transient_dmdt/data/__init__.py +0 -0
  32. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/malanchev_anomaly_transient_dmdt/data/malanchev_ssiforest_v1.pickle +0 -0
  33. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/malanchev_features_v1/__init__.py +0 -0
  34. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/novtest/__init__.py +0 -0
  35. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/nuclear_transient/__init__.py +0 -0
  36. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/nuttela_tao/__init__.py +0 -0
  37. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/persistent_dimmers/__init__.py +0 -0
  38. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/random_tagger_filter/__init__.py +0 -0
  39. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/recent_reddening/__init__.py +0 -0
  40. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/refitt_newsources_snrcut/__init__.py +0 -0
  41. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/rubin_NovTest_soraisam/__init__.py +0 -0
  42. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/sample_filter/__init__.py +0 -0
  43. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/siena_mag_coord_cut/__init__.py +0 -0
  44. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/sso/__init__.py +0 -0
  45. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/sub_lum/__init__.py +0 -0
  46. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/superphot_plus_v1/__init__.py +0 -0
  47. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/superphot_plus_ztf_v3/__init__.py +0 -0
  48. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/test_dev_all/__init__.py +0 -0
  49. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/test_dev_lsst/__init__.py +0 -0
  50. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/test_dev_ztf/__init__.py +0 -0
  51. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/vpdf/__init__.py +0 -0
  52. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/vpdf/data/__init__.py +0 -0
  53. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/vpdf/data/matheson_percent_grid_v1 +0 -0
  54. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/filters/young_extragalactic_candidate/__init__.py +0 -0
  55. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/antares_devkit/models.py +0 -0
  56. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/test/Dockerfile +0 -0
  57. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/test/__init__.py +0 -0
  58. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/test/conftest.py +0 -0
  59. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/test/data/large_locus.py +0 -0
  60. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/test/data/small_locus.py +0 -0
  61. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/test/unit/antares_devkit/filters/test_test_dev_all.py +0 -0
  62. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/test/unit/antares_devkit/filters/test_test_dev_lsst.py +0 -0
  63. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/test/unit/antares_devkit/filters/test_test_dev_ztf.py +0 -0
  64. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/test/unit/antares_devkit/test_models.py +0 -0
  65. {antares_devkit-0.6.3 → antares_devkit-0.6.4}/test/unit/test_filters.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: antares-devkit
3
- Version: 0.6.3
3
+ Version: 0.6.4
4
4
  Summary: Provides tools and utility methods to write and debug ANTARES filters with Python.
5
5
  Keywords: antares,devkit,filter development
6
6
  Author-Email: NSF NOIRLab ANTARES Team <antares@noirlab.edu>
@@ -0,0 +1,92 @@
1
+ """
2
+ ANTARES filter for selecting high-quality LSST transient candidates
3
+ for cross matching against Gaia and other catalogs using LSDB
4
+ running in SCiMMA infrastructure. See https://scimma.org/
5
+
6
+ This filter runs inside ANTARES infrastructure. It evaluates each incoming
7
+ LSST alert against quality criteria and tags passing alerts for downstream
8
+ crossmatching against catalogs.
9
+ """
10
+
11
+ from antares_devkit.models import BaseFilter
12
+
13
+
14
+ class LsstTransientQualityFilterScimma(BaseFilter):
15
+ """
16
+ This filter finds loci where the first alert has a SNR > 10 and the
17
+ image is not saturated, near an image edge, not classified as a dipole,
18
+ and excludes known solar system objects.
19
+ """
20
+
21
+ SLACK_CHANNEL = "#filter-scimma-lsst-quality"
22
+
23
+ TRIGGERING_SURVEY = "lsst"
24
+
25
+ REQUIRED_LOCUS_PROPERTIES = []
26
+
27
+ REQUIRED_ALERT_PROPERTIES = [
28
+ "lsst_diaSource_snr",
29
+ "lsst_diaSource_ssObjectId",
30
+ "lsst_diaSource_psfFlux_flag",
31
+ "lsst_diaSource_centroid_flag",
32
+ "lsst_diaSource_shape_flag",
33
+ "lsst_diaSource_isDipole",
34
+ "lsst_diaSource_pixelFlags_saturated",
35
+ "lsst_diaSource_pixelFlags_edge",
36
+ "lsst_diaSource_pixelFlags_cr",
37
+ "lsst_diaSource_pixelFlags_streak",
38
+ ]
39
+
40
+ REQUIRED_TAGS = []
41
+
42
+ REQUIRES_FILES = []
43
+
44
+ OUTPUT_TAG = "lsst_scimma_quality_transient"
45
+
46
+ OUTPUT_LOCUS_PROPERTIES = []
47
+
48
+ OUTPUT_LOCUS_TAGS = [
49
+ {
50
+ "name": OUTPUT_TAG,
51
+ "description": (
52
+ "LSST alert passes quality cuts for transient candidate "
53
+ "crossmatching by SCiMMA: SNR > 10, no quality flags, "
54
+ "not a known solar system object."
55
+ ),
56
+ },
57
+ ]
58
+
59
+ def setup(self):
60
+ pass
61
+
62
+ def _run(self, locus):
63
+ props = locus.alerts[-1].properties
64
+
65
+ # SNR must be strictly greater than 10.
66
+ if not props["lsst_diaSource_snr"] > 10:
67
+ return
68
+
69
+ # Exclude known solar system objects. The type of ssObjectId is
70
+ # not yet confirmed, so check for integer 0, None, and string "0".
71
+ if props["lsst_diaSource_ssObjectId"] not in (0, None, "0"):
72
+ return
73
+
74
+ # Quality flags must all be falsy.
75
+ if props["lsst_diaSource_psfFlux_flag"]:
76
+ return
77
+ if props["lsst_diaSource_centroid_flag"]:
78
+ return
79
+ if props["lsst_diaSource_shape_flag"]:
80
+ return
81
+ if props["lsst_diaSource_isDipole"]:
82
+ return
83
+ if props["lsst_diaSource_pixelFlags_saturated"]:
84
+ return
85
+ if props["lsst_diaSource_pixelFlags_edge"]:
86
+ return
87
+ if props["lsst_diaSource_pixelFlags_cr"]:
88
+ return
89
+ if props["lsst_diaSource_pixelFlags_streak"]:
90
+ return
91
+
92
+ locus.tag(self.OUTPUT_TAG)
@@ -0,0 +1,50 @@
1
+ """Description
2
+ This filter finds locus located within a radius of 1.1 deg from the center of the Shadow Project's Virgo Pointings.
3
+ """
4
+ from antares_devkit.models import BaseFilter
5
+
6
+ class InShadowVirgo(BaseFilter):
7
+ NAME = 'in_shadow_virgo' #for this default filter, name is same as its tag
8
+
9
+ SLACK_CHANNEL = "#filter-in-shadow-virgo"
10
+
11
+ ## bare absolute minimum alert properties proving it's good to go
12
+ REQUIRED_ALERT_PROPERTIES = [
13
+ 'ant_ra',
14
+ 'ant_dec',
15
+ 'ant_survey'
16
+ ]
17
+
18
+ OUTPUT_TAGS = [
19
+ {
20
+ 'name': 'in_virgo_shadow',
21
+ 'description': 'Locus is along the line of sight to the Virgo fields covered by the DECam Shadow Project',
22
+ }
23
+ ]
24
+
25
+ def _run(self, locus):
26
+ import numpy as np
27
+ from astropy import units as u
28
+ from astropy.coordinates import SkyCoord
29
+
30
+ if locus.alert.properties['ant_survey'] == 2: #be sure we don't work with upper limits
31
+ return
32
+
33
+ ra = locus.alert.properties['ant_ra']
34
+ dec = locus.alert.properties['ant_dec']
35
+ #https://github.com/lsstshadow/shadowpointings/tree/main
36
+ shadow_virgo_ra = np.array([187.7014, 186.0754, 187.9486, 189.4263, 189.1219, 187.4805,
37
+ 185.9601, 187.6007, 186.0131, 184.8111, 184.3502, 183.9883,
38
+ 184.4658, 186.3005, 191.0718, 190.5631, 189.1516, 188.7788,
39
+ 186.6354, 185.6507, 182.4151, 193.2665, 189.5427, 190.6638,
40
+ 193.4287, 188.2634, 185.2524, 188.0598, 193.0875, 191.0943])
41
+ shadow_virgo_dec = np.array([12.3963, 13.4965, 14.307, 13.3041, 11.295, 10.4477,
42
+ 11.6469, 8.4389, 7.1655, 5.7578, 12.8014, 7.6415,
43
+ 14.6628, 15.364, 12.0456, 10.0351, 8.9448, 6.8992,
44
+ 5.3375, 8.9489, 13.7313, 8.2527, 4.8363, 2.8801,
45
+ 1.8786, 2.356, 3.7762, 0.1955, -1.1488, -0.0399])
46
+ field_centers = SkyCoord(ra=shadow_virgo_ra*u.deg, dec=shadow_virgo_dec*u.deg)
47
+ c = SkyCoord(ra*u.deg, dec*u.deg, frame='icrs')
48
+ sep = c.separation(field_centers)
49
+ if (sep.deg < 1.1).any(): #DECam FOV = 2.2 deg diameter
50
+ locus.tag('in_shadow_virgo')
@@ -1,10 +1,8 @@
1
- ## v2
1
+ ## production version
2
2
  from antares_devkit.models import BaseFilter
3
3
 
4
-
5
4
  class young_rubin_transients_soraisam(BaseFilter):
6
- ## MS: this is mainly for the NOIRLab end-to-end demonstration
7
-
5
+
8
6
  TRIGGERING_SURVEY = "lsst"
9
7
 
10
8
  SLACK_CHANNEL = "#filter-young-rubin-transients"
@@ -76,15 +74,19 @@ class young_rubin_transients_soraisam(BaseFilter):
76
74
  if 'lsst' in locus.properties['survey'].keys():
77
75
  if len(locus.properties['survey']['lsst']['dia_object_id']) > 1:
78
76
  C0 = True
77
+ # print ("C0", C0)
79
78
  if C0:
80
79
  return
80
+
81
81
 
82
-
83
- C1 = (locus.alert.properties['lsst_diaSource_reliability'] < 0.9)
82
+ C1 = (locus.alert.properties['lsst_diaSource_reliability'] < 0.8)
83
+ # print ("C1", C1, locus.alert.properties['lsst_diaSource_reliability'])
84
84
  if C1:
85
85
  return
86
+
86
87
 
87
88
  C2 = (locus.alert.properties['lsst_diaSource_ssObjectId'] != 0)
89
+ # print ("C2", C2)
88
90
  if C2:
89
91
  return
90
92
 
@@ -95,28 +97,30 @@ class young_rubin_transients_soraisam(BaseFilter):
95
97
  current_pb = locus.alert.properties['ant_passband']
96
98
 
97
99
  # ## confirm locus is extragalactic
100
+ C3 = True
98
101
  astro_objects = locus.catalog_objects
99
- # matching_catalog_names = astro_objects.keys()
100
- # # Below is a battle-tested set of extended source catalogs (Antares-based names)
101
- # xsc_cats = [
102
- # "2mass_xsc",
103
- # "ned",
104
- # "nyu_valueadded_gals",
105
- # "sdss_gals",
106
- # "veron_agn_qso",
107
- # "RC3",
108
- # ]
109
- # C3 = set(matching_catalog_names) & set(xsc_cats)
110
- # if not C3:
111
- # # print ("No match with extragalactic catalog")
112
- # return
113
-
102
+ matching_catalog_names = astro_objects.keys()
103
+ ps_cats = [
104
+ "bright_guide_star_cat", ## Classification = 0 star
105
+ #"gaia_dr3_gaia_source",
106
+ "sdss_stars", ## type = 6 star
107
+ "2mass_psc",
108
+ ]
109
+ if "2mass_psc" in matching_catalog_names:
110
+ C3 = False
111
+ elif "bright_guide_star_cat" in matching_catalog_names and astro_objects['bright_guide_star_cat'][0]['classification']==0:
112
+ C3 = False
113
+ elif "sdss_stars" in matching_catalog_names and astro_objects['sdss_stars'][0]['type']==6:
114
+ C3 = False
115
+ # print ("C3", C3)
116
+ if not C3:
117
+ return
114
118
 
115
119
 
116
- TS_all = locus.timeseries('all')
117
120
  TS_lsst = locus.timeseries('lsst')
118
121
 
119
- C4 = (len(TS_lsst) > 2) and (max(TS_lsst["ant_mjd"].data) - min(TS_lsst["ant_mjd"].data) < 30.0)
122
+ ## without upper limits info in alert packet, using a less strict time baseline
123
+ C4 = (len(TS_lsst) > 2) and (max(TS_lsst["ant_mjd"].data) - min(TS_lsst["ant_mjd"].data) < 15.0)
120
124
  if not C4:
121
125
  return
122
126
 
@@ -23,7 +23,7 @@ def get_filters_path():
23
23
  "HighSNR": "antares_devkit.filters.highsnr",
24
24
  "IF_anomaly_detection": "antares_devkit.filters.if_anomaly_detection", # ["numpy", "pandas", "sklearn", "astropy"]
25
25
  "IMBH": "antares_devkit.filters.imbh",
26
- "In_LSSTDDF": "antares_devkit.filters.lsst_ddf", #["astropy", "numpy"]
26
+ "In_LSSTDDF": "antares_devkit.filters.lsst_ddf", # ["astropy", "numpy"]
27
27
  "InM31": "antares_devkit.filters.inm31",
28
28
  "LAISS_RFC_AD_filter": "antares_devkit.filters.laiss_rfc_ad_filter", # ["astropy", "timeout_decorator", "alerce", "numpy", "pandas", "matplotlib", "astro_ghost", "sklearn", "scipy"]
29
29
  "AnomalyTransientDmDt": "antares_devkit.filters.malanchev_anomaly_transient_dmdt", # ["numpy", "astropy", "light_curve"]
@@ -36,6 +36,7 @@ def get_filters_path():
36
36
  "RecentReddening": "antares_devkit.filters.recent_reddening",
37
37
  "refitt_newsources_snrcut": "antares_devkit.filters.refitt_newsources_snrcut",
38
38
  "SampleFilter": "antares_devkit.filters.sample_filter",
39
+ "InShadowVirgo": "antares_devkit.filters.shadow_virgo", # ["astropy", "numpy"]
39
40
  "siena_mag_coord_cut": "antares_devkit.filters.siena_mag_coord_cut",
40
41
  "SSOConfirmed": "antares_devkit.filters.sso",
41
42
  "sub_lum": "antares_devkit.filters.sub_lum",
@@ -48,6 +49,7 @@ def get_filters_path():
48
49
  "YoungExtragalacticCandidate": "antares_devkit.filters.young_extragalactic_candidate",
49
50
  "rubin_NovTest_soraisam": "antares_devkit.filters.rubin_NovTest_soraisam",
50
51
  "young_rubin_transients_soraisam": "antares_devkit.filters.young_rubin_transients_soraisam",
52
+ "LsstTransientQualityFilterScimma": "antares_devkit.filters.lsst_transient_quality_scimma",
51
53
  }
52
54
 
53
55
 
@@ -6,7 +6,7 @@ build-backend = "pdm.backend"
6
6
 
7
7
  [project]
8
8
  name = "antares-devkit"
9
- version = "0.6.3"
9
+ version = "0.6.4"
10
10
  description = "Provides tools and utility methods to write and debug ANTARES filters with Python."
11
11
  readme = "README.md"
12
12
  requires-python = ">=3.9"
File without changes