This file contains hidden or 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
| # Example using the mosaicking helper functions in reproject to produce a new WCS | |
| # aligned with North, then reproject the input data to the new header. | |
| from astropy.io import fits | |
| from astropy.wcs import WCS | |
| from reproject import reproject_adaptive | |
| from reproject.mosaicking import find_optimal_celestial_wcs | |
This file contains hidden or 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
| from astropy.io import fits | |
| from astropy.stats import sigma_clip, mad_std | |
| # Sigma-clipped rms estimator | |
| # std_clipped = lambda x: sigma_clip(x).std() | |
| std_clipped = lambda x: mad_std(sigma_clip(x), ignore_nan=True) | |
| # radial profile function from turbustat. It's not actually a power spectrum (poor naming choice) |
This file contains hidden or 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
| ### Accounting for the beam in 2D fitting ### | |
| # Trying to fit a 2D Gaussian while convolving with the telescope beam. | |
| # NOTES: - currently fails if units are used. | |
| # - Example regions I'm using is not fit by this snippet. | |
| import warnings | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from spectral_cube import SpectralCube, Projection |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
| ''' | |
| Save massive FITS files. | |
| I keep another version in https://github.com/e-koch/ewky_scripts, but the gist | |
| avoids you having to download a bunch of other stuff. | |
| ''' | |
| from astropy.io import fits | |
| import numpy as np |
This file contains hidden or 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
| ''' | |
| Creates a list of all files within a directory, then copies each over to | |
| VOS. | |
| Run getCert before this script. | |
| Call sequence: | |
| 1 - folder -- str | |
| 2 - Root of the vos file -- str | |
| 3 - Number of tries before giving up. -- int |