Package: gocart
gocartgocart is a python package and command-line suite used to consumeGCN Kafka streams.Documentation for gocart is hosted byRead the Docs(development versionandmain version). The code lives ongithub. Please report any issues you findhere.FeaturesListen to GCN Kafka streams (currently  LIGO-Virgo-KAGRA only) and write alerts and skymaps to the local filesystem.Ability to 'echo' the Kafka stream by re-listening to the last N days of alerts (provided the alerts are still hosted on the GCN Kafka cluster).Alert content, FITS Header data and some extra value-added event parameters are written to a single machine-readable YAML file.The healpix skymaps are optionally converted to ascii files (one row per healpix pixel) and/or rendered as aitoff plots.Create your own plugin scripts to run whenever an alert is parsed.works well in conjunction withskyTag.InstallationThe easiest way to install gocart is to useconda:condacreate-ngocartpython=3.9pipgocart-cconda-forge
condaactivategocartTo upgrade to the latest version of gocart use the command:condaupgradegocart-cconda-forgeIt is also possible to install via pip if required:pipinstallgocartOr you can clone thegithub repoand install from a local version of the code:gitclonegit@github.com:thespacedoctor/gocart.gitcdgocart
pythonsetup.pyinstallTo check installation was successful rungocart -v. This should return the version number of the install.Initialising gocartBefore using gocart you need to use theinitcommand to generate a user settings file. Running the following creates ayamlsettings file in your home folder under~/.config/gocart/gocart.yaml:gocartinitThe file is initially populated with gocart's default settings which can be adjusted to your preference.If at any point the user settings file becomes corrupted or you just want to start afresh, simply trash thegocart.yamlfile and rerungocart init.GCN Kafka CredentialsWhen you first come to use gocart, you will need to add a GCN Kafka Client ID and Secret to thegocart.yamlsettings file. To get these credentials you will need to signup for aGCN Notices account here.Once signed in, fill in a suitable name for your new client (any name will do, so gocart is as good a name as any). Fill in the captcha and click 'Create New Credentials'.In the 'Customize Alerts' section, don't be concerned about what Notice Types to select as these are only used to generate template code in the next section. Not selecting any is fine. Click the 'Generate Code' button. You will now be presented with your newly created client credentials within the body of the code snippet:Open your gocart settings file at~/.config/gocart/gocart.yamland copy and paste these credentials into the appropriate place.Don't worry about thegroup_idparameter, it's initially set to XXXX but gocart will replace this with a unique value when it's first run. It is thisgroup_idthat allows GCN Kafka to remember which alerts you have or have not heard before. Note the example client above has been deleted, so the credentials quoted here will not work.You are now ready to start using gocart.SkyTaggocart works very well in conjunction withskyTag, a tool to 'annotate' transient sources or galaxies with the percentage credibility region they reside within on a given HealPix sky map.How to cite gocartIf you usegocartin your work, please cite using the following BibTeX entry:@software{Young_gocart,author={Young, David R.},doi={10.5281/zenodo.7970743},license={GPL-3.0-only},title={{gocart}},url={https://github.com/thespacedoctor/gocart}}