Commit 163172a2 authored by Andoni Jimenez's avatar Andoni Jimenez
Browse files

Add documentation and correct requirements

parent af0d7135
Loading
Loading
Loading
Loading
+101 −13
Original line number Diff line number Diff line
GALAssify
==========
# GALAssify

A tool to manually classify galaxies.
**A tool to manually classify galaxies**

We also provide a help tools to:
<img src="instructions/GALAssify.png" alt="galassyfy_default" height="700px">

We also provide help tools to:
- Download images from SDSS.
- Create a instructions pdf.

The tool can be customized with the `config` file.
The main tool can be customized with the `config` file. See [Customizing the tool](#customizing-the-tool) for more information.

<!-- 
<!-- toc -->
<!--
- [Requirements](#requirements)
- [Installation](#installation)
- [Usage](#usage)
- [Customizing the tool](#customizing-the-tool)
  - [Tag groups](#tag-groups)
  - [Tag group elements](#tag-group-elements)
-->
<!-- /toc -->

Installing
----------
## Requirements

Install and update using [pip](https://pip.pypa.io/en/stable/getting-started/):
GALAssify is written in Python. The following requirements are mandatory:

```
$ pip install git+https://gloton.ugr.es/gitlab/lss/GALAssify.git
```
* Python `>=3.9`
* pandas
* pyqt5
* matplotlib
* Pillow
* astropy
* pyds9 (to open fits files directly form the tool)
* requests (used by the help tool to download sdss images)

Should work with `python >= 3.9`. Feel free to try for lower versions.

Usage
-----
## Installation

Install and update using [pip](https://pip.pypa.io/en/stable/getting-started/):

```
$ pip install git+https://gloton.ugr.es/gitlab/lss/galassify.git
```

Using a virtual enviroment is recommended to execute this tool:

@@ -30,9 +51,20 @@ Using a virtual enviroment is recommended to execute this tool:
cd DIR_GALAssify
python -m venv .env
source .env/bin/activate
```

Install requirements:
```bash
pip install -r requirements.txt
```

## Usage

To run the included example, execute the following command on the installation directory (with the activated enviroment):
```python
python galassify.py -i files/galaxies.csv -s files/output.csv -p img/ 
```

For the main tool check:
```python
python galassify.py --help
@@ -42,3 +74,59 @@ For helper tools check:
```python
python get_images_sdss.py --help
```

## Input data

Minimum required columns:
- galaxy: identifier or name of the galaxy

Additional columns:
- group: identifier or name of the group/person to which the galaxy was assigned. Used to filter the galaxies when executing the tool.
- filename: name of the image file to be displayed in the tool. Relative to the image path specified on execution.
- fits: name of the fits file to be displayed in the tool. Relative to the image path specified on execution.


## Customizing the tool

GALAssify tags can be customized to meet users needs. The default `config` file provides the configuration used to perform the galaxy sample selection in the [CAVITY](https://cavity.caha.es/) (Calar Alto Void Integral-field Treasury surveY) project.

### Tag groups

Tags are grouped depending on the needs, each of this groups correspond to one type. The available types are:

- radiobutton: group of elements were only one element can be selected
- checkbox: group of elements were each element can be checked independetly
- text: a textbox to add comments

### Tag group options

Each group type mentioned above has options that can (or must) be changed. 
Options marked as `optional` are not required but provide a better customization and user experience.

Common options for all group types:

- id: group identifier. Must be unique as it will be used on the output csv file.
- name (optional, default: id is used): Text to be used on the tool.
- type: Type to be used to initalize the group (one of the above).

Options that only apply for the `text` type group:
- shortcut (optional, default: None) :Key press to be used to focus on the comment-box. Must be unique, and not used in other groups/group-elements.
- save (unimplemented, [Enter] is used currently): Key press to be used to save the content, only used if focus is set on the group.
- discard (unimplemented, [Esc] is used currently): Key press to be used to discard the content, only used if focus is set on the group.

Options that only apply for the `radiobutton` type groups:
- add_clear (optional, default: false): Boolean indicating to add a clear button to the group. Not added by default.
- clear_shortcut (optional): Key press to be used to clear on the radiobutton group. Must be unique, and not used in other groups/group-elements.

Options that apply for the `radiobutton` and `checkbox` type groups:
- ncolumns (optional, default: 2): number of columns to be used to display the elements.
- elements: list on elements to be included.

### Tag element options

Each element has the following options:

- id: element identifier. Must be unique as it will be used on the output csv file.
- name (optional, default: id is used): Text to be used on the tool.
- shortcut (optional, default: None): Key press to be used to check on the element.
- description (optional, default: None): Short text to be displayed when the mouse is over the element.
 No newline at end of file
+2 −2
Original line number Diff line number Diff line
@@ -40,8 +40,8 @@ def getOptions(version):
                        help="List selected files only and exit.\n")
    parser.add_argument('-i', '--inputfile', default='galaxies.csv', type=dir_file,
                        help="""Galaxy database file in *.csv format.
                        Minimum required columns: ['galaxy', 'filename' or 'fits' ].
                        Recomended columns: ['group', 'galaxy', 'ra', 'dec',  'filename' or 'fits']""")
                        Minimum required columns: ['galaxy'].
                        Recomended columns: ['group', 'galaxy', 'ra', 'dec',  'filename' and/or 'fits']""")
    parser.add_argument('group', metavar='GROUP', nargs='*',
                        help="Group number. Selects images with name format: img_<group>_*.png\n")