GithubHelp home page GithubHelp logo

moeyensj / difi Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 3.0 7.35 MB

Did I Find It?

License: BSD 3-Clause "New" or "Revised" License

Python 99.69% Dockerfile 0.31%
small-body asteroids linkage solar-system minor-planets python docker

difi's Introduction

difi

Did I Find It?

Python 3.8+ License DOI
docker - Build, Lint, and Test conda - Build, Lint, and Test pip - Build, Lint, Test, and Coverage
pre-commit Coverage Status Docker Pulls
Anaconda-Server Badge Anaconda-Server Badge Anaconda-Server Badge

About

difi is a simple package that takes pre-formatted linkage information from software such as MOPS, pytrax, or THOR and analyzes which objects have been found given a set of known labels (or truths). A key performance criteria is that difi needs to be fast by avoiding Python for loops and instead uses clever pandas.DataFrame manipulation.

Installation

Released Versions

Anaconda

difi can be downloaded directly from anaconda:
conda install -c moeyensj difi

Or, if preferred, installed into its own environment via:
conda create -n difi_py310 -c moeyensj difi python=3.10

Pip

difi is also available from the Python package index:
pip install difi

Docker

A Docker container with the latest version of the code can be pulled using:
docker pull moeyensj/difi:latest

To run the container:
docker run -it moeyensj/difi:latest

The difi code is installed the /projects directory, and is by default also installed in the container's Python installation.

Latest From Source

Anaconda

Clone this repository using either ssh or https. Once cloned and downloaded, cd into the repository.

To install difi in its own conda environment please do the following:
conda create -n difi_py310 -c defaults -c conda-forge --file requirements.txt python=3.10

Or, to install difi in a pre-existing conda environment called difi_py310:
conda activate difi_py310
conda install -c defaults -c conda-forge --file requirements.txt

Pip

Or, to install difi software using pip:
pip install .

Or, if you would like to make an editable install then:
pip install -e .[tests]

You should now be able to start Python and import difi.

Docker Compose

After cloning this repository, you can build a docker image that will allow you to develop the source code:

docker compose build difi

To run the docker container interatively with a terminal:

docker compose run -it difi

Developing

If you would like to contribute to difi, please make sure to initialize pre-commit. Pre-commit will automatically lint and format the source code after any changes have been staged for a commit. To load the appropriate hooks please run:

pre-commit install

Example and Tutorial

The example below can be found in greater detail in this Jupyter Notebook.

difi's People

Contributors

moeyensj avatar tomwagg avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

eggls6 tomwagg

difi's Issues

Make difi take into account 15 day detection window

difi's findability criterion currently doesn't require observations to occur within a 15 day window. We should make sure it does. (Made this with @mjuric)

E.g. currently difi would say that one of my objects that has 2 observations on each of nights 266, 287, 288 and 312 is findable but it isn't really because those don't fit in 15 days.

Add Docker

Add support for Docker containers, update README with appropriate installation instructions.

Make difi support being run via multiprocessing

difi currently will run a multiprocessing pool if the user wants to, however, if others want to use difi in a pipeline that itself is using multiple processes then the current shared_memory implementation will break.

Fix truth dtype mismatch

If the linkageMembers truth column has a different dtype than the observations truth column, pandas joins will not work as intended. This should be fixed by insuring all dtypes are the same and warning the user if not. A keyword can be added to convert the truth column to the "object" dtype.

Add population statistics

For use on minor planet linking it would be useful to have a set of user-defined object level population statistics.

  • How many NEOs are findable and were linked, etc...
  • How many KBOs...

Add config.py

difi should support a configuration file / class with defaults defining metric parameters and column mapping dictionaries.

Add "should I find it" code

Add analysis code for observations that given a set of algorithmic constrains (such as: the cadence between observations, maximum and minimum linkage ranges, etc) will calculate if known objects within that set of observations should be findable.

Add summary statistics

Add statistics on the number of objects found, the number of objects findable, the number of linkages that are contaminated, etc...

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.