Is there a way to add custom data to the metadata of a given observation?
I have a GPS disciplined clock ( Leo Bodnar’s Mini Precision GPS Reference Clock) as an external reference to my SDRplay Duo and I would like to add the state of the GPS clock to the metadata of the observations. It would be useful to know if the clock was locked at the time of the observation. I can read the status of the clock with a SATNOGS_PRE_OBSERVATION_SCRIPT, but don’t know if it is possible to add that to the already collected metadata?
I guess I could keep records locally and relate it later, but I think it would be ‘neater’ to add it all in one place.
I really like your idea to collect additional metadata!
It’s not possible without modifying satnogs-client, indeed. But if someone is willing to do this anyway, here are some ideas:
The metadata submitted for each observation is collected by the satnogs-client in satnogsclient/observer/observer.py#L224-228. The pre-observation script is called by the same method, in satnogsclient/observer/observer.py#L155-176. So e.g. we could decide to collect the stdout output from the pre-obs script and add it to the metadata.
If there is someone willing to try implementing this I’d happily provide guidance.
One thing to consider is that currently, the post observation script is forked in the background. This is great for use cases like when compressing the IQ file and uploading it to a cloud service. But this also means that the post observation script might not have terminated when the metadata is uploaded.
Perhaps there needs to be two post observation scripts, one that runs in the background and one that runs synchronously? Or maybe the post script should always be executed synchronously, making it up to the script writer to fork to the background if needed.
I am happy to give it a try myself, if you’re willing to support my effort.
I presume that I don’t need to mess about with Ansible for this. I can just clone the satnogs-client repository, create a work branch, setup the appropriate Python environment and environmental variables and work from there?
Also I rather not work on my currently active station. Is there a procedure for development and testing that does not require the use of my station? I have another machine (not Raspi) running Debian that I can use for this.