You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-1Lines changed: 18 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,24 @@ def handler(payload, root):
60
60
gcn.listen(handler=handler)
61
61
```
62
62
63
-
## Filtering
63
+
## Server-Side Filtering
64
+
65
+
VOEvent brokers that are powered by [Comet](https://comet.transientskp.org/) support [server-side filtering of alerts](https://comet.transientskp.org/en/stable/filtering.html). You configure the server-side filtering when you connect by supplying an [XPath expression](https://www.w3schools.com/xml/xpath_syntax.asp) in the optional `filter` argument for `gcn.listen`:
Here is a cheat sheet for some common filter expressions.
72
+
73
+
| Filter expression | What it does |
74
+
| - | - |
75
+
|`//Param[@name="Packet_Type" and @value="115"]`| Pass only alerts of notice type 115 (`FERMI_GBM_FIN_POS`) |
76
+
|`//Param[@name="Packet_Type" and @value="115"] and //Error2Radius<=6`| Pass only alerts of notice type 115 (`FERMI_GBM_FIN_POS`) with error radius less than or equal to 6° |
77
+
|`//Param[@name="Packet_Type" and (@value="112" or @value="115")]`| Pass only alerts of notice type 112 (`FERMI_GBM_GND_POS`) or 115 (`FERMI_GBM_FIN_POS`) |
78
+
|`starts-with(@ivorn, "ivo://gwnet/") and @role!="test"`| Pass only LIGO-Virgo-KAGRA gravitational-wave alerts that are not test alerts |
79
+
80
+
## Client-Side Filtering
64
81
65
82
You can also filter events by notice type using
66
83
`gcn.include_notice_types` or `gcn.exclude_notice_types`.
0 commit comments