MapLine 1.0.7__tar.gz → 1.0.9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,215 @@
1
+ Metadata-Version: 2.4
2
+ Name: MapLine
3
+ Version: 1.0.9
4
+ Summary: A Python implementation of the 3D emission line fitting code
5
+ Home-page: https://github.com/hjibarram/Map_line
6
+ Download-URL: https://github.com/hjibarram/Map_line/archive/refs/tags/v1.0.9.tar.gz
7
+ Author: hjibarram
8
+ Author-email: hjibarram@gmail.com
9
+ License: MIT
10
+ Keywords: galaxies
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Topic :: Scientific/Engineering :: Astronomy
15
+ Description-Content-Type: text/markdown
16
+ Requires-Dist: astropy
17
+ Requires-Dist: matplotlib
18
+ Requires-Dist: numpy
19
+ Requires-Dist: scipy
20
+ Requires-Dist: cloup
21
+ Requires-Dist: click
22
+ Requires-Dist: emcee
23
+ Requires-Dist: tqdm
24
+ Dynamic: author
25
+ Dynamic: author-email
26
+ Dynamic: classifier
27
+ Dynamic: description
28
+ Dynamic: description-content-type
29
+ Dynamic: download-url
30
+ Dynamic: home-page
31
+ Dynamic: keywords
32
+ Dynamic: license
33
+ Dynamic: requires-dist
34
+ Dynamic: summary
35
+
36
+ # MapLine 1.0.9
37
+
38
+ ## Description
39
+
40
+ **MapLine** is an emission line fitting software optimized for active galactic nuclei (AGN) spectra, whether one-dimensional or obtained through integral field spectroscopy (IFS). Its main purpose is to characterize the broad and narrow components of various emission lines in the optical range. It allows modifying aspects such as the number of components to fit, the lines to consider, the flux profile (Gaussian, double Gaussian, Lorentzian, skew), the spectral fitting range, the input/output file type, continuum extraction, among others. The software is written in Python and has a modular structure, making it easy to customize and adapt to different analysis needs.
41
+
42
+ ## Installation
43
+
44
+ First, verify the Python version installed on your system. MapLine requires Python 3.12.3 or higher.
45
+
46
+ It is recommended to create a virtual environment for installing MapLine and the necessary dependencies. This allows better control of the environment and avoids conflicts with other installed packages. You can create a virtual environment with the following commands:
47
+
48
+ ```bash
49
+ # Create a folder for virtual environments
50
+ mkdir .venvs
51
+
52
+ # Create a virtual environment named 'MyEnv'
53
+ python -m venv .venvs/MyEnv
54
+
55
+ # Activate the virtual environment
56
+ source .venvs/MyEnv/bin/activate
57
+ ```
58
+
59
+ Once the virtual environment is activated, you can install MapLine with the following command:
60
+
61
+ ```bash
62
+ pip install mapline
63
+ ```
64
+
65
+ During the installation, all necessary dependencies will be installed.
66
+
67
+ ## Project Structure
68
+
69
+ MapLine is composed of different modules that contain the functions needed for emission line fitting:
70
+
71
+ - **line_fit.py**: Main module that contains the fitting functions for one-dimensional spectra (`line_fit_single`) and data cubes (`line_fit`).
72
+ - **mcmc.py**: Implements the Monte Carlo – Markov Chain (MCMC) algorithm to optimize emission line fitting using the `emcee` package.
73
+ - **models.py**: Contains the emission line models used in the fitting, such as `emission_line_model` and `line_model`.
74
+ - **priors.py**: Provides statistical functions to estimate the likelihood and initial parameter values for fitting.
75
+ - **tools.py**: Includes additional tools such as reading `.fits` files and handling configuration files.
76
+
77
+ ## Usage
78
+
79
+ MapLine is run from the command line using the `run_mapline` command. The basic execution structure is as follows:
80
+
81
+ ```bash
82
+ run_mapline [options]
83
+ ```
84
+
85
+ Some available commands are:
86
+
87
+ - `run`: Runs MapLine to fit emission lines.
88
+ - `runoned`: Gets the spectrum model.
89
+
90
+ ### Options
91
+
92
+ | Option | Description |
93
+ |-------------------|----------------------------------------------|
94
+ | `-g, --config_file` | Configuration file name. |
95
+ | `-n, --name` | Data cube name. |
96
+ | `-o, --name_out` | Output file name. |
97
+ | `-m, --mask` | Mask file name. |
98
+ | `-p, --path` | Path to the data cube. |
99
+ | `-y, --path_out` | Path to the output files. |
100
+ | `-c, --ncpus` | Number of CPUs to use. |
101
+ | `-d, --double` | Enable double Gaussian mode. |
102
+ | `-k, --kskew` | Enable skew line mode. |
103
+ | `-t, --test` | Test mode. |
104
+ | `-e, --error` | Calculate error vector. |
105
+ | `-z, --zt` | Object redshift. |
106
+
107
+ For example, to run MapLine using a configuration file named `config.yml`, using 6 CPUs, the double Gaussian model, and a line configuration file named `line_prop.yml`, the command would be:
108
+
109
+ ```bash
110
+ run_mapline -g config.yml -c 6 -d -q line_prop.yml
111
+ ```
112
+
113
+ All these options, along with additional ones, can also be specified in the configuration file.
114
+
115
+ ## Configuration Files
116
+
117
+ MapLine allows defining several parameters through configuration files, such as `config.yml` and `line_prop.yml`. These files allow full customization of the settings and options of the program to meet the user's specific needs.
118
+
119
+ ## Contributions
120
+
121
+ Contributions to MapLine are welcome. You can submit your suggestions, bug reports, or improvements through the official GitHub repository.
122
+
123
+ ## License
124
+
125
+ MapLine is distributed under the MIT license. You are free to use, modify, and distribute it, as long as proper attribution is maintained.
126
+
127
+ ## Español
128
+ ## Descripción
129
+
130
+ **MapLine** es un software de ajuste de líneas de emisión optimizado para espectros de núcleos activos de galaxias (AGN), ya sean unidimensionales o obtenidos por espectroscopía de campo integral (IFS). Su principal propósito es caracterizar los componentes anchos y angostos de varias líneas de emisión en el rango óptico. Permite modificar aspectos como el número de componentes a ajustar, las líneas a considerar, el perfil de flujo (gaussiano, doble gaussiano, lorentziano, skew), el rango espectral de ajuste, el tipo de archivo de entrada/salida, la extracción del continuo, entre otros. El software está escrito en Python y tiene una estructura modular, lo cual facilita su personalización y adaptación a diferentes necesidades de análisis.
131
+
132
+ ## Instalación
133
+
134
+ Primero, verifica la versión de Python instalada en tu equipo. MapLine requiere Python 3.12.3 o superior.
135
+
136
+ Es recomendable crear un entorno virtual para la instalación de MapLine y las dependencias necesarias. Esto permite un mejor control del entorno y evita conflictos con otros paquetes instalados. Puedes crear un entorno virtual con los siguientes comandos:
137
+
138
+ ```bash
139
+ # Crear una carpeta para entornos virtuales
140
+ mkdir .venvs
141
+
142
+ # Crear un entorno virtual llamado 'MyEnv'
143
+ python -m venv .venvs/MyEnv
144
+
145
+ # Activar el entorno virtual
146
+ source .venvs/MyEnv/bin/activate
147
+ ```
148
+
149
+ Una vez activado el entorno virtual, puedes instalar MapLine con el siguiente comando:
150
+
151
+ ```bash
152
+ pip install mapline
153
+ ```
154
+
155
+ Durante la instalación se instalarán todas las dependencias necesarias.
156
+
157
+ ## Estructura del Proyecto
158
+
159
+ MapLine está compuesto por distintos módulos que contienen las funciones necesarias para los ajustes de líneas de emisión:
160
+
161
+ - **line_fit.py**: Módulo principal que contiene las funciones de ajuste para espectros en una dimensión (`line_fit_single`) y para cubos de datos (`line_fit`).
162
+ - **mcmc.py**: Implementa el algoritmo Monte Carlo – Markov Chain (MCMC) para optimizar los ajustes de líneas de emisión usando la paquetería `emcee`.
163
+ - **models.py**: Contiene los modelos de líneas de emisión utilizados en los ajustes, como `emission_line_model` y `line_model`.
164
+ - **priors.py**: Proporciona funciones estadísticas para estimar la confiabilidad (likelihood) y los valores iniciales de los parámetros de ajuste.
165
+ - **tools.py**: Incluye herramientas adicionales como la lectura de archivos en formato `.fits` y manejo de archivos de configuración.
166
+
167
+ ## Uso
168
+
169
+ MapLine se ejecuta desde la línea de comandos utilizando la instrucción `run_mapline`. La estructura básica de ejecución es la siguiente:
170
+
171
+ ```bash
172
+ run_mapline [opciones]
173
+ ```
174
+
175
+ Algunos de los comandos disponibles son:
176
+
177
+ - `run`: Ejecuta MapLine para ajustar líneas de emisión.
178
+ - `runoned`: Obtiene el modelo del espectro.
179
+
180
+ ### Opciones
181
+
182
+ | Opción | Descripción |
183
+ |------------------|----------------------------------------------|
184
+ | `-g, --config_file` | Nombre del archivo de configuración. |
185
+ | `-n, --name` | Nombre del cubo de datos. |
186
+ | `-o, --name_out` | Nombre de los archivos de salida. |
187
+ | `-m, --mask` | Nombre del archivo de 'máscara'. |
188
+ | `-p, --path` | Ruta al cubo de datos. |
189
+ | `-y, --path_out` | Ruta de los archivos de salida. |
190
+ | `-c, --ncpus` | Número de CPUs a utilizar. |
191
+ | `-d, --double` | Activar el modo de doble gaussiana. |
192
+ | `-k, --kskew` | Activar el modo skew line. |
193
+ | `-t, --test` | Modo de prueba. |
194
+ | `-e, --error` | Calcular el vector de errores. |
195
+ | `-z, --zt` | Redshift del objeto. |
196
+
197
+ Por ejemplo, para ejecutar MapLine usando un archivo de configuración llamado `config.yml`, utilizando 6 CPUs, el modelo de doble gaussiana, y un archivo de configuración de líneas de emisión llamado `line_prop.yml`, el comando sería:
198
+
199
+ ```bash
200
+ run_mapline -g config.yml -c 6 -d -q line_prop.yml
201
+ ```
202
+
203
+ Todas estas opciones, junto con otras adicionales, también pueden ser especificadas en el archivo de configuración.
204
+
205
+ ## Archivos de Configuración
206
+
207
+ MapLine permite definir varios parámetros a través de archivos de configuración, como `config.yml` y `line_prop.yml`. Estos archivos permiten personalizar completamente los ajustes y opciones del programa para adaptarse a las necesidades específicas del usuario.
208
+
209
+ ## Contribuciones
210
+
211
+ Las contribuciones a MapLine son bienvenidas. Puedes enviar tus sugerencias, errores encontrados, o mejoras a través del repositorio oficial en GitHub.
212
+
213
+ ## Licencia
214
+
215
+ MapLine está distribuido bajo la licencia MIT. Puedes usarlo, modificarlo y distribuirlo libremente siempre y cuando se mantenga la atribución correspondiente.
@@ -3,5 +3,5 @@ import numpy as np
3
3
  globally across the MapLine modules
4
4
  """
5
5
 
6
- __version__ = 'MapLine v1.0.7'
6
+ __version__ = 'MapLine v1.0.9'
7
7