Skip to main content

Matching gaia clustered stars to known clusters

Project description

GaiaClusterFit

GaiaClusterFit is a Python library for dealing cluster

Installation

Use the package manager pip to install foobar.

pip install GaiaClusterFit

Usage

Import library

from  GaiaClusterFit import GCA

Specify Gaia query

#GAIA database query

query ="""SELECT TOP 1000  source_id, b, l, parallax,phot_g_mean_mag,pmra,pmdec, RUWE, bp_rp,phot_g_mean_mag+5*log10(parallax)-10 as mg

FROM gaiadr3.gaia_source

WHERE l < 275 AND l > 240 

AND b < 5 AND b > -15

AND phot_g_mean_mag < 18

AND RUWE < 1.4

AND parallax < 4 AND parallax > 1.8

AND parallax_error/parallax < 0.02""" 

Create an instance and import data

#Create instance

job = GCA.GCAinstance(RegionName = "Char")



#Login and fetch GAIA Data

job.GaiaLogin(username='username', password='password')

job.FetchQueryAsync(query)



#Import known cluster

job.ImportRegion("G:/path/known_cluster.fits")

Setting up basic cluster fit function to clustered GAIA data to known clusters

#Parameters to optimize Cluster function over (HDBscan by default)

parameters = [{"variable": "min_cluster_size", "min":10, "max":100}]

Renaming cluster table columns to match GAIA column names

job.RenameCol(job.regiondata, [["Source", "source_id"],["Pop", "population"]])

Optimizing cluster function(HDBscan) over GAIA data to match known clusters

optimal = job.optimize_grid(fit_params=parameters, scoring_function)

Scoring function returns a score for the fit based by default on homogeneity self-made score functions can be passed and recieve an astropy gaia table and an astropy region table. optimize_grid returns parameters for the highest score

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

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

GaiaClusterFit-0.0.6.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

GaiaClusterFit-0.0.6-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file GaiaClusterFit-0.0.6.tar.gz.

File metadata

  • Download URL: GaiaClusterFit-0.0.6.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.7

File hashes

Hashes for GaiaClusterFit-0.0.6.tar.gz
Algorithm Hash digest
SHA256 888df0c9970554d714e77fa0a8d7ee00b2a8bbf3aa8d167263b5f61555e4b32c
MD5 6c8480bab48ba4b5e1c39503c30ad74a
BLAKE2b-256 52dafb3d1a985910a1566e3f302d860f3cf1e77abb86b97746c2f87d67604a06

See more details on using hashes here.

File details

Details for the file GaiaClusterFit-0.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for GaiaClusterFit-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 a7de2f21f3a55db0f28792a0b980d428293ed35546e4554995b72104eb05cc28
MD5 cb5013c15a927bacc0abd4bbd1ea7ca6
BLAKE2b-256 5d2a7872edee31ffec6bc730a11f4098fd1fd95d3c8c655e5ed96393281181f0

See more details on using hashes here.

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