Skip to main content

Clusters objects found in astronomical images by their visual similarity

Project description

README for / graph_clustering

Update history

September 2019: - HSC DR1 UDEEP catalogue added

Near future: - Add DR2 DEEP/UDEEP catalogues with varying k - Add code to run the algorithm w/ examples and documentation

Reference: Martin 2019b



Clusters objects found in a list of astronomical images by their visual similarity. Objects are sorted into k groups and a catalogue containing object centroids, group number, size in pixels and silhouette score is output.


  • numpy
  • scipy
  • astropy
  • configobj
  • sklearn
  • joblib
  • matplotlib
  • dotnetcore SDK

Installation on Python 2.7 (3 not tested):

pip install graph_clustering

or build from source

python install graph_clustering


Using the built-in script:

usage: [-h] [-bd BASE_DIR] [-dd DATA_DIR] [-im IMG_NAMES]
                   [-il IMG_LIST] [-ib BOUNDS] [-wl BANDS] [-oi OUT_ID]
                   [-pd PATCH_DIR] [-ps PATCH_SIZE] [-nn N_NODES]
                   [-ct HC_TARGET] [-nt N_THREADS] [-ns N_SAMPLES]
                   [-ni N_ITERATIONS] [-mt METRIC] [-pe] [-pl] [-ng] [-hc]
                   [-cc] [-gt]

optional arguments:
  -h, --help            show this help message and exit
  -bd BASE_DIR, --base_dir BASE_DIR
                        Base directory
  -dd DATA_DIR, --data_dir DATA_DIR
                        Data directory
  -im IMG_NAMES, --img_names IMG_NAMES
                        Image filenames
  -il IMG_LIST, --img_list IMG_LIST
                        File containing list of image filenames
  -ib BOUNDS, --bounds BOUNDS
                        Image bounds
  -wl BANDS, --bands BANDS
                        Image bands
  -oi OUT_ID, --out_id OUT_ID
                        Output id for the model
  -pd PATCH_DIR, --patch_dir PATCH_DIR
                        Patch sub-directory
  -ps PATCH_SIZE, --patch_size PATCH_SIZE
                        Patch radius in pixels
  -nn N_NODES, --n_nodes N_NODES
                        Number of nodes in the GNG graph
  -ct HC_TARGET, --HC_target HC_TARGET
                        Target clusters of HC clustering
  -nt N_THREADS, --n_threads N_THREADS
                        Number of CPU threads
  -ns N_SAMPLES, --n_samples N_SAMPLES
                        Number of samples to process before adding a new node
  -ni N_ITERATIONS, --n_iterations N_ITERATIONS
                        Total number of GNG iterations
  -mt METRIC, --metric METRIC

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

graph_clustering-0.2.tar.gz (11.8 kB view hashes)

Uploaded Source

Built Distribution

graph_clustering-0.2-py2.py3-none-any.whl (12.5 kB view hashes)

Uploaded Python 2 Python 3

Supported by

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