API Reference
AstroGlue
- class AstroGlue.AstroGlue.AstroGlue
AstroGlue acts as a bridge between AstroLink clustering algorithm and GlueViz data visualization package.
It enables user to input either a .NPY file or a .CSV file containing galaxy data and has multiple features like Positions, Velocity, Abundances, etc. Once a file is imported, user can enter column names, choose the columns and the type of plot they wish to analyse on GlueViz. The user may also choose to run AstroLink and can select various subsets of the dataset for AstroLink to run on (feature spaces).
These inputs can be provided in two ways: a) Using the tkinter GUI: If the values of the variables are not input using the set_variables() method, a tkinter window is launched prompting the user to input all the variables required to run AstroLink and plot on GlueViz
b) Using set_variables() method: If the user already has the variables in python stirngs/lists, then set_variables() method can be used to input the variables into the AstroGlue class without having to use the GUI.
Once these inputs are provided, a GlueViz application window automatically launches with the various necessary plots. Using GlueViz, users can perform various kinds of analyses on the data, like - selecting certain clusters on the ordered-density plot of a particular feature space and visualize those clusters in other plots, i.e, all the plots are linked.
Parameters
Note that all parameters of AstroGlue are optional. If passed and set using set_variables() method, the user would not see the tkinter GUI. If not passed, then the user will be prompted to input the parameters through the GUI.
- file_path‘str’
The absolute path to the .NPY or .CSV file containing galaxy data. Replace all single backslashes with double backslashes.
- data_df‘pandas dataframe’
The data from the input .NPY or .CSV file converted to a pandas dataframe object with the column names specified.
- type_l‘list’
A list of the names of the type of plot that can be used in GlueViz. Currently the following plot types are supported: -> 1D Histogram -> 2D Scatter Plot (rectilinear) -> 2D Scatter Plot (aitoff) -> 3D Scatter Plot
- var_plot_list‘list’
A list of lists containing the column names to be plotted in GlueViz, corresponding to type_l. Each inner list must contain between 1 and 3 column names. This means that for each plot specified by type_l, a minimum of 1 column name and a maximum of 3 column names can be plotted.
- feature_space_name‘list’
A list of the names provided to a feature space over which Astrolink clustering algorithm would run and produce ordered density plots.
- feature_spaces‘list’
A list of lists containing the column names to be included in the feature space corresponding to ‘feature_space_name’. Any number of column names can be included in a single feature space over which AstroLink clustering algorithm would run and produce ordered-density plots.
- adaptive_list‘list’
A list containing the adaptive parameter setting for feature space corresponding to ‘feature_space_name’.
- k_den_list‘list’
A list containing the number of nearest neighbours parameter setting for feature space corresponding to ‘feature_space_name’.
- S_list‘list’
A list containing the sensitivity threshold parameter setting for feature space corresponding to ‘feature_space_name’.
- k_link_list‘list’
A list containing the number of nearest neighbours used to aggregate points parameter setting for feature space corresponding to ‘feature_space_name’
- h_style_list‘list’
A list containing the behaviour of the cluster hierarchy parameter setting for feature space corresponding to ‘feature_space_name’
- workers_list‘list’
A list containing the number of processors used in parallelised computations parameter setting for feature space corresponding to ‘feature_space_name’
- verbose_list‘list’
A list containing the verbosity parameter setting for feature space corresponding to ‘feature_space_name’.
- make_ordered_density_plots(ax, c)
Makes the ordered density plots for the various feature spaces.
- plot_1d_histogram(x)
To plot 1D Histogram
- plot_2d_scatter_aitoff(x, y)
To plot 2D Aitoff Scatter Plot
- plot_2d_scatter_rectilinear(x, y)
To plot 2D Rectilinear Scatter Plot
- plot_3d_scatter(x, y, z)
To plot 3D Scatter Plot
- run()
Runs AstroGlue. If inputs are provided usign set_variables() method, it directly opens Glueviz. If inputs are not provided then it launches the tkinter GUI window prompting user to input all the required fields.
- set_variables(file_path, data_df, feature_spaces, adaptive_list, k_den_list, S_list, k_link_list, h_style_list, workers_list, verbose_list, feature_space_name, var_plot_list, type_l)
This method of the AstroGlue can be used to set values to the variables used without having to input through the GUI.