{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# `muler` Quickstart" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from muler.igrins import IGRINSSpectrum" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Simply pass in a path to an IGRINS Spectrum. You can download some example data from the standalone and free-to-use [muler_example_data](https://github.com/OttoStruve/muler_example_data)." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "! pwd" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "! ls" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "path = 'https://github.com/OttoStruve/muler_example_data/raw/main/IGRINS/01_IGRINS_test_data/'\n", "filename = 'SDCH_20201202_0059.spec_a0v.fits'\n", "spec = IGRINSSpectrum(file=path+filename)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Normalize the spectrum by the median:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%capture\n", "normalized_spectrum = spec.normalize()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The spectrum has wavelength, with units:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "normalized_spectrum.wavelength" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The flux vector is the same length as wavelength:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "normalized_spectrum.flux.dtype, normalized_spectrum.shape" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "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" } }, "nbformat": 4, "nbformat_minor": 4 }