1
0
Fork 0
Scripts for working with the SatNOGS Optical network, as it is being built. https://spacecruft.org/spacecruft/satnogs-optical-scripts
Go to file
Jeff Moe a6e653d6b1 Linky to dev schema 2023-06-26 10:06:24 -06:00
examples Add example PNG and json from Spacecruft archive 2023-06-25 15:11:58 -06:00
.gitignore Ignore temp files 2023-06-25 10:21:45 -06:00
LICENSE-AGPL AGPL 2023-06-25 10:21:06 -06:00
LICENSE-CC CC by SA 4.0 Intl 2023-06-25 10:21:16 -06:00
README.md Linky to dev schema 2023-06-26 10:06:24 -06:00
requirements.txt python requirements, bang path 2023-06-25 12:38:29 -06:00
satnogs-optical-upload Add command line parsing for token and url 2023-06-25 15:44:22 -06:00

README.md

SatNOGS Optical Scripts

Scripts for interacting with the SatNOGS Optical network, while it is under construction.

Example stvid PNG

Example PNG from stvid.

Script

Script in the repo:

  • satnogs-optical-upload --- Upload a JSON and PNG file output from stvid to the SatNOGS database.

SatNOGS DB API

To push optical data to the SatNOGS network, an account with the Libre Space Foundation (LSF) is needed. The LSF uses one account across all of their sites. One may create an account by going to their discussion server and clicking "Sign Up":

With an account, log into these sites and get the API key by clicking the user icon in the top right and selecting "Settings / API Token":

These tokens will be used by the script in the steps below.

Install

Install thusly.

Using Debian Bookworm (stable/12) as a base.

Dependencies

Dependencies that may be needed:

apt install python3-pip python3-virtualenv

Python

Get code and set up python environment:

git clone https://spacecruft.org/spacecruft/satnogs-optical-scripts
cd satnogs-optical-scripts
virtualenv -p python3 env
source env/bin/activate
pip install --upgrade pip
pip install -r requirements.txt

Configure

Configure thusly.

echo "no configuration ?   :)"

Run

Run thusly.

Gently use the development (testing) server to confirm scripts are behaving correctly, before uploading to the SatNOGS DB production server.

Also, before uploading to the production server, it is probably a good idea to let the LSF admins know via the #satnogs-optical matrix channel.

Note, the API token is different on the development db-dev server and the production db server.

URL for running your own local server:

http://localhost:8000/api

Using the LSF SatNOGS DB development server:

https://db-dev.satnogs.org/api

Using the LSF SatNOGS DB live production server:

https://db.satnogs.org/api
cd satnogs-optical-scripts/
source env/bin/activate

./satnogs-optical-upload \
  --json=examples/2023-06-25T03-56-23.189_data.json \
  --plot=examples/2023-06-25T03-56-23.189_0.png \
  --token="d111111111111112222222222222233333333345" \
  --url="http://localhost:8000/api"

Usage

Usage help.

$ ./satnogs-optical-upload -h
usage: satnogs-optical-upload [-h] -j JSON -p PLOT -t TOKEN -u URL

options:
  -h, --help            show this help message and exit
  -j JSON, --json JSON  JSON file from stvid
  -p PLOT, --plot PLOT  PNG plot from stvid
  -t TOKEN, --token TOKEN
                        DB API token
  -u URL, --url URL     DB base URL

Example

Example run, with output:

(env) jebba@rs-satnogs-optical:~/devel/spacecruft/satnogs-optical-scripts$ ./satnogs-optical-upload \
  --json=examples/2023-06-25T03-56-23.189_data.json \
  --plot=examples/2023-06-25T03-56-23.189_0.png \
  --token="d111111111111112222222222222233333333345" \
  --url="https://db-dev.satnogs.org/api"
{
    "data": {
        "dec": 55.32130110765502,
        "exptime": 6.122716426849365,
        "height": 1860.0,
        "latitude": 40.568912,
        "longitude": -105.225852,
        "observer": "Jeff Moe",
        "ra": 95.13430557425833,
        "satellites": [
            {
                "catalogname": "starlink",
                "cospar": "22 062W",
                "iod_lines": [
                    "52850 22 062W   7099 G 20230625035623599 17 25 0609303+575144 37 S",
                    "52850 22 062W   7099 G 20230625035624502 17 25 0607850+580103 37 S",
                    "52850 22 062W   7099 G 20230625035625381 17 25 0606370+581045 37 S",
                    "52850 22 062W   7099 G 20230625035626259 17 25 0604876+581919 37 S",
                    "52850 22 062W   7099 G 20230625035627128 17 25 0603408+582865 37 S",
                    "52850 22 062W   7099 G 20230625035627976 17 25 0602003+583731 37 S",
                    "52850 22 062W   7099 G 20230625035628876 17 25 0600422+584673 37 S"
                ],
                "measurements": [
                    {
                        "dec": 57.857287449958314,
                        "drxdt": -0.1963741786737604,
                        "drydt": 0.18382220234846436,
                        "ra": 92.3256434698825,
                        "time": "2023-06-25T03:56:23.599"
                    },
                    {
                        "dec": 58.01708709678573,
                        "drxdt": -0.21244996154282958,
                        "drydt": 0.18733050889881478,
                        "ra": 91.96255754767652,
                        "time": "2023-06-25T03:56:24.502"
                    },
                    {
                        "dec": 58.17422765164212,
                        "drxdt": -0.2090010969069157,
                        "drydt": 0.18373548137315562,
                        "ra": 91.5924733099297,
                        "time": "2023-06-25T03:56:25.381"
                    },
                    {
                        "dec": 58.319843679991905,
                        "drxdt": -0.2159630197832153,
                        "drydt": 0.19534313579671686,
                        "ra": 91.21892704798991,
                        "time": "2023-06-25T03:56:26.259"
                    },
                    {
                        "dec": 58.47754880798755,
                        "drxdt": -0.21374297484070756,
                        "drydt": 0.1903445716267595,
                        "ra": 90.851987293091,
                        "time": "2023-06-25T03:56:27.128"
                    },
                    {
                        "dec": 58.62182980444688,
                        "drxdt": -0.18930620836031795,
                        "drydt": 0.17682370020456198,
                        "ra": 90.50076411277033,
                        "time": "2023-06-25T03:56:27.976"
                    },
                    {
                        "dec": 58.77880746720159,
                        "drxdt": -0.21655046836920652,
                        "drydt": 0.1894795997657806,
                        "ra": 90.10542508976972,
                        "time": "2023-06-25T03:56:28.876"
                    }
                ],
                "satno": 52850,
                "tlefile": "starlink.tle"
            },
            {
                "catalogname": "starlink",
                "cospar": "22 017W",
                "iod_lines": [
                    "51788 22 017W   7099 G 20230625035623530 17 25 0615008+565308 37 S",
                    "51788 22 017W   7099 G 20230625035624502 17 25 0614405+570397 37 S",
                    "51788 22 017W   7099 G 20230625035625381 17 25 0613742+571401 37 S",
                    "51788 22 017W   7099 G 20230625035626259 17 25 0613094+572364 37 S",
                    "51788 22 017W   7099 G 20230625035627128 17 25 0612461+573377 37 S",
                    "51788 22 017W   7099 G 20230625035627976 17 25 0611769+574380 37 S",
                    "51788 22 017W   7099 G 20230625035628876 17 25 0611168+575385 37 S"
                ],
                "measurements": [
                    {
                        "dec": 56.88465733657417,
                        "drxdt": -0.09855495100980698,
                        "drydt": 0.17019341164399363,
                        "ra": 93.75209667032922,
                        "time": "2023-06-25T03:56:23.530"
                    },
                    {
                        "dec": 57.06609285392241,
                        "drxdt": -0.10144052872968906,
                        "drydt": 0.19209602251753635,
                        "ra": 93.60130735315394,
                        "time": "2023-06-25T03:56:24.502"
                    },
                    {
                        "dec": 57.23344216048226,
                        "drxdt": -0.101735165103579,
                        "drydt": 0.18325293608988102,
                        "ra": 93.43552051815831,
                        "time": "2023-06-25T03:56:25.381"
                    },
                    {
                        "dec": 57.39407779186916,
                        "drxdt": -0.0923474215345202,
                        "drydt": 0.20079336891502214,
                        "ra": 93.27347263547081,
                        "time": "2023-06-25T03:56:26.259"
                    },
                    {
                        "dec": 57.56282069059271,
                        "drxdt": -0.08993103786982129,
                        "drydt": 0.19638517785523385,
                        "ra": 93.11535409762125,
                        "time": "2023-06-25T03:56:27.128"
                    },
                    {
                        "dec": 57.729939955584456,
                        "drxdt": -0.06257481769512721,
                        "drydt": 0.17218707016972382,
                        "ra": 92.94236869686564,
                        "time": "2023-06-25T03:56:27.976"
                    },
                    {
                        "dec": 57.89750398428741,
                        "drxdt": -0.09522293488492743,
                        "drydt": 0.19066192479048286,
                        "ra": 92.79195134035075,
                        "time": "2023-06-25T03:56:28.876"
                    }
                ],
                "satno": 51788,
                "tlefile": "starlink.tle"
            },
            {
                "catalogname": "classfd",
                "cospar": "05 004B",
                "iod_lines": [
                    "28538 05 004B   7099 G 20230625035623632 17 25 0636669+494439 37 S",
                    "28538 05 004B   7099 G 20230625035624600 17 25 0636134+495007 37 S",
                    "28538 05 004B   7099 G 20230625035625568 17 25 0635558+495575 37 S",
                    "28538 05 004B   7099 G 20230625035626533 17 25 0634995+500126 37 S",
                    "28538 05 004B   7099 G 20230625035627452 17 25 0634478+500683 37 S",
                    "28538 05 004B   7099 G 20230625035628441 17 25 0633907+501258 37 S"
                ],
                "measurements": [
                    {
                        "dec": 49.73979583042747,
                        "drxdt": -0.091677773213083,
                        "drydt": 0.09772957396062226,
                        "ra": 99.16726907597415,
                        "time": "2023-06-25T03:56:23.632"
                    },
                    {
                        "dec": 49.83456383140711,
                        "drxdt": -0.10551266510630763,
                        "drydt": 0.09996227530112299,
                        "ra": 99.03347393531169,
                        "time": "2023-06-25T03:56:24.600"
                    },
                    {
                        "dec": 49.929180976224266,
                        "drxdt": -0.11182653617125038,
                        "drydt": 0.07898890129541801,
                        "ra": 98.88948620027027,
                        "time": "2023-06-25T03:56:25.568"
                    },
                    {
                        "dec": 50.02108054319076,
                        "drxdt": -0.10365173997994334,
                        "drydt": 0.09238456725623347,
                        "ra": 98.74870208940634,
                        "time": "2023-06-25T03:56:26.533"
                    },
                    {
                        "dec": 50.11376390542589,
                        "drxdt": -0.0999982346186917,
                        "drydt": 0.09051522767093455,
                        "ra": 98.61941794039831,
                        "time": "2023-06-25T03:56:27.452"
                    },
                    {
                        "dec": 50.20965303576972,
                        "drxdt": -0.08859897080674996,
                        "drydt": 0.09039899200177147,
                        "ra": 98.47671605578383,
                        "time": "2023-06-25T03:56:28.441"
                    }
                ],
                "satno": 28538,
                "tlefile": "classfd.tle"
            }
        ],
        "site_id": 7099,
        "start": "2023-06-25T03:56:23.189",
        "sx": 0.012984505526739692,
        "sy": 0.013031916801672289,
        "wx": 12.465125305670105,
        "wy": 7.0372350729030355
    },
    "diagnostic_plot_url": "https://db-dev.satnogs.org/media/data_optical_obs/2023/6/25/21/2023-06-25T03-56-23.189_0.png",
    "id": 4,
    "identifications": [
        {
            "norad_id": 52850,
            "satellite_id": null
        },
        {
            "norad_id": 51788,
            "satellite_id": null
        },
        {
            "norad_id": 28538,
            "satellite_id": null
        }
    ],
    "start": "2023-06-25T03:56:23.189000Z",
    "station_id": 7099,
    "uploader": 186
}
201

TODO

Todo, "tomorrow"...

  • Securely use API token.
  • Securely store API token.
  • Tighter integration with stvid.
  • Tighter integration with sattools.
  • Use configuration file ? stvid's?
  • Select which observations to upload.

Spacecruft

Other, perhaps relevant, Spacecruft links.

The present repo:

The SatNOGS Optical Unofficial Guide latest PDF release, SNOUG.pdf:

LaTeX source repo for SatNOGS Optical Unofficial Guide.

Archive of stvid detected satellite PNGs, sorted by NORAD ID:

Archive of stvid output from each Spacecruft camera. Includes .json, PNG, and other files, but only a few FITS:

Spacecruft development version of stvid. It is better to use the cbassa repo. Some various oddball branches here:

Libre version of cbassa sattools. Replaces non-free pgplot library with libre Giza plotting library. Only a few apps have been ported, and are incomplete:

Examples in the examples/ directory are from here:

Upstream

Thanks to the developers this is built upon.

Cees Basa (cbassa)

George Sfoungaris (sfou)

Libre Space Foundation

Copyright

Unofficial project, not related to the Libre Space Foundation.

Upstream sources under their respective copyrights.

License

Data: CC By SA 4.0 International.

Source Code: AGPLv3+.

Copyright © 2023, Jeff Moe.