# coding=utf8# Copyright (c) MPE/IR-Submm Group. See LICENSE.rst for license information. ## ZHeight models for DysmalPyfrom__future__import(absolute_import,division,print_function,unicode_literals)# Standard libraryimportabcimportlogging# Third party importsimportnumpyasnp# Local importsfrom.baseimport_DysmalFittable1DModelfromdysmalpy.parametersimportDysmalParameter__all__=['ZHeightGauss','ZHeightExp']# LOGGER SETTINGSlogging.basicConfig(level=logging.INFO)logger=logging.getLogger('DysmalPy')logger.setLevel(logging.INFO)importwarningswarnings.filterwarnings("ignore")# ******* Z-Height Profiles ***************classZHeightProfile(_DysmalFittable1DModel):"""Base object for flux profiles in the z-direction"""_type='zheight'# Must set property z_scalelength for each subclass,# for use with getting indices ai for filling simulated cube@abc.abstractpropertydefz_scalelength(self):"""Evaluate the flux attenuation (linear multiplier) at all locations of the cube"""
[docs]classZHeightGauss(ZHeightProfile):r""" Gaussian flux distribution in the z-direction Parameters ---------- sigmaz : float Dispersion of the Gaussian in kpc Notes ----- Model formula: .. math:: F_z = \exp\left\{\frac{-z^2}{2\sigma_z^2}\right\} """sigmaz=DysmalParameter(default=1.0,fixed=True,bounds=(0,10))def__init__(self,**kwargs):super(ZHeightGauss,self).__init__(**kwargs)
[docs]classZHeightExp(ZHeightProfile):r""" Exponential flux distribution in the z-direction Parameters ---------- hz : float Scale length of the exponential in kpc Notes ----- Model formula: .. math:: F_z = \exp\left\{\frac{-z}{h_z}\right\} """hz=DysmalParameter(default=1.0,fixed=True,bounds=(0,10))def__init__(self,**kwargs):super(ZHeightExp,self).__init__(**kwargs)