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 spectral_cube import OneDSpectrum | |
| from glob import glob | |
| def write_madcuba_ascii(fn): | |
| # Write the ASCII header based on the FITS spectrum provided | |
| hdul = fits.open(fn) | |
| # Get header parts | |
| spec_unit = f"UnitSpectral: {hdul[0].header['CUNIT1']}" | |
| int_unit = f"UnitInten: {hdul[0].header['BUNIT']}" |
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
| # I hope this is a MWE | |
| # Generate random signal mask, using seed | |
| numpy.random.seed(24) | |
| signal_mask = np.random.rand(37,512,512) | |
| import matplotlib.pyplot as plt | |
| from astropy.visualization import simple_norm | |
| # Generate data that we're plotting (from a cube called `signal_mask` |
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
| from spectral_cube import SpectralCube, StokesSpectralCube # maybe don't need StokesSpectralCube | |
| from glue.core import Data, DataCollection | |
| from glue.app.qt.application import GlueApplication | |
| from glue.viewers.image.qt import ImageViewer | |
| from glue.core.coordinates import coordinates_from_wcs | |
| image_dir = '/orange/adamginsburg/brick_alma_linesurvey/2019.1.00092.S/imaging_results/' | |
| image_file = image_dir + 'BrickMaser_87_spw25.residual' | |
| cube = SpectralCube.read(image_file, format = 'casa_image') |