Skip to main content

Astronomical Data Science and Machine Learning Toolkit

Project description

spacekit

Powered by Astropy GitHub repo size GitHub license CodeFactor

Astronomical Data Science and Machine Learning Toolkit

ML Dashboard

Setup

Install with pip

# install full deps for using analysis / data viz / non-pipeline tools
$ pip install spacekit[x]

# for minimal STScI pipeline operations (skopes module) install:
$ pip install spacekit

Install from source

$ git clone https://github.com/spacetelescope/spacekit
$ cd spacekit
$ pip install -e .[x]

Testing

See tox.ini for a list of test suite markers.

# run all tests
$ pytest

# some tests, like the `scan` module rely on the test `env` option 
$ pytest --env svm -m scan
$ pytest --env cal -m scan

Pre-Trained Neural Nets

JWST Calibration Pipeline Resource Prediction (JWST)

JWST CAL Docs

  • Inference spacekit.skopes.jwst.cal.predict

Single Visit Mosaic Alignment (HST)

SVM Docs

  • Preprocessing: spacekit.skopes.hst.svm.prep
  • Predict Image Alignments: spacekit.skopes.hst.svm.predict
  • Train Ensemble Classifier: spacekit.skopes.hst.svm.train
  • Generate synthetic misalignments†: spacekit.skopes.hst.svm.corrupt

† requires Drizzlepac

HST Calibration Pipeline Resource Prediction (HST)

HST CAL Docs

  • Training spacekit.skopes.hst.cal.train
  • Inference spacekit.skopes.hst.cal.predict

Exoplanet Detection with time-series photometry (K2, TESS)

K2 Docs

  • spacekit.skopes.kepler.light_curves

Customizable Model Building Classes

Build, train and experiment with multiple model iterations using the builder.architect.Builder classes

Example: Build and train an MLP and 3D CNN ensemble network

  • continuous/encoded data for the multi-layer perceptron
  • 3 RGB image "frames" per image input for the CNN
  • Stack mixed inputs and use the outputs of MLP and CNN as inputs for the final ensemble model
ens = BuilderEnsemble(XTR, YTR, XTS, YTS, name="svm_ensemble")
ens.build()
ens.batch_fit()

# Save Training Metrics
outputs = f"data/{date_timestamp}"
com = ComputeBinary(builder=ens, res_path=f"{outputs}/results/test")
com.calculate_results()

Load and plot metrics to evaluate and compare model performance

Analyze and compare results across iterations from metrics saved using analyze.compute.Computer class objects. Almost all plots are made using plotly and are dynamic/interactive.

# Load data and metrics
from spacekit.analyzer.scan import MegaScanner
res = MegaScanner(perimeter="data/2022-*-*-*")
res._scan_results()

ROC

Eval

Preprocessing and Analysis Tools for Space Telescope Instrument Data

box

from spacekit.analyzer.explore import HstCalPlots
res.load_dataframe()
hst = HstCalPlots(res.df, group="instr")
hst.scatter

scatter

spacekit
└── spacekit
    └── analyzer
        └── compute.py
        └── explore.py
        └── scan.py
        └── track.py
    └── builder
        └── architect.py
        └── blueprints.py
    └── dashboard
    └── datasets
    └── extractor
        └── load.py
        └── radio.py
        └── scrape.py
    └── generator
        └── augment.py
        └── draw.py
    └── preprocessor
        └── encode.py
        └── scrub.py
        └── transform.py
    └── skopes
        └── hst
            └── cal
            └── svm
                └── corrupt.py
                └── predict.py
                └── prep.py
                └── train.py
        └── kepler
        └── trained_networks
└── setup.py
└── tests
└── docker
└── LICENSE
└── README.md
                       
           /\    _       _                           _                      *  
/\_/\_____/  \__| |_____| |_________________________| |___________________*___
[===]    / /\ \ | |  _  |  _  | _  \/ __/ -__|  \| \_  _/ _  \ \_/ | * _/| | |
 \./    /_/  \_\|_|  ___|_| |_|__/\_\ \ \____|_|\__| \__/__/\_\___/|_|\_\|_|_|
                  | /             |___/        
                  |/   

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spacekit-1.0.0.tar.gz (20.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spacekit-1.0.0-py3-none-any.whl (20.3 MB view details)

Uploaded Python 3

File details

Details for the file spacekit-1.0.0.tar.gz.

File metadata

  • Download URL: spacekit-1.0.0.tar.gz
  • Upload date:
  • Size: 20.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/6.0.0 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6

File hashes

Hashes for spacekit-1.0.0.tar.gz
Algorithm Hash digest
SHA256 95f5947f2d2a66366f855986dc5edfd31f7238bb1591676c9fc4cf8f0ce3afd9
MD5 90cb2560728379f92f4ebd117a66da86
BLAKE2b-256 92804c5216ee485c971026e10d721598f806e430efcef2b0e4641893b9b7c8fd

See more details on using hashes here.

File details

Details for the file spacekit-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: spacekit-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 20.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/6.0.0 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6

File hashes

Hashes for spacekit-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f63c9941adcd2aa9b1af337a0d5fbb26217c46b8aa28e4c3b54046e8a4b6fcee
MD5 9ba5ae4530fa30c3d6c606b27e9d9fa6
BLAKE2b-256 80d197b505f95086d95ddf1775c4d87dd7811e0a02a886023153a5530cb4f606

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page