Skip to content

Commit

Permalink
more docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mchalela committed Oct 14, 2022
1 parent 6fcf09c commit 33aa385
Show file tree
Hide file tree
Showing 8 changed files with 208 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NIRDust API Reference
API Reference
=====================

.. automodule:: nirdust
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ User Documentation
------------------

.. toctree::
:maxdepth: 1
:maxdepth: 2

installation
tutorials/index
api
tutorials/NGC5128.ipynb
licence


Expand Down
2 changes: 1 addition & 1 deletion docs/source/tutorials/NGC5128.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
26 changes: 26 additions & 0 deletions docs/source/tutorials/fit_blackbody.ipynb
Original file line number Diff line number Diff line change
@@ -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
}
15 changes: 15 additions & 0 deletions docs/source/tutorials/index.rst
Original file line number Diff line number Diff line change
@@ -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
43 changes: 43 additions & 0 deletions docs/source/tutorials/preprocessing.ipynb
Original file line number Diff line number Diff line change
@@ -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
}
119 changes: 119 additions & 0 deletions docs/source/tutorials/reading_spectra.ipynb
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 33aa385

Please sign in to comment.