antares-devkit 0.5.1__tar.gz → 0.6.1__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 (63) hide show
  1. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/PKG-INFO +1 -1
  2. antares_devkit-0.6.1/antares_devkit/filters/lsst_ddf/__init__.py +43 -0
  3. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/rubin_NovTest_soraisam/__init__.py +15 -6
  4. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/young_rubin_transients_soraisam/__init__.py +28 -5
  5. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/utils.py +1 -0
  6. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/pyproject.toml +1 -1
  7. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/LICENSE.txt +0 -0
  8. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/README.md +0 -0
  9. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/__init__.py +0 -0
  10. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/bad_detection/__init__.py +0 -0
  11. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/bad_seeing/__init__.py +0 -0
  12. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/crash_filter/__init__.py +0 -0
  13. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/desi_target/__init__.py +0 -0
  14. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/dwarf_nova_outburst/__init__.py +0 -0
  15. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/ecl_transient_1/__init__.py +0 -0
  16. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/ecl_transient_2/__init__.py +0 -0
  17. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/extragalactic/__init__.py +0 -0
  18. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/highamp/__init__.py +0 -0
  19. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/highfluxchange/__init__.py +0 -0
  20. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/highsnr/__init__.py +0 -0
  21. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/if_anomaly_detection/__init__.py +0 -0
  22. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/if_anomaly_detection/data/__init__.py +0 -0
  23. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/if_anomaly_detection/data/paleo2_106IFmodel_472727objs_nest=1000_cont=0.001_transf.pkl +0 -0
  24. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/imbh/__init__.py +0 -0
  25. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/inm31/__init__.py +0 -0
  26. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/laiss_rfc_ad_filter/__init__.py +0 -0
  27. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/laiss_rfc_ad_filter/data/__init__.py +0 -0
  28. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/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.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/malanchev_anomaly_transient_dmdt/__init__.py +0 -0
  30. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/malanchev_anomaly_transient_dmdt/data/__init__.py +0 -0
  31. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/malanchev_anomaly_transient_dmdt/data/malanchev_ssiforest_v1.pickle +0 -0
  32. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/malanchev_features_v1/__init__.py +0 -0
  33. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/novtest/__init__.py +0 -0
  34. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/nuclear_transient/__init__.py +0 -0
  35. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/nuttela_tao/__init__.py +0 -0
  36. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/persistent_dimmers/__init__.py +0 -0
  37. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/random_tagger_filter/__init__.py +0 -0
  38. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/recent_reddening/__init__.py +0 -0
  39. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/refitt_newsources_snrcut/__init__.py +0 -0
  40. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/sample_filter/__init__.py +0 -0
  41. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/siena_mag_coord_cut/__init__.py +0 -0
  42. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/sso/__init__.py +0 -0
  43. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/sub_lum/__init__.py +0 -0
  44. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/superphot_plus_v1/__init__.py +0 -0
  45. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/superphot_plus_ztf_v3/__init__.py +0 -0
  46. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/test_dev_all/__init__.py +0 -0
  47. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/test_dev_lsst/__init__.py +0 -0
  48. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/test_dev_ztf/__init__.py +0 -0
  49. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/vpdf/__init__.py +0 -0
  50. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/vpdf/data/__init__.py +0 -0
  51. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/vpdf/data/matheson_percent_grid_v1 +0 -0
  52. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/filters/young_extragalactic_candidate/__init__.py +0 -0
  53. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/antares_devkit/models.py +0 -0
  54. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/test/Dockerfile +0 -0
  55. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/test/__init__.py +0 -0
  56. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/test/conftest.py +0 -0
  57. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/test/data/large_locus.py +0 -0
  58. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/test/data/small_locus.py +0 -0
  59. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/test/unit/antares_devkit/filters/test_test_dev_all.py +0 -0
  60. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/test/unit/antares_devkit/filters/test_test_dev_lsst.py +0 -0
  61. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/test/unit/antares_devkit/filters/test_test_dev_ztf.py +0 -0
  62. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/test/unit/antares_devkit/test_models.py +0 -0
  63. {antares_devkit-0.5.1 → antares_devkit-0.6.1}/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.5.1
3
+ Version: 0.6.1
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,43 @@
1
+ """Description
2
+ This filter finds locus located within a radius of 1.75 deg from the center of the LSST Deep Drilling fields.
3
+ """
4
+ from antares_devkit.models import BaseFilter
5
+
6
+ class In_LSSTDDF(BaseFilter):
7
+ NAME = 'in_LSSTDDF' #for this default filter, name is same as its tag
8
+
9
+ SLACK_CHANNEL = "#filter-in-lsst-ddf"
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_LSSTDDF',
21
+ 'description': 'Locus is along the line of sight to the LSST Deep Drilling Fields',
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
+ #ELAISS1, XMM_LSS, ECDFS, COSMOS, EDFS_a, EDFS_b
36
+ #From https://survey-strategy.lsst.io/baseline/ddf.html
37
+ LSST_DDF_ra = np.array([9.45 , 35.57, 52.98, 150.11, 58.9, 63.6])
38
+ LSST_DDF_dec = np.array([-44.02,-4.82, -28.12, 2.23, -49.32,-47.6])
39
+ field_centers = SkyCoord(ra=LSST_DDF_ra*u.deg, dec=LSST_DDF_dec*u.deg)
40
+ c = SkyCoord(ra*u.deg, dec*u.deg, frame='icrs')
41
+ sep = c.separation(field_centers)
42
+ if (sep.deg < 1.75).any(): #LSST FOV = 3.5 deg diameter
43
+ locus.tag('in_LSSTDDF')
@@ -70,8 +70,17 @@ class rubin_NovTest_soraisam(BaseFilter):
70
70
  import os
71
71
 
72
72
  antares_environment = os.getenv("ANTARES_ENVIRONMENT_URL", "")
73
+
74
+ ## check locus aggregation
75
+ C0 = False
76
+ if 'lsst' in locus.properties['survey'].keys():
77
+ if len(locus.properties['survey']['lsst']['dia_object_id']) > 1:
78
+ C0 = True
79
+ if C0:
80
+ return
81
+
73
82
 
74
- C1 = (locus.alert.properties['lsst_diaSource_reliability'] < 0.9) or (locus.alert.properties['lsst_diaSource_snr'] < 10.0)
83
+ C1 = (locus.alert.properties['lsst_diaSource_reliability'] < 0.9)
75
84
  if C1:
76
85
  return
77
86
 
@@ -95,8 +104,8 @@ class rubin_NovTest_soraisam(BaseFilter):
95
104
  TS_all = locus.timeseries('all')
96
105
  TS_lsst = locus.timeseries('lsst')
97
106
 
98
- ## want more than two measurements across all filters and time span less than 15 days (young)
99
- C4 = (len(TS_all) > 2) and (max(TS_lsst["ant_mjd"].data) - min(TS_lsst["ant_mjd"].data) < 15.0)
107
+ ## want more than two measurements across all filters
108
+ C4 = (len(TS_lsst) > 2)
100
109
  if not C4:
101
110
  return
102
111
 
@@ -184,6 +193,6 @@ class rubin_NovTest_soraisam(BaseFilter):
184
193
 
185
194
  locus.tag("SN_candies")
186
195
 
187
- msg = f"Young SN candidate: triggering alert={alert_id} for locus <{antares_environment}/loci/{ant_id}|{ant_id}> {known_to_tns}, RA={ra_str} DEC={dec_str}, {current_pb}_mag={current_mag:.2f}, #dets in LSST={len(TS_lsst)}, UTC={current.iso}"
188
- if current_mag < 22.5:
189
- self.send_message_to_slack(msg)
196
+ msg = f"SN candidate: triggering alert={alert_id} for locus <{antares_environment}/loci/{ant_id}|{ant_id}> {known_to_tns}, RA={ra_str} DEC={dec_str}, {current_pb}_mag={current_mag:.2f}, #dets in LSST={len(TS_lsst)}, UTC={current.iso}"
197
+
198
+ self.send_message_to_slack(msg)
@@ -1,4 +1,4 @@
1
- ## v1
1
+ ## v2
2
2
  from antares_devkit.models import BaseFilter
3
3
 
4
4
 
@@ -70,7 +70,17 @@ class young_rubin_transients_soraisam(BaseFilter):
70
70
  import os
71
71
 
72
72
  antares_environment = os.getenv("ANTARES_ENVIRONMENT_URL", "")
73
- C1 = (locus.alert.properties['lsst_diaSource_reliability'] < 0.9) or (locus.alert.properties['lsst_diaSource_snr'] < 10.0)
73
+
74
+ ## check locus aggregation
75
+ C0 = False
76
+ if 'lsst' in locus.properties['survey'].keys():
77
+ if len(locus.properties['survey']['lsst']['dia_object_id']) > 1:
78
+ C0 = True
79
+ if C0:
80
+ return
81
+
82
+
83
+ C1 = (locus.alert.properties['lsst_diaSource_reliability'] < 0.9)
74
84
  if C1:
75
85
  return
76
86
 
@@ -106,7 +116,7 @@ class young_rubin_transients_soraisam(BaseFilter):
106
116
  TS_all = locus.timeseries('all')
107
117
  TS_lsst = locus.timeseries('lsst')
108
118
 
109
- C4 = (len(TS_all) > 2) and (max(TS_lsst["ant_mjd"].data) - min(TS_lsst["ant_mjd"].data) < 15.0)
119
+ C4 = (len(TS_lsst) > 2) and (max(TS_lsst["ant_mjd"].data) - min(TS_lsst["ant_mjd"].data) < 45.0)
110
120
  if not C4:
111
121
  return
112
122
 
@@ -126,6 +136,20 @@ class young_rubin_transients_soraisam(BaseFilter):
126
136
  C7 = np.all(TS_lsst['lsst_diaSource_isNegative'].data==False)
127
137
  if not C7:
128
138
  return
139
+
140
+ ## check for MO, if all detections within 2 hr
141
+ if max(TS_lsst["ant_mjd"].data) - min(TS_lsst["ant_mjd"].data) < 2.0/24.0:
142
+ C8 = False
143
+ for PB in np.unique(TS_lsst["ant_passband"].data):
144
+ y = TS_lsst["ant_mag"].data[TS_lsst["ant_passband"].data==PB]
145
+ yerr = TS_lsst["ant_magerr"].data[TS_lsst["ant_passband"].data==PB]
146
+ if np.std(y) > 0.5:
147
+ C8 = True
148
+ break
149
+ else:
150
+ C8 = True
151
+ if not C8:
152
+ return
129
153
 
130
154
 
131
155
  ant_id = locus.locus_id
@@ -143,5 +167,4 @@ class young_rubin_transients_soraisam(BaseFilter):
143
167
  locus.tag("young_rubin_transients")
144
168
 
145
169
  msg = f"Young extragalactic transient: triggering alert={alert_id} for locus <{antares_environment}/loci/{ant_id}|{ant_id}> {known_to_tns}, RA={ra_str} DEC={dec_str}, {current_pb}_mag={current_mag:.2f}, #dets in LSST={len(TS_lsst)}, UTC={current.iso}"
146
- if current_mag<22.5:
147
- self.send_message_to_slack(msg)
170
+ self.send_message_to_slack(msg)
@@ -23,6 +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
27
  "InM31": "antares_devkit.filters.inm31",
27
28
  "LAISS_RFC_AD_filter": "antares_devkit.filters.laiss_rfc_ad_filter", # ["astropy", "timeout_decorator", "alerce", "numpy", "pandas", "matplotlib", "astro_ghost", "sklearn", "scipy"]
28
29
  "AnomalyTransientDmDt": "antares_devkit.filters.malanchev_anomaly_transient_dmdt", # ["numpy", "astropy", "light_curve"]
@@ -6,7 +6,7 @@ build-backend = "pdm.backend"
6
6
 
7
7
  [project]
8
8
  name = "antares-devkit"
9
- version = "0.5.1"
9
+ version = "0.6.1"
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