Skip to content

Commit 3ed47e4

Browse files
committed
updated BigQuery output
1 parent 9660a70 commit 3ed47e4

File tree

3 files changed

+59
-37
lines changed

3 files changed

+59
-37
lines changed

broker/cloud_run/lsst/scone/main.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,13 @@ def run():
9595

9696
# publish
9797
outpt_dict = {
98-
"diaObjectId": alert_lite.dict["alert_lite"]["diaObject"]["diaObjectId"],
99-
"diaSourceId": alert_lite.dict["alert_lite"]["diaSource"]["diaSourceId"],
10098
"prob": scone_classification,
10199
"predicted_class": round(scone_classification),
102100
}
103101

104102
TOPIC.publish(
105103
pittgoogle.Alert.from_dict(
106-
payload={"alert_lite": alert_lite.dict, "SCONE": outpt_dict},
104+
payload={"alert_lite": alert_lite.dict['alert_lite'], "SCONE": outpt_dict},
107105
attributes={
108106
**alert_lite.attributes,
109107
"pg_scone_class": outpt_dict["predicted_class"],
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
[
2+
{
3+
"description": "Unique identifiers from the semantically compressed alert packet.",
4+
"fields":[
5+
{
6+
"description": "diaSource",
7+
"fields": [
8+
{
9+
"description": "Unique identifier of this diaSource.",
10+
"mode": "REQUIRED",
11+
"name": "diaSourceId",
12+
"type": "INTEGER"
13+
}
14+
],
15+
"mode": "REQUIRED",
16+
"name": "diaSource",
17+
"type": "RECORD"
18+
},
19+
{
20+
"description": "diaObject",
21+
"fields": [
22+
{
23+
"description": "Unique identifier of this diaObject.",
24+
"mode": "REQUIRED",
25+
"name": "diaObjectId",
26+
"type": "INTEGER"
27+
}
28+
],
29+
"mode": "REQUIRED",
30+
"name": "diaObject",
31+
"type": "RECORD"
32+
}
33+
],
34+
"mode": "REQUIRED",
35+
"name": "alert_lite",
36+
"type": "RECORD"
37+
},
38+
{
39+
"description": "Classification results using SCONE (Helen Qu et al. 2021).",
40+
"fields": [
41+
{
42+
"description": "probability object is a type Ia supernova",
43+
"mode": "NULLABLE",
44+
"name": "prob",
45+
"type": "FLOAT"
46+
},
47+
{
48+
"description": "predicted class; 1 = Ia, 0 = non-Ia",
49+
"mode": "NULLABLE",
50+
"name": "predicted_class",
51+
"type": "INTEGER"
52+
}
53+
],
54+
"mode": "REQUIRED",
55+
"name": "SCONE",
56+
"type": "RECORD"
57+
}
58+
]

broker/setup_broker/lsst/templates/bq_lsst_value_added_scone_schema.json

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)