This repository contains a set of Python scripts detailing a model for classifying galaxies as either kinematically disturbed, or disk-like and orderly rotating objects. The primary goal is that such a model can be used, or built upon, in order to maximise the number of irregular objects flagged by SKA in the future to ascertain cosmological truths (such as the merger rate of the universe at a given redshift) and aid current surveys involving kinematic modelling by returning fast predictions of galaxy properties.
Using the pre-trained convolutional autoencoder, users can quickly output the latent (CAE) positions of galaxies and recover the following information:
-
The circularity- defined as the amount of kinetic enrgy invested in flat circular rotation of a galaxy and thus the degree of kinematic disorder.
-
The galaxy position angle with an uncertainty of ~20 degrees (depending on the inclination).
The CAE has been created and trained using the PyTorch platform. In order to use the model, the user will be required to have PyTorch installed but the use of GPU capabilities is not a requirement.
Other dependencies:
Additional optional dependencies:
To install the dependencies simply run the following command from inside the repo folder destination:
$pip install -e .
To use the model, one should run python -m spacemerlin.scripts.run
and can specify the following parameters:
-
--modelpath
(-m
): Should contain a string pointing to a file including the checkpoint to load. Per default this will point to the checkpoint we provide. -
--datapath
(-d
): Should contain a string pointing to a directory including the files to predict. Per default this will point to the exemplaric FITS files included in this package. -
--pcapath
(-p
): Should contain a string pointing to a file including the saved PCA (as pickle). Per default this will point to the provided PCA. -
--boundary
(-b
): Should contain a float specifying the upper boundary for valid latent x values. Defaults to the value of2.960960960960961
-
--savepath
(-s
): Should contain a string pointing to a (already existant) directory, where the dataframe should be saved. Defaults to the value ofNone
, which results in no filedumping but only a returned dataframe.
The example script also outputs a pandas DataFrame to a .pkl file should the user wish to save their results.
The default output of run.py is a pandas DataFrame with all 3 latent positions of all input velocity maps as well as a prediction of the galaxies' circularity values. The DataFrame is pickled as "CAE_results.pkl" and provided within the repository.
L1 L2 L3 Circularity
Name
NGC1380 -4.2929926 -14.941876 12.846045 1.0
ESO359-G002 7.7088847 -9.553634 10.178327 0.0
NGC1436 10.838033 -7.580992 5.949612 1.0
NGC1387 2.8304605 -22.606302 -0.7115479 1.0
NGC1194 11.064097 -6.6387653 3.4034176 1.0
NGC0404 10.964644 -8.554581 8.61254 0.0
-
The Kinematics_Tester_Files folder contains example scripts for using the CAE model.
-
The Test_FITS_files folder has a selection of 30 ALMA velocity maps that can be used with the model for testing purposes. For more information on the galaxies used please read the corresponding journal papers Zabel et al. 2019 and WISDOM project.