diff --git a/docs/source/api.rst b/docs/source/api.rst index bd090e6..5860259 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -1,4 +1,4 @@ -NIRDust API Reference +API Reference ===================== .. automodule:: nirdust diff --git a/docs/source/conf.py b/docs/source/conf.py index 6849367..18b3d91 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -79,7 +79,7 @@ html_theme_options = { - "logotext1": "Nirdust", # white, semi-bold + "logotext1": "NIRDust", # white, semi-bold "logotext2": "", # orange, light "logotext3": ":docs", # white, light "astropy_project_menubar": False, diff --git a/docs/source/index.rst b/docs/source/index.rst index 703e300..11c7573 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -74,11 +74,11 @@ User Documentation ------------------ .. toctree:: - :maxdepth: 1 + :maxdepth: 2 installation + tutorials/index api - tutorials/NGC5128.ipynb licence diff --git a/docs/source/tutorials/NGC5128.ipynb b/docs/source/tutorials/NGC5128.ipynb index f2620e1..dacd4e8 100644 --- a/docs/source/tutorials/NGC5128.ipynb +++ b/docs/source/tutorials/NGC5128.ipynb @@ -4,7 +4,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Example of Nirdust application\n", + "## Example of NIRDust application\n", "The example imputs are two Flamingos-2 (Gemini South) $K_{long}$ band longslit spectra of NGC 5128 (Centaurus A) a Seyfert 2 galaxy.\n", "\n", "The spectra correspond to:\n", diff --git a/docs/source/tutorials/fit_blackbody.ipynb b/docs/source/tutorials/fit_blackbody.ipynb new file mode 100644 index 0000000..f894e39 --- /dev/null +++ b/docs/source/tutorials/fit_blackbody.ipynb @@ -0,0 +1,26 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Fitting a BlackBody model" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "work in progress..." + ] + } + ], + "metadata": { + "language_info": { + "name": "python" + }, + "orig_nbformat": 4 + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/docs/source/tutorials/index.rst b/docs/source/tutorials/index.rst new file mode 100644 index 0000000..45c7b74 --- /dev/null +++ b/docs/source/tutorials/index.rst @@ -0,0 +1,15 @@ +Tutorials +========= + +The following page contains a collection of tutorials and practical examples +on how to use NIRDust. From reading your spectra from a file, to modelling the +hot dust emission and visualizing the results. + + +.. toctree:: + :maxdepth: 2 + + reading_spectra.ipynb + preprocessing.ipynb + fit_blackbody.ipynb + NGC5128.ipynb \ No newline at end of file diff --git a/docs/source/tutorials/preprocessing.ipynb b/docs/source/tutorials/preprocessing.ipynb new file mode 100644 index 0000000..f6cfabf --- /dev/null +++ b/docs/source/tutorials/preprocessing.ipynb @@ -0,0 +1,43 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Preprocessing utilities" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "work in progress..." + ] + } + ], + "metadata": { + "interpreter": { + "hash": "dfefad9444caa34b651035342248c936eda24540a2756afa4fe280ef294fff37" + }, + "kernelspec": { + "display_name": "Python 3.8.10 64-bit ('nirdust': virtualenv)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.10" + }, + "orig_nbformat": 4 + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/docs/source/tutorials/reading_spectra.ipynb b/docs/source/tutorials/reading_spectra.ipynb new file mode 100644 index 0000000..bbb9773 --- /dev/null +++ b/docs/source/tutorials/reading_spectra.ipynb @@ -0,0 +1,119 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Reading Spectra" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "NIRDust provides easy and quick functionalities to read your spectra. If you have your data in FITS format or just a common text ASCII file, you can use one of the following functions. If you don't have your data in any of these formats, by the end of this tutorial you can see how to load your data to create a NirdustSpectrum object directly." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Reading from a FITS file" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Let's say you have your spectra in a FITS file. This format, in most cases, comes with a header and a science extension. The science extension stores the flux intesity of the spectrum and the respective pixel axis. The header has the information to transform the pixel axis into a spectral axis. The manual input of the redshift of the galaxy, which isn't included in most headers, is necesary to get the spectral axis in rest frame. The following code shows the easiest way to read a spectrum:" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "NirdustSpectrum(z=0.00183, spectral_length=1751, spectral_range=[18889.58-25106.71] Angstrom)" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import nirdust as nd\n", + "\n", + "nuclear_spectrum = nd.read_fits(\"nuclear_spectrum.fits\", z=0.00183)\n", + "\n", + "# Show some information\n", + "nuclear_spectrum" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "If your FITS file has multiple extensions, the automatic detection of the science extension may fail. In such cases, you can manually indicate the correct extension by passing the parameter ``extension=1`` to the function (if 1 is the correct number)." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Reading from an ASCII file" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The function ``read_table`` can be used to read directly from a text file and supports multiple formats. In this case the file should contain these two columns: wavelength [A] and flux [arbitrary units]. If you have multiple columns you should indicate which columns correspond to the spectrum data. For a list of supported formats see [this link](https://docs.astropy.org/en/stable/io/ascii/index.html#supported-formats)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "spectrum = nd.read_table(\"file_name.csv\", wavelength_column=2, flux_column=4, format=\"csv\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "interpreter": { + "hash": "dfefad9444caa34b651035342248c936eda24540a2756afa4fe280ef294fff37" + }, + "kernelspec": { + "display_name": "Python 3.8.10 64-bit ('nirdust': virtualenv)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.10" + }, + "orig_nbformat": 4 + }, + "nbformat": 4, + "nbformat_minor": 2 +}