Skip to content

Instantly share code, notes, and snippets.

View pllim's full-sized avatar
💭
Clickety clack clack. ⌨

P. L. Lim pllim

💭
Clickety clack clack. ⌨
View GitHub Profile
@pllim
pllim / bb_synphot_astropy.rst
Created August 18, 2017 20:32
How to get the same synphot results in Astropy v2

How to get the same synphot results in Astropy v2:

>>> import numpy as np
>>> from astropy import constants as const
>>> from astropy import units as u
>>> from astropy.modeling import models as _models
>>> from synphot import models
>>> from synphot import units
>>> t = 5500 * u.K
>>> fac = const.sigma_sb * t ** 4 / np.pi
@pllim
pllim / buildasn.ipynb
Created August 10, 2017 19:08
Python replacement for buildasn task
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pllim
pllim / sun_abs_mag.ipynb
Last active July 20, 2017 00:54
Calculate Sun abs mag in HST filter
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pllim
pllim / my_dep.py
Last active July 5, 2017 20:37
Astropy Issue 5917
import warnings
from astropy.utils.exceptions import AstropyDeprecationWarning
warnings.warn('Import level warning from dependency.', DeprecationWarning)
def foo():
warnings.warn('Runtime level warning from dependency.', DeprecationWarning)
@pllim
pllim / PySynphot_Issue_38-2.ipynb
Created July 1, 2017 00:58
Another example for PySynphot Issue 38
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pllim
pllim / PySynphot_Issue_38.ipynb
Created June 29, 2017 19:11
Example solution for PySynphot Issue 38
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pllim
pllim / LineProfile_profiling.ipynb
Created June 6, 2017 20:50
Profiling calculation algorithms in Ginga's LineProfile plugin
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pllim
pllim / astropy_synphot_demo.ipynb
Last active April 20, 2017 14:35
Spectroscopy Workshop Lightning Talk: synphot using Astropy Models
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pllim
pllim / pysynphot_gh36.ipynb
Created April 18, 2017 17:42
Pysynphot Github Issue 36
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pllim
pllim / for_hilbert.py
Last active April 5, 2017 18:38
Modify FITS table
"""
Ref: https://gist.github.com/bhilbert4/1d61054a4aeb2692831c629c28f811c8
"""
from astropy.io import fits
pf = fits.open('jwst_nircam_photom_0031.fits')
col_list = []
# Copy existing columns to new table. Here, I am only showing two as example.
for colname in ('filter', 'pupil'):