antares-devkit 0.10.0__tar.gz → 0.11.0__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 (73) hide show
  1. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/PKG-INFO +1 -1
  2. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/extragalactic/__init__.py +20 -13
  3. antares_devkit-0.11.0/antares_devkit/filters/simple_slsn_filter/__init__.py +157 -0
  4. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/utils.py +1 -0
  5. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/pyproject.toml +1 -1
  6. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/LICENSE.txt +0 -0
  7. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/README.md +0 -0
  8. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/__init__.py +0 -0
  9. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/bad_detection/__init__.py +0 -0
  10. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/bad_seeing/__init__.py +0 -0
  11. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/crash_filter/__init__.py +0 -0
  12. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/decam_shadow/__init__.py +0 -0
  13. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/desi_target/__init__.py +0 -0
  14. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/dwarf_nova_outburst/__init__.py +0 -0
  15. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/ecl_transient_1/__init__.py +0 -0
  16. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/ecl_transient_2/__init__.py +0 -0
  17. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/highamp/__init__.py +0 -0
  18. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/highfluxchange/__init__.py +0 -0
  19. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/highsnr/__init__.py +0 -0
  20. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/if_anomaly_detection/__init__.py +0 -0
  21. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/if_anomaly_detection/data/__init__.py +0 -0
  22. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/if_anomaly_detection/data/paleo2_106IFmodel_472727objs_nest=1000_cont=0.001_transf.pkl +0 -0
  23. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/imbh/__init__.py +0 -0
  24. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/inm31/__init__.py +0 -0
  25. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/laiss_rfc_ad_filter/__init__.py +0 -0
  26. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/laiss_rfc_ad_filter/data/__init__.py +0 -0
  27. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/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
  28. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/lantern/__init__.py +0 -0
  29. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/lantern/data/__init__.py +0 -0
  30. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/lantern/data/lantern_xgboost_t2.0.7.pkl +0 -0
  31. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/lsst_ddf/__init__.py +0 -0
  32. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/lsst_transient_quality_scimma/__init__.py +0 -0
  33. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/malanchev_anomaly_transient_dmdt/__init__.py +0 -0
  34. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/malanchev_anomaly_transient_dmdt/data/__init__.py +0 -0
  35. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/malanchev_anomaly_transient_dmdt/data/malanchev_ssiforest_v1.pickle +0 -0
  36. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/malanchev_features_v1/__init__.py +0 -0
  37. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/microlensing/__init__.py +0 -0
  38. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/novtest/__init__.py +0 -0
  39. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/nuclear_transient/__init__.py +0 -0
  40. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/nuttela_tao/__init__.py +0 -0
  41. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/passta_nearby_transients/__init__.py +0 -0
  42. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/persistent_dimmers/__init__.py +0 -0
  43. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/random_tagger_filter/__init__.py +0 -0
  44. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/recent_reddening/__init__.py +0 -0
  45. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/refitt_newsources_snrcut/__init__.py +0 -0
  46. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/rubin_NovTest_soraisam/__init__.py +0 -0
  47. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/sample_filter/__init__.py +0 -0
  48. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/shadow_virgo/__init__.py +0 -0
  49. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/siena_mag_coord_cut/__init__.py +0 -0
  50. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/sso/__init__.py +0 -0
  51. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/sub_lum/__init__.py +0 -0
  52. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/superphot_plus_v1/__init__.py +0 -0
  53. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/superphot_plus_ztf_v3/__init__.py +0 -0
  54. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/test_dev_all/__init__.py +0 -0
  55. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/test_dev_lsst/__init__.py +0 -0
  56. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/test_dev_ztf/__init__.py +0 -0
  57. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/uniform_random_sample/__init__.py +0 -0
  58. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/vpdf/__init__.py +0 -0
  59. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/vpdf/data/__init__.py +0 -0
  60. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/vpdf/data/matheson_percent_grid_v1 +0 -0
  61. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/young_extragalactic_candidate/__init__.py +0 -0
  62. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/filters/young_rubin_transients_soraisam/__init__.py +0 -0
  63. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/antares_devkit/models.py +0 -0
  64. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/test/Dockerfile +0 -0
  65. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/test/__init__.py +0 -0
  66. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/test/conftest.py +0 -0
  67. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/test/data/large_locus.py +0 -0
  68. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/test/data/small_locus.py +0 -0
  69. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/test/unit/antares_devkit/filters/test_test_dev_all.py +0 -0
  70. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/test/unit/antares_devkit/filters/test_test_dev_lsst.py +0 -0
  71. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/test/unit/antares_devkit/filters/test_test_dev_ztf.py +0 -0
  72. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/test/unit/antares_devkit/test_models.py +0 -0
  73. {antares_devkit-0.10.0 → antares_devkit-0.11.0}/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.10.0
3
+ Version: 0.11.0
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>
@@ -1,24 +1,21 @@
1
1
  """Description:
2
- This filter finds locus that falls within 1 arcsec of a source listed in the 2MASS extended source catalog, the NASA/IPAC Extragalactic Database, the NYU Value-Added Galaxy Catalog, the Sloan Digitized Sky Survey Galaxy catalog, and the Veron Catalog of Quasars & AGNs, and within a radius corresponding to respective semi-major axis for the Third Reference Catalog of bright galaxies. As new galaxy catalogs are added in ANTARES, we will update the filter accordingly.
2
+ This filter finds locus that falls within 1 arcsec of a source listed in the 2MASS extended source catalog,
3
+ the NASA/IPAC Extragalactic Database, the NYU Value-Added Galaxy Catalog, the Sloan Digitized Sky Survey Galaxy catalog,
4
+ Milliquas, and the Veron Catalog of Quasars & AGNs, and within a radius corresponding to respective semi-major axis
5
+ for the Third Reference Catalog of bright galaxies. As new galaxy catalogs are added in ANTARES, we will update the filter accordingly.
3
6
  """
4
7
 
5
8
  from antares_devkit.models import BaseFilter
6
9
 
7
10
 
8
11
  class Extragalactic(BaseFilter):
9
- # NAME = 'extragalactic' #for this default filter, name is same as its tag
10
12
  SLACK_CHANNEL = "#filter-extragalactic"
11
13
 
12
- REQUIRED_LOCUS_PROPERTIES = [
13
- "ztf_object_id",
14
- ]
14
+ TRIGGERING_SURVEY = "all"
15
+ REQUIRED_LOCUS_PROPERTIES = []
15
16
 
16
17
  ## bare absolute minimum alert properties proving it's good to go
17
18
  REQUIRED_ALERT_PROPERTIES = [
18
- "ztf_fid",
19
- "ztf_magpsf",
20
- "ztf_sigmapsf",
21
- "ant_mjd",
22
19
  "ant_survey",
23
20
  ]
24
21
 
@@ -29,14 +26,22 @@ class Extragalactic(BaseFilter):
29
26
  },
30
27
  ]
31
28
 
32
- # REQUIRES_FILES = []
33
-
34
29
  def _run(self, locus):
30
+ survey = locus.alert.properties["ant_survey"]
35
31
  if (
36
- locus.alert.properties["ant_survey"] != 1
32
+ survey == 2
37
33
  ): # be sure we don't work with upper limits
38
34
  return
39
35
 
36
+ # remove SSOs
37
+ if survey == 1:
38
+ if locus.properties['ztf_ssnamenr'] != 'null':
39
+ return
40
+
41
+ if survey == 4:
42
+ if len(locus.properties['survey']['lsst']['ss_object_id']) != 0:
43
+ return
44
+
40
45
  matching_catalog_names = locus.catalog_objects.keys()
41
46
 
42
47
  # These are the catalogs (Antares-based names) with extended sources
@@ -47,8 +52,10 @@ class Extragalactic(BaseFilter):
47
52
  "sdss_gals",
48
53
  "veron_agn_qso",
49
54
  "RC3",
55
+ "milliquas",
50
56
  ]
51
57
 
58
+
52
59
  if set(matching_catalog_names) & set(xsc_cats):
53
- # print (f'Extragalctic hit!!! {alert_id} {ztf_object_id}')
54
60
  locus.tag("extragalactic")
61
+
@@ -0,0 +1,157 @@
1
+ from antares_devkit.models import BaseFilter
2
+
3
+
4
+ class SimpleSLSNPreFilter(BaseFilter):
5
+ """
6
+ Lightweight ZTF pre-filter for downstream SLSN candidate enrichment.
7
+
8
+ The filter keeps valid g/r/i photometry, identifies the brightest
9
+ observed point, applies a basic uncertainty cut, stores the peak
10
+ measurements, and tags the locus for downstream processing.
11
+
12
+ Host matching and redshift-based luminosity calculations are handled
13
+ outside ANTARES.
14
+ """
15
+
16
+ SLACK_CHANNEL = "#filter-simple-slsn-prefilter"
17
+ TRIGGERING_SURVEY = "ztf"
18
+
19
+ REQUIRED_LOCUS_PROPERTIES = []
20
+
21
+ REQUIRED_ALERT_PROPERTIES = [
22
+ "ant_mjd",
23
+ "ztf_magpsf",
24
+ "ztf_sigmapsf",
25
+ "ztf_fid",
26
+ ]
27
+
28
+ REQUIRED_TAGS = []
29
+
30
+ OUTPUT_LOCUS_PROPERTIES = [
31
+ {
32
+ "name": "eyoue_slsn_peak_apparent_mag",
33
+ "type": "float",
34
+ "description": "Brightest valid ZTF PSF magnitude.",
35
+ },
36
+ {
37
+ "name": "eyoue_slsn_peak_mag_error",
38
+ "type": "float",
39
+ "description": "Uncertainty of the brightest ZTF measurement.",
40
+ },
41
+ {
42
+ "name": "eyoue_slsn_peak_mjd",
43
+ "type": "float",
44
+ "description": "MJD of the brightest ZTF measurement.",
45
+ },
46
+ {
47
+ "name": "eyoue_slsn_peak_band",
48
+ "type": "str",
49
+ "description": "ZTF band of the brightest measurement.",
50
+ },
51
+ {
52
+ "name": "eyoue_slsn_prefilter_status",
53
+ "type": "str",
54
+ "description": "Result of the SLSN pre-filter.",
55
+ },
56
+ ]
57
+
58
+ OUTPUT_LOCUS_TAGS = [
59
+ {
60
+ "name": "eyoue_slsn_prefilter",
61
+ "description": (
62
+ "ZTF transient selected for downstream SLSN enrichment."
63
+ ),
64
+ },
65
+ ]
66
+
67
+ REQUIRES_FILES = []
68
+
69
+ def setup(self):
70
+ self.minimum_valid_detections = 3
71
+ self.maximum_peak_mag_error = 0.30
72
+ self.ztf_band_names = {1: "g", 2: "r", 3: "i"}
73
+
74
+ def _run(self, locus):
75
+ import numpy as np
76
+
77
+ def stop(reason):
78
+ locus.set_property("eyoue_slsn_prefilter_status", reason)
79
+ return None
80
+
81
+ try:
82
+ timeseries = locus.timeseries("ztf")
83
+
84
+ mjd = np.asarray(timeseries["ant_mjd"].data, dtype=float)
85
+ magnitudes = np.asarray(
86
+ timeseries["ztf_magpsf"].data,
87
+ dtype=float,
88
+ )
89
+ magnitude_errors = np.asarray(
90
+ timeseries["ztf_sigmapsf"].data,
91
+ dtype=float,
92
+ )
93
+ bands = np.asarray(
94
+ timeseries["ztf_fid"].data,
95
+ dtype=float,
96
+ )
97
+
98
+ except Exception:
99
+ return stop(
100
+ "Unable to evaluate: could not read required ZTF data"
101
+ )
102
+
103
+ valid = (
104
+ np.isfinite(mjd)
105
+ & np.isfinite(magnitudes)
106
+ & np.isfinite(magnitude_errors)
107
+ & (magnitude_errors > 0)
108
+ & np.isfinite(bands)
109
+ & np.isin(bands, [1.0, 2.0, 3.0])
110
+ )
111
+
112
+ if np.sum(valid) < self.minimum_valid_detections:
113
+ return stop("Rejected: too few valid ZTF measurements")
114
+
115
+ mjd = mjd[valid]
116
+ magnitudes = magnitudes[valid]
117
+ magnitude_errors = magnitude_errors[valid]
118
+ bands = bands[valid].astype(int)
119
+
120
+ peak_index = int(np.argmin(magnitudes))
121
+
122
+ peak_mag = float(magnitudes[peak_index])
123
+ peak_error = float(magnitude_errors[peak_index])
124
+ peak_mjd = float(mjd[peak_index])
125
+ peak_band = self.ztf_band_names.get(
126
+ int(bands[peak_index]),
127
+ "unknown",
128
+ )
129
+
130
+ locus.set_property(
131
+ "eyoue_slsn_peak_apparent_mag",
132
+ peak_mag,
133
+ )
134
+ locus.set_property(
135
+ "eyoue_slsn_peak_mag_error",
136
+ peak_error,
137
+ )
138
+ locus.set_property(
139
+ "eyoue_slsn_peak_mjd",
140
+ peak_mjd,
141
+ )
142
+ locus.set_property(
143
+ "eyoue_slsn_peak_band",
144
+ peak_band,
145
+ )
146
+
147
+ if peak_error > self.maximum_peak_mag_error:
148
+ return stop(
149
+ "Rejected: brightest measurement has excessive uncertainty"
150
+ )
151
+
152
+ locus.set_property(
153
+ "eyoue_slsn_prefilter_status",
154
+ "Passed pre-filter; requires downstream NED enrichment",
155
+ )
156
+
157
+ locus.tag("eyoue_slsn_prefilter")
@@ -55,6 +55,7 @@ def get_filters_path():
55
55
  "LsstTransientQualityFilterScimma": "antares_devkit.filters.lsst_transient_quality_scimma",
56
56
  "UniformRandomSample": "antares_devkit.filters.uniform_random_sample",
57
57
  "Lantern": "antares_devkit.filters.lantern",
58
+ "SimpleSLSNPreFilter": "antares_devkit.filters.simple_slsn_filter",
58
59
  }
59
60
 
60
61
 
@@ -6,7 +6,7 @@ build-backend = "pdm.backend"
6
6
 
7
7
  [project]
8
8
  name = "antares-devkit"
9
- version = "0.10.0"
9
+ version = "0.11.0"
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"