-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
correct gaia resolution, add example notebook
- Loading branch information
Showing
2 changed files
with
90 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import numpy as np\n", | ||
"import matplotlib.pyplot as plt\n", | ||
"import lvmdrp.core.fluxcal as fluxcal\n", | ||
"from lvmdrp.functions.fluxCalMethod import get_bprp_convolution_matrix\n", | ||
"from astropy.io import fits\n", | ||
"from astropy.table import Table\n", | ||
"\n", | ||
"with fits.open('/Users/droryn/work/LVM/data/sas/sdsswork/lvm/spectro/redux/1.1.0dev/1039XX/1039949/60356/lvmCFrame-00012618.fits') as hdu:\n", | ||
" d = hdu['FLUX'].data\n", | ||
" w = hdu['WAVE'].data\n", | ||
" slitmap = Table(hdu['SLITMAP'].data)\n", | ||
"\n", | ||
"gw, gf = fluxcal.retrive_gaia_star('5611678276101933056', GAIA_CACHE_DIR='/Users/droryn/work/LVM/data/sas/sdsswork/lvm/sandbox/calib/gaia_cache')\n", | ||
"stdflux = np.interp(w, gw, gf) # interpolate to our wavelength grid\n", | ||
"f = d[1297,:]\n", | ||
"plt.plot(w,f, color='blue', linewidth=1)\n", | ||
"plt.plot(gw,gf, color='red', linewidth=1)\n", | ||
"\n", | ||
"bprp_conv = get_bprp_convolution_matrix(w)\n", | ||
"spec_c = bprp_conv@f\n", | ||
"\n", | ||
"plt.plot(w,spec_c, color='green')\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"slitmap[slitmap['orig_ifulabel']=='P1-2']" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"s = '/Users/droryn/prog/lvm/lvmcore/etc/Gaia_BPRP_resolution.txt'\n", | ||
"txt = np.genfromtxt(s)\n", | ||
"l_bprp, r_bprp = txt[:, 0], txt[:, 1]\n", | ||
"sigmas = l_bprp/r_bprp/2.35\n", | ||
"plt.plot(l_bprp, sigmas)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "lvmdrp", | ||
"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.12.2" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters