Giter Site home page Giter Site logo

tess-asteroid-ml's Introduction

TESS Asteroid cutouts for ML

A library to create ML-ready data from TESScut with asteroids

This package has an object class and scripts to create cutouts from TESS full frame images and query JPL Horizon to find observed asteroids in the FFI images. The resulting data contaiins the flux cube, asteroid mask in the same shape as the flux cube, and other related vectors (time, CBV, quaternions, etc) that are formated to be used by ML detection models.

Installation

Clone this repo and then install it with pip

clone https://github.com/jorgemarpa/tess-asteroid-ml.git

cd tess-asteroid-ml
pip install .

Example use

To create the ML ready training data use the make_TESScut_asteroids.py script with the desired arguments (see below). This will do the following:

  1. First access the asked TESS Sector/Camera/CCD image from MAST/AWS.
  2. Given a grid pattern (sparse or dense) it uses AstroCut to make cutouts from the FFI and save them to disk. Be carefull to run the script with the argument --download only the first time for a Sector/Camera/CCD because it will query Astrocut to make and download the files. Fowllowing runs must be withouth the flag to use local data.
  3. Uses the asteroid catalog to get the first guess of available asteroids in the FFI.
  4. Iterates over the available cutouts and available asteroids to make the mask arrays and access other vectors (CBV, quaternions, time, etc).
  5. It saves the training data as npz files.

When runing the script the first time for a Sector/Camera/CCD use:

python make_TESScut_asteroids.py --sector 4 --camera 3 --ccd 2 --sampling sparse --cutout-size 64 --lim-mag 22 --verbose --plot --download

for subsecutive runs and skip Astrocut requests use:

python make_TESScut_asteroids.py --sector 4 --camera 3 --ccd 2 --sampling sparse --cutout-size 64 --lim-mag 22 --verbose --plot

The script has several arguments and flags. Below is the full list:

usage: make_TESScut_asteroids.py [-h] [--sector SECTOR] [--camera CAMERA] [--ccd CCD] [--cutout-size CUTOUT_SIZE] [--lim-mag LIM_MAG] [--sampling SAMPLING] [--fit-bkg] [--plot]
                                 [--verbose] [--download]

Creates a dataset from TESS FFIs. Makes 64x64 pixel cuts, uses JPL to create a asteroid mask.

optional arguments:
  -h, --help      show this help message and exit
  --sector        TESS sector number.
  --camera        TESS camera number.
  --ccd           TESS CCD number
  --cutout-size   Cutout size in pixels
  --lim-mag       Limiting magnitude in V band.
  --sampling      Select a `dense` grid that covers corner to   corner of the FFI or a `sparse` that uses only 7 rows from the grid.
  --fit-bkg       Fit and substract background (flag).
  --plot          Plot FFI (flag).
  --verbose       Verbose (flag).
  --download      Donwload cutouts from from AWS wh Astrocut (flag).

tess-asteroid-ml's People

Contributors

jorgemarpa avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.