Querying SatNOGs network

Hi, we are getting stuck using the network API to query observations. Our use case is we want to collate recent observations from our station (M0GKK) which relate to Satellites which require gr satellites to be used to decode the data. So we want to query the Network using multiple filters for our station, the Norad ID of the satellite, start time and end time.

Previously (with fewer filters) we have used the python requests library to make queries and this has worked fine. However using multiple filters doesn’t seem to work as expected, eg if our query expression is:

url = f'{NETWORK_BASE_URL}/api/observations/?ground_station=2433&norad_cat_id={norad_cat_id}&start={start_time}&end={end_time}' 

where start_time is say two weeks ago, and end_time is now.

Everything returned is from our station but we get multiple satellites, not just the one we have selected, and the observations returned seem all to be in the future.

What are we doing wrong?

We would like to continue using the requests library if possible but have investigated the Open API docs here OpenAPI Sample.

Firstly I guess these examples are more like a template than final code. For example,
"
openapi_client" should actually be “satnogsnetworkapiclient” which we have installed.

Then as has been previously pointed out here SatNOGS DB API documentation, the way the API token is assigned to the configuration is not quite right.

The client I understand is auto generated from the API schema, and there are some minor errors - for example in observations_api.py there is a clutch of null expressions which throw an error in python until there are replaced with “None”.

However our current problem is this error:

raise LocationValueError("No host specified.")
urllib3.exceptions.LocationValueError: No host specified.

This is not at all surprising as we haven’t given the script the base URL. However, assigning this to the configuration by doing

configuration.host = 'https://network.satnogs.org'

doesn’t seem to work. How should we be passing the URL of the Network server to the querying script?

Brian

Replying to my own post here, it helps writing everything down…

I think the requests problem might be solved - we should be using satellite norad_cat_id as the filter term, not norad_cat_id. However, we would still be interested in comments on how to use the OpenAPI interface.

Brian