We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Output spectra should have a double x-axis:
and an option to plot a vertical line at the redshift/expected HI frequency of the galaxy.
The text was updated successfully, but these errors were encountered:
Try with some variation of this code (by H. Stacey)
from matplotlib import pyplot as plt from matplotlib import transforms as mtransforms from mpl_toolkits.axes_grid.parasite_axes import SubplotHost class Wavelength2FreqTransform(mtransforms.Transform): input_dims = 1 output_dims = 1 is_separable = False has_inverse = True def __init__(self): mtransforms.Transform.__init__(self) def transform_non_affine(self, wl): return ((wl*un.um).to(un.GHz, equivalencies=un.spectral()).value)/(1+z) def inverted(self): return Freq2WavelengthTransform() class Freq2WavelengthTransform(Wavelength2FreqTransform): input_dims = 1 output_dims = 1 is_separable = False has_inverse = True def __init__(self): mtransforms.Transform.__init__(self) def transform_non_affine(self, fr): return ((fr*un.GHz).to(un.um, equivalencies=un.spectral()).value) def inverted(self): return Wavelength2FreqTransform() aux_trans = mtransforms.BlendedGenericTransform(Wavelength2FreqTransform(), mtransforms.IdentityTransform()) fig = plt.figure(figsize=(8,6)) ax_um = SubplotHost(fig, 1,1,1) fig.add_subplot(ax_um) ax_um.set_xlabel(r'Rest wav ($\mu$m)') ax_GHz = ax_um.twin(aux_trans) ax_GHz.set_xlabel('Observed freq (GHz)') ax_GHz.set_viewlim_mode('transform') ax_GHz.axis['right'].toggle(ticklabels=False) ax_GHz.set_xscale('log') ax_GHz.set_yscale('log')
Sorry, something went wrong.
No branches or pull requests
Output spectra should have a double x-axis:
and an option to plot a vertical line at the redshift/expected HI frequency of the galaxy.
The text was updated successfully, but these errors were encountered: