-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* shorten string fields, concatenate at the end to reduce memory footprint in both RAM and disk * low memory mode save subset to disk and join after thread pool is closed, add troubleshoot section to README.md
- Loading branch information
Showing
5 changed files
with
146 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,32 @@ | ||
Example cmd to run the script: | ||
### What's Frigate? | ||
|
||
Frigate is a tool to retrieve and analyze alert data from the ZTF alert stream, from the full set of alerts to the subset of alerts that passed filters in Fritz, and the subset that was saved as proper astronomical sources. | ||
The current `frigate/__main__.py` only addresses step 1 (getting the full set of alerts for a specified time period, usually one night). The script found in `scripts/alert-stats.py` is an earlier attempt at step 1,2, and 3 along with visualization. Next, we plan to integrate better versions of step 2 and 3 in the `frigate/__main__.py` script and add more visualization tools. | ||
|
||
You can run frigate with: | ||
|
||
```bash | ||
PYTHONPATH=. python scripts/alert-stats.py --feature='candidate.magpsf,candidate.sigmapsf' --programids=1,2 --plot=True --start=2460355.5 --nb_days=1 --sp_token=<your_sp_token> --sp_groupIDs=41 --sp_filterIDs=1 --nb_bins=1000 --k_token=<your_kowalski_token> | ||
PYTHONPATH=. python frigate --k_token=<your_token> | ||
``` | ||
|
||
This would: | ||
To get the list of all possible arguments, you can run: | ||
|
||
- grab magpsf and sigmapsf values of all alerts from one night starting at jd=2460355.5 | ||
- get these values for the subset of alerts that passed the alert filter from group 41 and filter 1 on SkyPortal/Fritz | ||
- get these values for the subset of alerts that passed the alert filter AND were saved as sources (at anytime, not necessarily during that night). | ||
- plot histograms for each feature and alert subset (red: all, blue: passed filter, green: saved as sources) | ||
- plot corner plots for each feature and alert subset (same color palette) | ||
```bash | ||
PYTHONPATH=. python frigate --help | ||
``` | ||
|
||
#### V2 (WIP) | ||
To run the deprecated `scripts/alert-stats.py` script, you can run: | ||
|
||
```bash | ||
PYTHONPATH=. python scripts/alert-stats.py --feature='candidate.magpsf,candidate.sigmapsf' --programids=1,2 --plot=True --start=2460355.5 --nb_days=1 --sp_token=<your_sp_token> --sp_groupIDs=41 --sp_filterIDs=1 --nb_bins=1000 --k_token=<your_kowalski_token> | ||
``` | ||
|
||
- [] Fetch all the features of all alert packets within a given time range with given program ids and store it as a pandas dataframe | ||
- [] Fetch all of the candidates that passed filters in Fritz (with exact candid, not just objectIds). Relies on the new /api/candidates_filter endpoint. | ||
- [] Looking at the subset of alerts that passed the filters, find the obj_id of the sources that were saved in Fritz. | ||
- [] Update the dataframe with a column containing the list of filters passed for each alert, and a column containing the groupIDs for each alert which obj has been saved as a source to the groups associated to the filters passed. | ||
- [] Figure out what visualizations tools and plots we can use to represent the data in a meaningful way and extract insights from it. | ||
|
||
You can run frigate with: | ||
|
||
```bash | ||
PYTHONPATH=. python frigate --k_token=<your_token> | ||
``` | ||
#### Troubleshooting | ||
|
||
To get the list of all possible arguments, you can run: | ||
|
||
```bash | ||
PYTHONPATH=. python frigate --help | ||
``` | ||
On a system with low memory, you can call frigate with the `--low_memory=True` flag to reduce memory usage. This will save each subset of alerts to disk, and concatenate them at the end instead of concatenating as the batched queries return. That way we avoid growing the memory of the main process while the individual threads are running. In the future, we want to expand on that mode to reduce the nb of alerts fetched per batch query to reduce the memory usage even more. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters