Commit c79b75cd authored by Manuel Luis Alcazar Laynez's avatar Manuel Luis Alcazar Laynez
Browse files

Merge branch '4-convert-galassify-to-a-standalone-module' into clickable-image

parents 66c2f759 da2020ab
Loading
Loading
Loading
Loading
+41 −13
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@

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

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

@@ -39,26 +39,47 @@ Should work with `python >= 3.9`. Feel free to try for lower versions.

## Installation

### Creating a virtual environment
Using a virtual enviroment is recommended to execute this tool:

```bash
cd DIR_GALAssify
python -m venv .env
source .env/bin/activate
```
Now, you can choose installing `GALAssify` by using [PIP](#installing-from-pip) or by cloning this repository for [installing from source](#installing-from-source).

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

- For install with [pyds9](https://github.com/ericmandel/pyds9) support:
```
$ pip install "galassify[ds9] @ git+https://gloton.ugr.es/gitlab/lss/galassify.git"
```

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

Using a virtual enviroment is recommended to execute this tool:
### Installing from source

First, clone the repository:
```bash
cd DIR_GALAssify
python -m venv .env
source .env/bin/activate
git clone https://gloton.ugr.es/gitlab/lss/galassify.git
cd galassify
```

Install requirements:
Then, install `GALAssify` with [pyds9](https://github.com/ericmandel/pyds9) support:
```bash
pip install .[ds9]
```
or without it:
```bash
pip install -r requirements.txt
pip install .
```

 **NOTE:** The installation could fail with the next message if the package `libxt-dev` is not found in your OS:
### Installation troubleshooting
The installation could fail with the next message if the package `libxt-dev` is not found in your OS:
```bash
xtloop.c:9:10: fatal error: X11/Intrinsic.h: No such file or directory
    9 | #include <X11/Intrinsic.h>
@@ -70,23 +91,23 @@ To solve that, you can install it with the following commands:
- Debian / Ubuntu: `sudo apt-get install libxt-dev`
- Fedora: `sudo dnf install libXt-devel`

Then, run again: `pip install -r requirements.txt`
Then, try installing `GALAssify` again using you prefered method.

## 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/ 
galassify -i files/galaxies.csv -s files/output.csv -p img/ 
```

For the main tool check:
```python
python galassify.py --help
galassify --help
```

For helper tools check:
```python
python get_images_sdss.py --help
get_images_sdss --help
```

## Input data
@@ -99,6 +120,13 @@ Additional columns:
- 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.

Example: `galaxies.csv`
```csv
group,galaxy,ra,dec,filename
1,15,210.927048,-1.137346,img_1_15_.jpeg
1,254,211.020782,0.998166,img_1_254.jpeg
...
```

## Customizing the tool

pyproject.toml

0 → 100644
+91 −0
Original line number Diff line number Diff line
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "galassify"
version = "0.1.4"
authors = [
  { name="Manuel Alcázar-Laynez", email="manalclay@ugr.es"},
  { name="Andoni Jimenez", email="andonijimenez@ugr.es"},
  { name="Salvador Duarte Puertas", email="sduarte@ugr.es"},
  { name="Cristian Pozo González", email="cpozo@ugr.es"},
  { name="Jesús Domínguez-Gómez", email="jesusdg@ugr.es"},
  { name="Guillermo Blázquez", email="gblazquez@iaa.es"},
  { name="Maria del Carmen Argudo-Fernández", email="margudo@ugr.es"},
  { name="Simon Verley", email="simon@ugr.es"},
  { name="Daniel Espada", email="despada@ugr.es"},
  { name="Estrella Florido", email="estrella@ugr.es"},
  { name="Isabel Pérez", email="isa@ugr.es"},
  { name="Tomás Ruiz-Lara", email="tomasruizlara@gmail.com"},
  { name="Almudena Zurita", email="azurita@ugr.es"}
]
maintainers = [
  { name="Manuel Alcázar-Laynez", email="manalclay@ugr.es"},
  { name="Andoni Jimenez", email="andonijimenez@ugr.es"},
  { name="Salvador Duarte Puertas", email="sduarte@ugr.es"},
  { name="Cristian Pozo González", email="cpozo@ugr.es"},
  { name="Jesús Domínguez-Gómez", email="jesusdg@ugr.es"},
  { name="Guillermo Blázquez", email="gblazquez@iaa.es"},
  { name="Maria del Carmen Argudo-Fernández", email="margudo@ugr.es"},
  { name="Simon Verley", email="simon@ugr.es"}
]
description = "A tool to manually classify galaxies"
readme = {file = "README.md", content-type = "text/markdown"}
license = {file = "LICENSE"}
requires-python = ">=3.8"
keywords = ["astronomy", "astrophysics", "classification", "galaxies"]
classifiers = [
    "Programming Language :: Python :: 3",
    "License :: OSI Approved :: MIT License",
    "Operating System :: OS Independent",
    "Development Status :: 5 - Production/Stable",
    "Environment :: X11 Applications :: Qt",
    "Intended Audience :: Science/Research",
    "Topic :: Scientific/Engineering :: Astronomy",
    "Topic :: Scientific/Engineering :: Physics",
    "Topic :: Scientific/Engineering :: Visualization"
]
dependencies = [
  'pandas>=2.0',
  'PyQt5>=5.15',
  'matplotlib>=3.7',
  'astropy>=5.3',
  'requests>=2.31',
  'Pillow>=9.5'
]

[project.optional-dependencies]
ds9 = ['pyds9>=1.8.1']

[tools.setuptools]
include_package_data = true

[tool.setuptools.package-dir]
galassify = "src/galassify"
get_images_sdss = 'src/get_images_sdss'

[tool.setuptools.packages.find]
where = ["src"]
include = ["galassify*", "get_images_sdss*"]

[tool.setuptools.package-data]
galassify = [
  "img/*.jpeg",
  "img/fits/*.fits",
  "img/nog/*.jpeg",
  "files/*.csv",
  "res/*.png",
  "*.ui",
  "config"
]

[project.gui-scripts]
galassify = "galassify.galassify:main"

[project.scripts]
get_images_sdss = "get_images_sdss.get_images_sdss:main"

[project.urls]
Homepage = "https://gitlab.com/astrogal/GALAssify"
Issues = "https://gitlab.com/astrogal/GALAssify/-/issues"
 No newline at end of file

requirements.txt

deleted100644 → 0
+0 −7
Original line number Diff line number Diff line
pandas==2.0.1
PyQt5==5.15.9
matplotlib==3.7.1
astropy==5.3
requests==2.31.0
Pillow==9.5.0
pyds9==1.8.1
+0 −0

File moved.

+0 −0

File moved.

Loading