

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>Wavelength-dependent Profiles &mdash; GalSim 2.2.4 documentation</title>
  

  
  
  
  

  
  <script type="text/javascript" src="_static/js/modernizr.min.js"></script>
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
        <script src="_static/jquery.js"></script>
        <script src="_static/underscore.js"></script>
        <script src="_static/doctools.js"></script>
        <script src="_static/language_data.js"></script>
        <script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
    
    <script type="text/javascript" src="_static/js/theme.js"></script>

    

  
  <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Spectral Energy Distributions" href="sed.html" />
    <link rel="prev" title="The GSParams class" href="gsparams.html" /> 
</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
          

          
            <a href="index.html" class="icon icon-home"> GalSim
          

          
          </a>

          
            
            
              <div class="version">
                2.2
              </div>
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="overview.html">Overview</a></li>
<li class="toctree-l1"><a class="reference internal" href="install.html">Installation Instructions</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorials.html">Tutorials</a></li>
<li class="toctree-l1"><a class="reference internal" href="image.html">Images and Related Concepts</a></li>
<li class="toctree-l1"><a class="reference internal" href="sb.html">Surface Brightness Profiles</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Wavelength-dependent Profiles</a><ul>
<li class="toctree-l2"><a class="reference internal" href="sed.html">Spectral Energy Distributions</a></li>
<li class="toctree-l2"><a class="reference internal" href="bandpass.html">Bandpass Filters</a></li>
<li class="toctree-l2"><a class="reference internal" href="chromaticobject.html">Chromatic Profiles</a></li>
<li class="toctree-l2"><a class="reference internal" href="spectral.html">Spectral Correlated Noise</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="units.html">Units</a></li>
<li class="toctree-l1"><a class="reference internal" href="wcs.html">World Coordinate Systems</a></li>
<li class="toctree-l1"><a class="reference internal" href="random.html">Noise and Random Values</a></li>
<li class="toctree-l1"><a class="reference internal" href="wl.html">Weak Lensing</a></li>
<li class="toctree-l1"><a class="reference internal" href="photon.html">Photon Shooting</a></li>
<li class="toctree-l1"><a class="reference internal" href="utilities.html">Helper Functions and Classes</a></li>
<li class="toctree-l1"><a class="reference internal" href="errors.html">Errors and Warnings</a></li>
<li class="toctree-l1"><a class="reference internal" href="config.html">The Config Module</a></li>
<li class="toctree-l1"><a class="reference internal" href="hsm.html">The HSM Module</a></li>
<li class="toctree-l1"><a class="reference internal" href="des.html">The DES Module</a></li>
<li class="toctree-l1"><a class="reference internal" href="wfirst.html">The WFIRST Module</a></li>
<li class="toctree-l1"><a class="reference internal" href="shared.html">Shared Data</a></li>
<li class="toctree-l1"><a class="reference internal" href="history.html">Revision History</a></li>
</ul>

            
          
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="index.html">GalSim</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="index.html">Docs</a> &raquo;</li>
        
      <li>Wavelength-dependent Profiles</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            <a href="_sources/chromatic.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="wavelength-dependent-profiles">
<h1>Wavelength-dependent Profiles<a class="headerlink" href="#wavelength-dependent-profiles" title="Permalink to this headline">¶</a></h1>
<p>Real astronomical objects emit photons at a range of wavelengths according to a potentially
complicated spectral energy distribution (SED).  These photons then may be affected differently
by the atmosphere and optics as part of the point-spread function (PSF).  Then they typically
pass through a bandpass filter with a variable transmission as a function of wavelength.
Finally, there may be other wavelength-dependent effects when converting from photons to
electrons in the sensor.</p>
<p>GalSim supplies a number of tools to simulate these chromatic effects.
An <a class="reference internal" href="sed.html#galsim.SED" title="galsim.SED"><code class="xref any py py-class docutils literal notranslate"><span class="pre">SED</span></code></a> is used to define the SED of the objects.  There are a variety of options as to the units
of the input SED function; e.g. photons/cm^2/nm/sec, ergs/cm^2/Hz/s, etc.  There are also ways
to adjust the normalization of the SED to give a particular observed magnitude when observed
through a particular <a class="reference internal" href="bandpass.html#galsim.Bandpass" title="galsim.Bandpass"><code class="xref any py py-class docutils literal notranslate"><span class="pre">Bandpass</span></code></a>.  And there is a dimensionless option, which may be appropriate
for defining chromatic PSFs.</p>
<p>The <a class="reference internal" href="bandpass.html#galsim.Bandpass" title="galsim.Bandpass"><code class="xref any py py-class docutils literal notranslate"><span class="pre">Bandpass</span></code></a> class represents a spectral throughput function, which could be an
entire imaging system throughput response function (reflection off of mirrors, transmission through
filters, lenses and the atmosphere, and quantum efficiency of detectors), or individual pieces
thereof.  Both a <a class="reference internal" href="bandpass.html#galsim.Bandpass" title="galsim.Bandpass"><code class="xref any py py-class docutils literal notranslate"><span class="pre">Bandpass</span></code></a> and the <a class="reference internal" href="sed.html#galsim.SED" title="galsim.SED"><code class="xref any py py-class docutils literal notranslate"><span class="pre">SED</span></code></a> are necessary to compute the relative contribution of
each wavelength of a <a class="reference internal" href="chromaticobject.html#galsim.ChromaticObject" title="galsim.ChromaticObject"><code class="xref any py py-class docutils literal notranslate"><span class="pre">ChromaticObject</span></code></a> to a drawn image.</p>
<p>Then there are a number of kinds of <a class="reference internal" href="chromaticobject.html#galsim.ChromaticObject" title="galsim.ChromaticObject"><code class="xref any py py-class docutils literal notranslate"><span class="pre">ChromaticObject</span></code></a> to define the wavelength dependence of an
object’s surface brightness profile.  The simplest one is when the spatial and spectral
dependencies are separable; i.e. every part of the profile has the same SED.  In this case,
one forms the <a class="reference internal" href="chromaticobject.html#galsim.ChromaticObject" title="galsim.ChromaticObject"><code class="xref any py py-class docutils literal notranslate"><span class="pre">ChromaticObject</span></code></a> simply by multiplying a <a class="reference internal" href="gsobject.html#galsim.GSObject" title="galsim.GSObject"><code class="xref any py py-class docutils literal notranslate"><span class="pre">GSObject</span></code></a> by an <a class="reference internal" href="sed.html#galsim.SED" title="galsim.SED"><code class="xref any py py-class docutils literal notranslate"><span class="pre">SED</span></code></a>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">obj</span> <span class="o">=</span> <span class="n">galsim</span><span class="o">.</span><span class="n">Sersic</span><span class="p">(</span><span class="n">n</span><span class="o">=</span><span class="mf">2.3</span><span class="p">,</span> <span class="n">half_light_radius</span><span class="o">=</span><span class="mf">3.5</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sed</span> <span class="o">=</span> <span class="n">galsim</span><span class="o">.</span><span class="n">SED</span><span class="p">(</span><span class="s1">&#39;CWW_Sbc_ext.sed&#39;</span><span class="p">,</span> <span class="n">wave_type</span><span class="s1">&#39;Ang&#39;</span><span class="p">,</span> <span class="n">flux_type</span><span class="o">=</span><span class="s1">&#39;flambda&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">chromatic_object</span> <span class="o">=</span> <span class="n">obj</span> <span class="o">*</span> <span class="n">sed</span>
</pre></div>
</div>
<p>Other more complicated kinds of chromatic profiles are subclasses of <a class="reference internal" href="chromaticobject.html#galsim.ChromaticObject" title="galsim.ChromaticObject"><code class="xref any py py-class docutils literal notranslate"><span class="pre">ChromaticObject</span></code></a> and
have their own initialization arguments.  See the listings below.</p>
<p>To draw any kind of <a class="reference internal" href="chromaticobject.html#galsim.ChromaticObject" title="galsim.ChromaticObject"><code class="xref any py py-class docutils literal notranslate"><span class="pre">ChromaticObject</span></code></a>, you call its <code class="xref py py-meth docutils literal notranslate"><span class="pre">drawImage()</span></code>
method, which works largely the same as <code class="xref py py-meth docutils literal notranslate"><span class="pre">GSObject:drawImage()</span></code>, but requires a
<a class="reference internal" href="bandpass.html#galsim.Bandpass" title="galsim.Bandpass"><code class="xref any py py-class docutils literal notranslate"><span class="pre">Bandpass</span></code></a> argument to define what bandpass is being used for the observation:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">gband</span> <span class="o">=</span> <span class="n">galsim</span><span class="o">.</span><span class="n">Bandpass</span><span class="p">(</span><span class="k">lambda</span> <span class="n">w</span><span class="p">:</span><span class="mf">1.0</span><span class="p">,</span> <span class="n">wave_type</span><span class="o">=</span><span class="s1">&#39;nm&#39;</span><span class="p">,</span> <span class="n">blue_limit</span><span class="o">=</span><span class="mi">410</span><span class="p">,</span> <span class="n">red_limit</span><span class="o">=</span><span class="mi">550</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">image</span> <span class="o">=</span> <span class="n">chromatic_obj</span><span class="o">.</span><span class="n">drawImage</span><span class="p">(</span><span class="n">gband</span><span class="p">)</span>
</pre></div>
</div>
<p>The transformation methods of <a class="reference internal" href="chromaticobject.html#galsim.ChromaticObject" title="galsim.ChromaticObject"><code class="xref any py py-class docutils literal notranslate"><span class="pre">ChromaticObject</span></code></a>, like <code class="xref py py-meth docutils literal notranslate"><span class="pre">dilate()</span></code> and
<code class="xref py py-meth docutils literal notranslate"><span class="pre">shift()</span></code>, can also accept as an argument a function of wavelength (in
nanometers) that returns a wavelength-dependent dilation, shift, etc.  These can be used to
implement chromatic PSFs.  For example, a diffraction limited PSF might look like:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">psf500</span> <span class="o">=</span> <span class="n">galsim</span><span class="o">.</span><span class="n">Airy</span><span class="p">(</span><span class="n">lam_over_diam</span><span class="o">=</span><span class="mf">2.0</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">chromatic_psf</span> <span class="o">=</span> <span class="n">ChromaticObject</span><span class="p">(</span><span class="n">psf500</span><span class="p">)</span><span class="o">.</span><span class="n">dilate</span><span class="p">(</span><span class="k">lambda</span> <span class="n">w</span><span class="p">:(</span><span class="n">w</span><span class="o">/</span><span class="mi">500</span><span class="p">)</span><span class="o">**</span><span class="mf">1.0</span><span class="p">)</span>
</pre></div>
</div>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="sed.html">Spectral Energy Distributions</a></li>
<li class="toctree-l1"><a class="reference internal" href="bandpass.html">Bandpass Filters</a></li>
<li class="toctree-l1"><a class="reference internal" href="chromaticobject.html">Chromatic Profiles</a></li>
<li class="toctree-l1"><a class="reference internal" href="spectral.html">Spectral Correlated Noise</a></li>
</ul>
</div>
</div>


           </div>
           
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="sed.html" class="btn btn-neutral float-right" title="Spectral Energy Distributions" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="gsparams.html" class="btn btn-neutral float-left" title="The GSParams class" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; Copyright 2019, GalSim-developers

    </p>
  </div>
  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  


  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>