{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Specifying targets for a Scene\n",
"\n",
"It is possible to create a 'scene' populated with specified astronomical sources as an input to MIRISim. The types of targets, and how they can be specified are described here in detail.\n",
"\n",
"There are four classes of target specifications. For each target within the scene, the user can specify the: \n",
"\n",
"* spatial extent and morphology\n",
"* spectral energy distribution\n",
"* mapping of the velocity structure within the target\n",
"* line-of-sight velocity distribution \n",
"\n",
"These types of specifications are explained in detail here using the docstrings in the code itself to ensure that the instructions are as up-to-date as possible. Each of the four types are specified in turn.\n",
"\n",
"The way the types of sources are listed here (with single or double square brackets) shows how they should be specified in the scene.ini file (or other .ini file containing a sky scene)."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"# import the skysim component of MIRISim\n",
"# the component of MIRISim that generates scenes\n",
"import mirisim.skysim\n",
"outfile = 'valid_skysim_inputs.txt'\n",
"\n",
"# enable printing to file, or to output screen\n",
"def print_opt(in_string,f=None):\n",
" '''\n",
" f: output file. If none is given, then output to screen\n",
" '''\n",
" print(str(in_string))\n",
" if f:\n",
" f.write(str(in_string))\n",
"\n",
"#generic function to pull the documentation out of the **relevant** SkySim libraries\n",
"def get_documentation(module,blev,description,inputs):\n",
" '''\n",
" :Parameters:\n",
" \n",
" module: name of input module to be explored for documentation\n",
" blev: level of brackets to output (consistent with .ini file notation)\n",
" description: (True/False) should the description of the module be displayed \n",
" inputs: (True/False) should the required inputs be displayed\n",
" '''\n",
" #f = open(outfile,'w+') #uncomment to output to file\n",
" f = None #uncomment to output to screen\n",
" comp_types = module.keys()\n",
" for component in comp_types:\n",
" target_lib = module[component]\n",
" print_opt(\"{}{}{}\".format('['*blev,component,']'*blev),f)\n",
" if (description): print_opt(target_lib.__doc__,f)\n",
" if (inputs): print(print_opt(target_lib.__init__.__doc__,f))\n",
" print_opt(\"\\n============================================\\n\",f) "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## What to display\n",
"\n",
"There are two levels description available here. The first gives a description of the intent of the function (what kind of target or emission type is being created), and the second lists the available / required input parameters for that function. \n",
"\n",
"Whether the description or the inputs (or both) is displayed depends on which of the switches below are set to True"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"# Display function descriptions?\n",
"description = True\n",
"# Display input parameters?\n",
"inputs = True"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Specifying the Spatial Extent of the target\n",
"\n",
"\n",
"The primary classes of targets available within |skysim| are point and extended sources as well as a background radiation field. Both point and extended sources can be given spectral energy distribustions (SEDs), and spectral line information across the |MIRI| wavelength range, with extended sources having the additional capability of being encoded with information about an intrinsic velocity field. \n",
"\n",
"Extended sources:\n",
"\n",
"*\thave a spatial distribution of flux with is independent of wavelength\n",
"*\thave an SED that gives the flux of the source at each wavelength.\n",
"*\t*may* have a velocity map that gives the velocity along the line of sight at any given spatial coordinate (RA, DEC). This effectively \"shifts\" the SED in wavelength at each spatial coordinate.\n",
"*\t*may* have a LOSVD that gives the shape (broadening and asymmetries1) due to kinematics of the spectral lines. The LOSVD is not variable with coordinates because that would be too computationally demanding and is perhaps not necessary for this kind of simulations.\n",
"\n",
"Point sources:\n",
"\n",
"*\thave a position\n",
"*\thave an SED, identical in implementation and capabilities to the SEDs of extended sources\n",
"\t\n",
"** Special Case: ** Background emission (from the telescope and from the 'sky' are included in this specification. This is because the background has a spatial extent.\n",
"\n",
"\n",
"Background:\n",
"\n",
"*\tIt implements the model given in [Glasse et al. 2015](http://iopscience.iop.org/article/10.1086/682259/pdf).\n",
"*\tthe background behaves, to the user, in analogous way to an extended source. It may be queried at any spatial coordinate and wavelength to retrieve an specific intensity\n",
"*\tthe JWST part of the background may be time and spatial dependent.\n",
"*\tThe spatial dependence is a linear gradient with a certain position angle. The gradient is fixed on JWST FOV coordinates (V2, V3).\n",
"*\tNear Future: the Zodiacal component will vary depending on ecliptic coordinates of the observation (TBI).\n",
"\n",
"These commands initialise what kind of source is going to be specified via the .ini file\n",
"\n",
"#### Specification in scene.ini\n",
"\n",
"These are the commands that go in single square brackets. e.g.\n",
"\n",
" [Galaxy] \n",
"\n",
"#### Specifiication in python\n",
"\n",
"These are the types of sources that initialise a target, eg:\n",
"\n",
" >> galaxy = Galaxy(Cen=(0.,0.),h=0.1,q=0.5,pa=35.,c=0) \n",
"\t\t\n",
"Where, `h` is the disk scale length, `q` is the axial ratio, `pa` is the in the position angle of the galaxy, and `c` represents its diskiness/boxiness. This galaxy is centred on the Principle Optical Path (POP).\n",
"\n",
"\n",
"\n",
"----\n",
"Set Print_Docstrings = True below to show which inputs are expected for specifying these targets. Setting this parameter to False skips this step"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[Background]\n",
"\n",
" Class for 'Sky + Observatory (JWST)' creates/returns background in [muJy/arcsec@]\n",
" \n",
" \n",
" Initializes Background.\n",
" \n",
" Only JWST-part of the background may be spatial or time dependent.\n",
" \n",
" :Parameters:\n",
" \n",
" level: low / high.\n",
" gradient: relative increase in JWST BGD over 1 arc-minute, \n",
" given as a percentage.\n",
" Maximal allowed gradient is 10%.\n",
" pa: [degree ; but stored in radian] position angle of the gradient (positive in the direction of pa).\n",
" given in degrees, 0 along positive RA axis, 90 along positive DEC axis.\n",
" tconstant: time-constant for time-dependent background [minutes].\n",
" fast: Use 1 or not use 0 the 2.5D spee up. Speed up works for cases where flux(RA, DEC, WAV) = flux1(RA, DEC) * flux2(WAV)\n",
" centreFOV: (RA, DEC) coordinates of the reference point (for gradient).\n",
" \n",
"None\n",
"\n",
"============================================\n",
"\n",
"[Catalogue]\n",
"Class to read and parse a catalogue with sources, \n",
" to be convert them into a \"scene\".\n",
" \n",
"None\n",
"\n",
"============================================\n",
"\n",
"[ExpDisk]\n",
"Exponential profile Disk object.\n",
"\n",
" I = I0 exp(-r/h)\n",
"\n",
" \n",
"\n",
"\n",
" :Parameters:\n",
"\n",
" h: scale length of exponential disk (the radius at which the intensity drops by e^-1) [arcsec]\n",
"\n",
" Cen: (RA, DEC) relative coordinate offset of the centre [arcsec]\n",
" q: axis ratio\n",
" pa: positional angle, 2D orientation [degrees]\n",
" c: boxiness of the ellipse (deviation of the isophote shape from ellipse\n",
" c < 0 boxy\n",
" c = 0 ellipse\n",
" c > 0 alongated along the major axis)\n",
"\n",
" rtrunc_in: inner radius [arcsec] below which the disk is truncated and flux density is set to 0.\n",
" This allows creating an annulus.\n",
" Default value is 0. (no truncation)\n",
" Note that the reference flux is still defined at the source centre even when rtrunc > 0.\n",
"\n",
" Warning: rtrunc > 0 may affect flux conservations because entire pixel is set to zero!!!\n",
"\n",
" rtrunc_out: outer radius [arcsec] beyond which the disk is truncated and flux density is set to 0.\n",
" This allows creating an annulus.\n",
" Default value is np.inf. (no truncation)\n",
"\n",
" Warning: rtrunc_out != np.inf may affect flux conservations because entire pixel is set to zero!!!\n",
"\n",
" Example of use:\n",
"\n",
" from mirisim.skysim.disks import ExpDisk\n",
" dsk = ExpDisk(Cen=[0,1], q=0.5, c=0.1, pa=30., rtrunc_in=0.5,rtrunc_out=5., h = 1.5)\n",
" r = np.linspace(-10.,10.,50)\n",
" d = np.linspace(-10.,10.,50)\n",
" rr,dd=np.meshgrid(r,d,indexing='ij')\n",
" dsk_img = dsk.spatial(rr,dd)\n",
"\n",
" import matplotlib.pyplot as plt\n",
" plt.imshow(dsk_img)\n",
" plt.show()\n",
"\n",
" \n",
"None\n",
"\n",
"============================================\n",
"\n",
"[Galaxy]\n",
"A standard galaxy class that represenets a galaxy discribed by a Sersic disk.\n",
" \n",
" :Parameters:\n",
" \n",
" follow the description of Sersic disk class and Disk class\n",
" \n",
" Cen: (RA, DEC) relative coordinate offset of the centre [arcsec] \n",
" q: axis ratio\n",
" pa: positional angle [degrees]\n",
" c: boxiness of the ellipse\n",
"\n",
" n: sersic index (n=1: exponential profile, n=4: de Vaoucouleurs)\n",
" re : effective radius (half of flux is within r <= re) [arcsec]\n",
" k: k = f(n) ensures within re contains half of the flux.\n",
" Ie: surface brightness at re [muJy/arcesc2]\n",
" \n",
" Note: Extended sources, such as Galaxy, with angular size smaller\n",
" than a pixel may suffer from flux loss due to low spatial\n",
" resolution. Please, use a point source (Point) or a skycube\n",
" fits file (Skyscene) instead. This special case will be treated\n",
" in a future release.\n",
" \n",
" \n",
"See SercisDisk.__init__\n",
"None\n",
"\n",
"============================================\n",
"\n",
"[PlanetDisk]\n",
"\n",
"\n",
" Planetary disk object: circular disk with limb darkening\n",
"\n",
"\n",
" I(psi) = I0 Sum_{k=0,N} a_k cos^k(psi)\n",
" psi = arccos( sqrt(cos^2(theta) - cos^2(Omega)) / sin(Omega) )\n",
"\n",
" Omega: angle subtended from centre and edge of disk.\n",
" theta: angle subtended between line-of-sight and center of disk.\n",
" psi: angle subtended between normal to surface of object (planet surface)\n",
" and observer.\n",
"\n",
" Refs.:\n",
"\n",
" https://en.wikipedia.org/wiki/Limb_darkening\n",
" Cox, Arthur N. (ed) (2000). Allen's Astrophysical Quantities (14th ed.). Springer-Verlag,\n",
"\n",
" \n",
"\n",
"\n",
" :Parameters:\n",
"\n",
" r: radius of disk [arcsec]\n",
" ak: coefficients that describe the limb-darkening profile.\n",
"\n",
" Setting ak = 1. 0. is equiv. to no limb-darkening\n",
"\n",
" refs.:\n",
" https://en.wikipedia.org/wiki/Limb_darkening\n",
" Cox, Arthur N. (ed) (2000). Allen's Astrophysical Quantities (14th ed.). Springer-Verlag,\n",
"\n",
" q: axis ratio\n",
" pa: positional angle, 2D orientation [degrees]\n",
" c: boxiness of the ellipse (deviation of the isophote shape from ellipse\n",
" c < 0 boxy\n",
" c = 0 ellipse\n",
" c > 0 alongated along the major axis)\n",
"\n",
" rtrunc_in: inner radius [arcsec] below which the disk is truncated and flux density is set to 0.\n",
" This allows creating an annulus.\n",
" Default value is 0. (no truncation)\n",
" Note that the reference flux is still defined at the source centre even when rtrunc > 0.\n",
"\n",
" Warning: rtrunc > 0 may affect flux conservations because entire pixel is set to zero!!!\n",
"\n",
" rtrunc_out: outer radius [arcsec] beyond which the disk is truncated and flux density is set to 0.\n",
" This allows creating an annulus.\n",
" Default value is np.inf. (no truncation)\n",
"\n",
" Warning: rtrunc_out != np.inf may affect flux conservations because entire pixel is set to zero!!!\n",
"\n",
" \n",
"None\n",
"\n",
"============================================\n",
"\n",
"[Point]\n",
"\n",
" Base class for point-like sources.\n",
" \n",
"\n",
" Initializes Point source.\n",
"\n",
" :Parameters:\n",
"\n",
" Cen: (RA, DEC) relative coordinates offset from the centre of the scene [arcsec]\n",
"\n",
" \n",
"None\n",
"\n",
"============================================\n",
"\n",
"[SersicDisk]\n",
"\n",
" Sersic disk object.\n",
"\n",
" I = Ie exp(-k*((r/re)**(1./n)-1))\n",
"\n",
" n: sersic index (n=1: exponential profile, n=4: de Vaoucouleurs)\n",
" re : effective radius (half of flux is within r <= re) [arcsec]\n",
" k: k = f(n) ensures within re contains half of the flux.\n",
" Ie: surface brightness at re [muJy/arcesc2]\n",
"\n",
" See http://ned.ipac.caltech.edu/level5/March05/Graham/Graham2.html\n",
"\n",
" \n",
"\n",
"\n",
" :Parameters:\n",
"\n",
" n: sersic index (n=1: exponential profile, n=4: de Vaoucouleurs)\n",
" re : effective radius (half of flux is within r <= re) [arcsec]\n",
"\n",
" q: axis ratio\n",
" pa: positional angle, 2D orientation [degrees]\n",
" c: boxiness of the ellipse (deviation of the isophote shape from ellipse\n",
" c < 0 boxy\n",
" c = 0 ellipse\n",
" c > 0 alongated along the major axis)\n",
"\n",
" rtrunc_in: inner radius [arcsec] below which the disk is truncated and flux density is set to 0.\n",
" This allows creating an annulus.\n",
" Default value is 0. (no truncation)\n",
" Note that the reference flux is still defined at the source centre even when rtrunc > 0.\n",
"\n",
" Warning: rtrunc > 0 may affect flux conservations because entire pixel is set to zero!!!\n",
"\n",
" rtrunc_out: outer radius [arcsec] beyond which the disk is truncated and flux density is set to 0.\n",
" This allows creating an annulus.\n",
" Default value is np.inf. (no truncation)\n",
"\n",
" Warning: rtrunc_out != np.inf may affect flux conservations because entire pixel is set to zero!!!\n",
" \n",
"None\n",
"\n",
"============================================\n",
"\n",
"[SkyCube]\n",
" \n",
" Source created from a user-generated cube. \n",
"\n",
" The centre of the user-defined FITS file is shifted to the centre of the scene.\n",
" \n",
"\n",
" :Parameters:\n",
" \n",
" cubefits - name of the fits file that contains a skycube.\n",
" \n",
" The convention is that the values are considered to represent the\n",
" flux density values in bins defined by the left bin edges.\n",
" \n",
" fits_ext - the index of the fits file extension where the data cube is stored. 0 index by default.\n",
"\n",
" center - optional parameter controlling if the centre of the\n",
" fits file is aligned with the centre of the scene [default is 'yes'].\n",
" Allowed values are 'yes' for centering on and 'no' for centering off.\n",
" Omitting the keyword means centering on.\n",
" \n",
" method - specifying grid interpolation method\n",
" 0 - interpolation with no flux conservation rebinning (fast, inaccurate)\n",
" 1 - cumulative trapezoid rule rebinnning with interpolation over entire 3D cube (default)\n",
" 2 - cumulative trapezoid rule rebinnning with interpolation per each column\n",
" (scales with the number of pixels - and can be very slow)\n",
" 3 - histogram rebinning NOT IMPLEMENTED YET\n",
" \n",
" conserve - 'wave' interpolate wavelength grid only to conserve flux\n",
" - 'full' full flux conserving interpolation over the full grid of ra, dec, wav\n",
" Notes: conserve parameter has meaning only for methods 1, 2 and 3.\n",
" conserve set to 'wave' is faster (as only 1 of 3 downsampling is being done.) \n",
" \n",
" Warning: conserve set to 'full' changes the interpretation of the result. Returned flux density\n",
" is then an average density of the bin between ra_i and ra_i+1, dec_i and dec_i+1 and\n",
" wav_i and wav_i+1. If set to 'wave', the returned flux density is at ra, dec and\n",
" an average between wav_i and wav_i+1.\n",
" In other words, 'wave' conserve flux in spectral dimension, while 'full' in both spatial\n",
" and spectral dimension of the grid.\n",
" \n",
" The fits file header must contain WCS keywords\n",
" \n",
" NAXIS = 3, NAXISi, CRTYPEi, CRVALi, CRPIXi, CDELTi, CUNITi\n",
" where i = 1,2,3.\n",
" Expected CTYPEi values are 'RA---TAN', 'DEC--TAN', 'WAVE'\n",
" \n",
" The flux density units are given by UNITS keyword. Missing UNITS keyword\n",
" results in default microjansky/arcsec**2 as flux density units.\n",
" \n",
" Any astropy.unit string representation works for CUNIT and UNITS as far as they\n",
" are converable to arcseconds (for spatial) and microns (for wavelength) and\n",
" microjansky/arcsec**2 (for flux density).\n",
" \n",
" Note: Specifying units only in comments has no effect, comments are ignored.\n",
" \n",
"None\n",
"\n",
"============================================\n",
"\n",
"[SkyImage]\n",
"\n",
" \n",
" Source created from a user-generated image. \n",
" The SED must be acquired separately.\n",
" \n",
" Skyimage is used as a (normalised) intensity map to describe the spatial distribution of the source \n",
" \n",
" \n",
"\n",
" :Parameters:\n",
" \n",
" imagefits - name of the fits file that contains a skyimage.\n",
" \n",
" The convention is that the values are considered to represent the\n",
" intensity values at the bin centres.\n",
" \n",
" fits_ext - the index of the fits file extension where the data cube is stored. 0 index by default.\n",
"\n",
" normalise - 'yes' forces rescaling the map to 0,1. 'no' by default.\n",
" \n",
" center - optional parameter controlling if the centre of the\n",
" fits file is aligned with the centre of the scene [default is 'yes'].\n",
" Allowed values are 'yes' for centering on and 'no' for centering off.\n",
" Omitting the keyword means centering on.\n",
" \n",
" The fits file header must contain WCS keywords\n",
" \n",
" NAXIS = 2, NAXISi, CRTYPEi, CRVALi, CRPIXi, CDELTi, CUNITi\n",
" where i = 1,2.\n",
" Expected CTYPEi values are 'RA---TAN', 'DEC--TAN'\n",
" \n",
" The intensity units are given by UNITS keyword. Missing UNITS keyword\n",
" results in default arcsec**-2 as intensity units.\n",
" \n",
" Any astropy.unit string representation works for CUNIT and UNITS as far as they\n",
" are converable to arcseconds (for spatial) and microns (for wavelength) and\n",
" microjansky/arcsec**2 (for flux density).\n",
" \n",
" Note: Specifying units only in comments has no effect, comments are ignored.\n",
" \n",
" \n",
"None\n",
"\n",
"============================================\n",
"\n"
]
}
],
"source": [
"Display_Docstrings = True\n",
"\n",
"if (Display_Docstrings):\n",
" get_documentation(mirisim.skysim.lib.source_lib,1,description,inputs)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Specifying the Spectral Energy Distribution\n",
"\n",
"The spectral energy distribution (SED) of a target is specified using the facilities described below. \n",
"\n",
"There are four types of spectral energy distributions coded into SkySim: blackbody, stellar, galactic and planetary. \n",
"\n",
"** Special Case: ** Specification of spectral lines is included here since this involves specifying things in wavelength space.\n",
"\n",
"#### Specifying in scene.ini\n",
"\n",
"These specifications are presented in the .ini files with double square brackets.\n",
"Note that multiple spectral energy distributions (e.g. the combination of specific spectral lines with a blackbody) can be specified for a single target by copying the target properties to a second source with identical spatial properties, and a different SED.\n",
"\n",
"\n",
"[Galaxy]\n",
"params\n",
"\n",
"[[sed]]\n",
"Type = SEDTYPE\n",
"params\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"#### Specifying within python\n",
"\n",
"Using the galaxy object created above, an SED is added to the target using::\n",
"\n",
" galaxy.get_SED(sed.LinesSed(**SEDPars))\n",
"\t\n",
"Where the `SEDPars` are a set of parameters defining, in this case, a spectral line SED with specific line fluxes at given wavelength with specific full width half max values. for example, the function in the brackets could take the form::\n",
"\n",
"\tsed.LinesSed(wavels=[5.5],fluxes=[150],fwhms=[300])\n",
"\n",
"Multiple lines are then specified within the square brackets, and all three parameters must be specified for each line (wavelength, flux and fwhm). \n",
"\n",
"----\n",
"Set Print_Docstrings = True below to show which inputs are expected for specifying these targets. Setting this parameter to False skips this step"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[[BB]]\n",
"Black-Body Sed.\n",
"\n",
" :Parameters:\n",
"\n",
" Temp: Temperature [K]\n",
" flux: Reference flux [muJy]\n",
" wref: Reference wavelength of the reference spectrum [micron]\n",
" \n",
"None\n",
"None\n",
"\n",
"============================================\n",
"\n",
"[[External]]\n",
"External Sed\n",
"\n",
" Loads and interpolates an External SED from a file\n",
"\n",
" :Paramaters:\n",
"\n",
" sedfile: (relative) path to the file containing columns 'wavelength' [microns] and 'flux' [muJy]\n",
" Linear spacing is expceted.\n",
" The file format must be compatible with astropy.io.ascii table\n",
" wref: not used\n",
" flux: not used\n",
" \n",
"\n",
" :Usage in the scene.ini configuration file:\n",
"\n",
" [[sed]]\n",
" Type = External\n",
" sedfile = extsed.txt # filepath, units in [microns] [muJy]\n",
"\n",
" :Numpy array as input:\n",
" \n",
" When calling from a Python script you may omit `sedfile` parameter. You will get\n",
" a warning after the init but then you can ignore it and load the numpy 2D array\n",
" as an input. The 2D numpy array is expected to be 2xN, having wavelengths in the first\n",
" dim and flux densities in the second dim. See ExternalSed.load2DArray method for more info.\n",
" \n",
" Example:\n",
" \n",
" from mirisim.skysim.sed import ExternalSed\n",
" import numpy as np\n",
" wav = np.linspace(5.,20.,50)\n",
" sp = wav**2\n",
" es = ExternalSed()\n",
" x=np.vstack((wav,sp))\n",
" es.load2DArray(x)\n",
" \n",
" \n",
" Warning: Additional modification aka velocity map, redshift etc may cause inconsistent behavior\n",
" because of the new SEDfunct method that works on integrating flux.\n",
" \n",
"None\n",
"None\n",
"\n",
"============================================\n",
"\n",
"[[Lines]]\n",
"\n",
"\n",
" Sed which is just a set of Gaussian lines.\n",
"\n",
" Note: The line is Gaussian in wavelengths.\n",
"\n",
" \n",
"\n",
"\n",
" [wavels]: wavelengths of lines, for compatibility with other components typically in [microns]\n",
" [fluxes]: integrated fluxes of lines (areas under lines) for compatibility with other components typically in [10^-20 W/m^2]\n",
" [fwhms]: fwhms of lines. Can be zero for delta profiles. [microns]\n",
"\n",
" wavels, fluxes and fwhms arrays must be of the same length\n",
"\n",
" linesfile: file with list of lines. See format in skysim/data/spectra/example_Lines.txt\n",
"\n",
" Gaussian_in: 'wav' by default (if omitted), or 'freq' determines if the shape of the lines is Gaussian\n",
" flux_nu density as a function of wavelengths f_nu(wav) = Gauss(wav) or frequency f_nu(nu) = Gauss(nu)\n",
"\n",
" Caution: Gaussian_in='freq' is still experimental. The default 'wav' option is recommended.\n",
" For narrow lines the difference is small.\n",
" \n",
" \n",
"None\n",
"\n",
"============================================\n",
"\n",
"[[PL]]\n",
"Power-law Sed, newly with an additional additive constant b.\n",
"\n",
" Definition F_nu(lam) = (flux-b) * (lam/wref)**alpha + b\n",
"\n",
" :Parameters:\n",
"\n",
" alpha: power-law index (of wavelength)\n",
" flux: reference flux F_nu [muJy] at wref\n",
" wref: Reference wavelength where the flux is equal to the refernce flux [micron]\n",
" b: additive flux F_nu constant [muJy], by default b=0\n",
"\n",
" (PL definition adopted from https://www.eso.org/observing/etc/doc/formulabook/node10.html)\n",
" \n",
"None\n",
"None\n",
"\n",
"============================================\n",
"\n",
"[[pysynphot]]\n",
"\n",
" Wrapper class around pysynphot. Returns SED in micron and muJy.\n",
" \n",
" Example of usage in a scene file:\n",
" \n",
" [[sed]]\n",
" Type = pysynphot\n",
" family = # part of the pysynphot description of a template\n",
" subfamily = # part of the pysynphot description of a template\n",
" sedname = # part of the pysynphot description of a template\n",
" wref = # reference wavelength for flux calibration\n",
" flux = # reference flux at wref for flux calibration \n",
" v = # radial velocity km/s (the spectrum will be Doppler shifted by v/c)\n",
" z = # (optional) redshift (the spectrum will be redshifted by z*c)\n",
" \n",
" Example of usage:\n",
" \n",
" from mirisim.skysim import PYSPSed\n",
" spe = PYSPSed(family='bc95', sedname='bc95_b_10E6', wref=10., flux=600.) \n",
" \n",
" \n",
"None\n",
"\n",
"============================================\n",
"\n"
]
}
],
"source": [
"Display_Docstrings = True\n",
"\n",
"if (Display_Docstrings):\n",
" get_documentation(mirisim.skysim.lib.sed_lib,2,description,inputs)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Specifying Velocity Distributions\n",
"\n",
"\n",
"\n",
"Galactic and protostellar disks alike rotate. SkySim gives you the ability to implement a velocity field into the extended sources created above. \n",
"\n",
"\n",
"#### Specifying in scene.ini\n",
"\n",
"[[velomap]]\n",
" Type = FlatDisk\n",
" ...\n",
"\n",
"#### Specifying in python\n",
"\n",
"TBC\n",
"\n",
"\n",
"\n",
"----\n",
"Set Print_Docstrings = True below to show which inputs are expected for specifying these targets. Setting this parameter to False skips this step"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[[FlatDisk]]\n",
"Flat Rotation Curve Disk\n",
" \n",
"None\n",
"\n",
"============================================\n",
"\n",
"[[KeplerDisk]]\n",
"Keplerian Disk\n",
" \n",
" \n",
" v(r) = (v0 / r)^0.5\n",
" \n",
" \n",
" \n",
"None\n",
"\n",
"============================================\n",
"\n"
]
}
],
"source": [
"Display_Docstrings = True\n",
"\n",
"if (Display_Docstrings):\n",
" get_documentation(mirisim.skysim.lib.velomap_lib,2,description,inputs)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Specifying line of sight velocity distribution\n",
"\n",
"\n",
"#### Specifying in scene.ini\n",
"\n",
"\n",
"[[losvd]]\n",
" Type = ModGauss\n",
" ...\n",
"\n",
"\n",
"#### Specifying in python\n",
"\n",
"For instance, to add a line of sight velocity distribution (LOSVD) to the galaxy above::\n",
"\n",
"\talosvd = kinetics.Losvd(200,h3=0,h4=0)\n",
"\tgalaxy.get_LOSVD(alosvd)\n",
"\t\n",
"Where 200 is the velocity dispersion in km/s, and `h3` and `h4` are Gaussian Hermite polynomial coefficients.\n",
"\n",
"\n",
"----\n",
"For completeness, The equation for the line of sight velocity distribution is:\n",
"\n",
"$$ losvd = \\frac{1}{\\sqrt{(2 \\pi)}\\sigma} * e^{-y^2/2} * (1 + h3*H3(y)+h4*H4(y)) $$\n",
"\n",
"\n",
"Set Print_Docstrings = True below to show which inputs are expected for specifying these targets. Setting this parameter to False skips this step\n"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[[ModGauss]]\n",
"Line-of-Sight Velocity Distribution Class.\n",
" \n",
" Using a Gauss-Hermite expansion, after van der Marel & Franx 1993.\n",
" \n",
" \n",
"\n",
" :Parameters:\n",
" \n",
" sigma:\n",
" h3: \n",
" h4: \n",
" \n",
"None\n",
"\n",
"============================================\n",
"\n"
]
}
],
"source": [
"Print_Docstrings = True\n",
"\n",
"if (Print_Docstrings):\n",
" get_documentation(mirisim.skysim.lib.losvd_lib,2,description,inputs)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## "
]
}
],
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.7"
}
},
"nbformat": 4,
"nbformat_minor": 1
}