Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Sep 26, 2023
1 parent f0fbd54 commit 37cd4a6
Show file tree
Hide file tree
Showing 6 changed files with 160 additions and 13 deletions.
2 changes: 1 addition & 1 deletion _sources/moddoc_core.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1966,7 +1966,7 @@ Collection of timestreams indexed by logical detector ID

``G3TimestreamMap( (G3TimestreamMap)arg2)``

``G3TimestreamMap( (StringVector)keys, (object)data [, (G3Time)start=<spt3g.core.G3Time object at 0x7f6c09969eb0> [, (G3Time)stop=<spt3g.core.G3Time object at 0x7f6c09969f20> [, (G3TimestreamUnits)units=spt3g.core.G3TimestreamUnits.None [, (int)compression_level=0 [, (bool)copy_data=True]]]]])`` :
``G3TimestreamMap( (StringVector)keys, (object)data [, (G3Time)start=<spt3g.core.G3Time object at 0x7f68366e3eb0> [, (G3Time)stop=<spt3g.core.G3Time object at 0x7f68366e3f20> [, (G3TimestreamUnits)units=spt3g.core.G3TimestreamUnits.None [, (int)compression_level=0 [, (bool)copy_data=True]]]]])`` :
Create a timestream map from a numpy array or other numeric python iterable. Each row of the 2D input array will correspond to a single timestream, with the key set to the correspondingly-indexed entry of <keys>. If <copy_data> is True (default), the data will be copied into the output data structure. If False, the timestream map will provide a view into the given numpy array.

``G3TimestreamMap( (list)arg2)`` :
Expand Down
86 changes: 81 additions & 5 deletions _sources/moddoc_maps.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1388,21 +1388,59 @@ minimize memory use.

**spt3g.maps.map_modules.CoaddMaps**

Coadd maps and weights.

Coadd maps and weights, optionally collating by map Id. This class can be
used as an argument to ``pipe.Add()`` as a standard pipeline module, or
instantiated as a standalone instance. In the latter case, the object is
treated as a callable for input map frames, and the ``coadd_frame`` or
``coadd_frames`` attribute contains the running coadd(s).

The output coadd frames contain two additional keys: ``'InputMapIds'`` and
``'InputFiles'``, which are both lists of unique map Id's and filenames that
are associated with the frames that contribute to each coadd. When one
coadd is added to another, these keys are updated recursively, so that the
resulting coadd includes the Id's and filenames that contributed to both
itself and the other coadd. The list of filenames can be populated by
combining this module with a G3Reader whose ``track_filename`` option is set
to True; however, this feature is fragile and may not work as expected with
complex pipelines.

*Attributes:*
coadd_frame : G3Frame
Output coadd map frame, also injected into the pipeline on
EndProcessing. This attribute is only populated if the ``collate``
option is set to False.
coadd_frames : dict of G3Frames
Output coadd map frames, keyed by input map Id. Each frame is also
injected into the pipeline on EndProcessing. This attribute is only
populated if the ``collate`` option is set to True.

*Arguments:*
map_ids : list of str
List of map Id's to include in the coadd. If None, any maps
List of map Id's to include in the coadd(s). If None, any maps
in the pipeline are included.
output_map_id : str
Id to assign to the output frame.
Id to assign to the output frame. If ``collate`` is True, this argument
is required and treated as a prefix to which each input map Id is
appended.
collate : bool
If True, coadd unique map Id's into separate output map frames.
weighted : bool
If True (default), ensure that maps have had weights applied before
coadding. Otherwise, coadd maps without checking the weights.
ignore_missing_weights : bool
If False (default), a warning is issued when the frame contains weighted
Stokes maps without a weights map. Set this option to True when feeding
single bolometer map frames with common weights through a pipeline.
drop_input_frames : bool
If True, drop input map frames from the pipeline.
map_id_function : callable
If supplied, use this callable to extract a map_id from the input map
frames. Otherwise, use ``frame["Id"]``. The function should take a
single frame object as an argument and return a string value to match
against ``map_ids``, or ``None`` if a valid Id cannot be constructed.

*Constructor:*
``CoaddMaps(self, map_ids=None, output_map_id=None, ignore_missing_weights=False)``
``CoaddMaps(self, map_ids=None, output_map_id='Coadd', collate=False, weighted=True, ignore_missing_weights=False, drop_input_frames=False, map_id_function=None)``



Expand Down Expand Up @@ -1706,6 +1744,8 @@ Functions in spt3g.maps

* spt3g.maps.make_point_source_mask_

* spt3g.maps.map_modules.coadd_map_files_

* spt3g.maps.maputils.flatsky_to_healpix_

* spt3g.maps.maputils.healpix_to_flatsky_
Expand Down Expand Up @@ -2011,6 +2051,42 @@ over all pixels. The former produces output that is equivalent to using
Construct a mask from the input stub map with pixels within the given radius around each point source position set to 1.


.. _spt3g.maps.map_modules.coadd_map_files:

**spt3g.maps.map_modules.coadd_map_files**

Coadd map files, optionally collating map Id's into separate frames.

*Arguments:*
input_files : list of str
List of input files to feed through the pipeline.
output_file : str
Output G3 filename. If not supplied, the output frames are
returned without saving to disk.
map_ids : list of str
A list of map Id's to include in the coadd(s).
output_map_id : str
Id to use for the output map frame. If ``collate`` is True,
this is the prefix applied to each output frame, with the
input map Id appended to it.
collate : bool
If True, coadd individual map Id's into separate map frames.
Otherwise, all map frames are coadded into one output frame.
weighted : bool
If True, ensure that weights have been applied before coadding.
Otherwise, the input maps are coadded as they are.

*Returns:*
maps : G3Frame or dict of G3Frames
If ``collate`` is True, returns a dictionary of map frames
keyed by Id. Otherwise, returns a single map frame.

*Definition:*
``coadd_map_files(input_files, output_file=None, map_ids=None, output_map_id='Coadd', collate=False, weighted=True)``




.. _spt3g.maps.maputils.flatsky_to_healpix:

**spt3g.maps.maputils.flatsky_to_healpix**
Expand Down
2 changes: 1 addition & 1 deletion moddoc_core.html
Original file line number Diff line number Diff line change
Expand Up @@ -1368,7 +1368,7 @@ <h2>Frame Objects in spt3g.core<a class="headerlink" href="#frame-objects-in-spt
<dt><em>Constructors:</em></dt><dd><p><code class="docutils literal notranslate"><span class="pre">G3TimestreamMap()</span></code></p>
<p><code class="docutils literal notranslate"><span class="pre">G3TimestreamMap(</span> <span class="pre">(G3TimestreamMap)arg2)</span></code></p>
<dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">G3TimestreamMap(</span> <span class="pre">(StringVector)keys,</span> <span class="pre">(object)data</span> <span class="pre">[,</span> <span class="pre">(G3Time)start=&lt;spt3g.core.G3Time</span> <span class="pre">object</span> <span class="pre">at</span> <span class="pre">0x7f6c09969eb0&gt;</span> <span class="pre">[,</span> <span class="pre">(G3Time)stop=&lt;spt3g.core.G3Time</span> <span class="pre">object</span> <span class="pre">at</span> <span class="pre">0x7f6c09969f20&gt;</span> <span class="pre">[,</span> <span class="pre">(G3TimestreamUnits)units=spt3g.core.G3TimestreamUnits.None</span> <span class="pre">[,</span> <span class="pre">(int)compression_level=0</span> <span class="pre">[,</span> <span class="pre">(bool)copy_data=True]]]]])</span></code> :</dt><dd><p>Create a timestream map from a numpy array or other numeric python iterable. Each row of the 2D input array will correspond to a single timestream, with the key set to the correspondingly-indexed entry of &lt;keys&gt;. If &lt;copy_data&gt; is True (default), the data will be copied into the output data structure. If False, the timestream map will provide a view into the given numpy array.</p>
<dt><code class="docutils literal notranslate"><span class="pre">G3TimestreamMap(</span> <span class="pre">(StringVector)keys,</span> <span class="pre">(object)data</span> <span class="pre">[,</span> <span class="pre">(G3Time)start=&lt;spt3g.core.G3Time</span> <span class="pre">object</span> <span class="pre">at</span> <span class="pre">0x7f68366e3eb0&gt;</span> <span class="pre">[,</span> <span class="pre">(G3Time)stop=&lt;spt3g.core.G3Time</span> <span class="pre">object</span> <span class="pre">at</span> <span class="pre">0x7f68366e3f20&gt;</span> <span class="pre">[,</span> <span class="pre">(G3TimestreamUnits)units=spt3g.core.G3TimestreamUnits.None</span> <span class="pre">[,</span> <span class="pre">(int)compression_level=0</span> <span class="pre">[,</span> <span class="pre">(bool)copy_data=True]]]]])</span></code> :</dt><dd><p>Create a timestream map from a numpy array or other numeric python iterable. Each row of the 2D input array will correspond to a single timestream, with the key set to the correspondingly-indexed entry of &lt;keys&gt;. If &lt;copy_data&gt; is True (default), the data will be copied into the output data structure. If False, the timestream map will provide a view into the given numpy array.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">G3TimestreamMap(</span> <span class="pre">(list)arg2)</span></code> :</dt><dd><p>Initialize with keys and values from a Python dictionary: {‘key’:’value’}</p>
</dd>
Expand Down
81 changes: 76 additions & 5 deletions moddoc_maps.html
Original file line number Diff line number Diff line change
Expand Up @@ -1021,21 +1021,59 @@ <h2>Modules in spt3g.maps<a class="headerlink" href="#modules-in-spt3g-maps" tit
</dd>
</dl>
<p id="spt3g-maps-map-modules-coaddmaps"><strong>spt3g.maps.map_modules.CoaddMaps</strong></p>
<p>Coadd maps and weights.</p>
<dl class="simple">
<p>Coadd maps and weights, optionally collating by map Id. This class can be
used as an argument to <code class="docutils literal notranslate"><span class="pre">pipe.Add()</span></code> as a standard pipeline module, or
instantiated as a standalone instance. In the latter case, the object is
treated as a callable for input map frames, and the <code class="docutils literal notranslate"><span class="pre">coadd_frame</span></code> or
<code class="docutils literal notranslate"><span class="pre">coadd_frames</span></code> attribute contains the running coadd(s).</p>
<p>The output coadd frames contain two additional keys: <code class="docutils literal notranslate"><span class="pre">'InputMapIds'</span></code> and
<code class="docutils literal notranslate"><span class="pre">'InputFiles'</span></code>, which are both lists of unique map Id’s and filenames that
are associated with the frames that contribute to each coadd. When one
coadd is added to another, these keys are updated recursively, so that the
resulting coadd includes the Id’s and filenames that contributed to both
itself and the other coadd. The list of filenames can be populated by
combining this module with a G3Reader whose <code class="docutils literal notranslate"><span class="pre">track_filename</span></code> option is set
to True; however, this feature is fragile and may not work as expected with
complex pipelines.</p>
<dl class="simple">
<dt><em>Attributes:</em></dt><dd><dl class="simple">
<dt>coadd_frame<span class="classifier">G3Frame</span></dt><dd><p>Output coadd map frame, also injected into the pipeline on
EndProcessing. This attribute is only populated if the <code class="docutils literal notranslate"><span class="pre">collate</span></code>
option is set to False.</p>
</dd>
<dt>coadd_frames<span class="classifier">dict of G3Frames</span></dt><dd><p>Output coadd map frames, keyed by input map Id. Each frame is also
injected into the pipeline on EndProcessing. This attribute is only
populated if the <code class="docutils literal notranslate"><span class="pre">collate</span></code> option is set to True.</p>
</dd>
</dl>
</dd>
<dt><em>Arguments:</em></dt><dd><dl class="simple">
<dt>map_ids<span class="classifier">list of str</span></dt><dd><p>List of map Id’s to include in the coadd. If None, any maps
<dt>map_ids<span class="classifier">list of str</span></dt><dd><p>List of map Id’s to include in the coadd(s). If None, any maps
in the pipeline are included.</p>
</dd>
<dt>output_map_id<span class="classifier">str</span></dt><dd><p>Id to assign to the output frame.</p>
<dt>output_map_id<span class="classifier">str</span></dt><dd><p>Id to assign to the output frame. If <code class="docutils literal notranslate"><span class="pre">collate</span></code> is True, this argument
is required and treated as a prefix to which each input map Id is
appended.</p>
</dd>
<dt>collate<span class="classifier">bool</span></dt><dd><p>If True, coadd unique map Id’s into separate output map frames.</p>
</dd>
<dt>weighted<span class="classifier">bool</span></dt><dd><p>If True (default), ensure that maps have had weights applied before
coadding. Otherwise, coadd maps without checking the weights.</p>
</dd>
<dt>ignore_missing_weights<span class="classifier">bool</span></dt><dd><p>If False (default), a warning is issued when the frame contains weighted
Stokes maps without a weights map. Set this option to True when feeding
single bolometer map frames with common weights through a pipeline.</p>
</dd>
<dt>drop_input_frames<span class="classifier">bool</span></dt><dd><p>If True, drop input map frames from the pipeline.</p>
</dd>
<dt>map_id_function<span class="classifier">callable</span></dt><dd><p>If supplied, use this callable to extract a map_id from the input map
frames. Otherwise, use <code class="docutils literal notranslate"><span class="pre">frame[&quot;Id&quot;]</span></code>. The function should take a
single frame object as an argument and return a string value to match
against <code class="docutils literal notranslate"><span class="pre">map_ids</span></code>, or <code class="docutils literal notranslate"><span class="pre">None</span></code> if a valid Id cannot be constructed.</p>
</dd>
</dl>
</dd>
<dt><em>Constructor:</em></dt><dd><p><code class="docutils literal notranslate"><span class="pre">CoaddMaps(self,</span> <span class="pre">map_ids=None,</span> <span class="pre">output_map_id=None,</span> <span class="pre">ignore_missing_weights=False)</span></code></p>
<dt><em>Constructor:</em></dt><dd><p><code class="docutils literal notranslate"><span class="pre">CoaddMaps(self,</span> <span class="pre">map_ids=None,</span> <span class="pre">output_map_id='Coadd',</span> <span class="pre">collate=False,</span> <span class="pre">weighted=True,</span> <span class="pre">ignore_missing_weights=False,</span> <span class="pre">drop_input_frames=False,</span> <span class="pre">map_id_function=None)</span></code></p>
</dd>
</dl>
<p id="spt3g-maps-map-modules-compactmaps"><strong>spt3g.maps.map_modules.CompactMaps</strong></p>
Expand Down Expand Up @@ -1241,6 +1279,7 @@ <h2>Functions in spt3g.maps<a class="headerlink" href="#functions-in-spt3g-maps"
<li><p><a class="reference internal" href="#spt3g-maps-get-ra-dec-map">spt3g.maps.get_ra_dec_map</a></p></li>
<li><p><a class="reference internal" href="#spt3g-maps-get-ra-dec-mask">spt3g.maps.get_ra_dec_mask</a></p></li>
<li><p><a class="reference internal" href="#spt3g-maps-make-point-source-mask">spt3g.maps.make_point_source_mask</a></p></li>
<li><p><a class="reference internal" href="#spt3g-maps-map-modules-coadd-map-files">spt3g.maps.map_modules.coadd_map_files</a></p></li>
<li><p><a class="reference internal" href="#spt3g-maps-maputils-flatsky-to-healpix">spt3g.maps.maputils.flatsky_to_healpix</a></p></li>
<li><p><a class="reference internal" href="#spt3g-maps-maputils-healpix-to-flatsky">spt3g.maps.maputils.healpix_to_flatsky</a></p></li>
<li><p><a class="reference internal" href="#spt3g-maps-offsets-to-quat">spt3g.maps.offsets_to_quat</a></p></li>
Expand Down Expand Up @@ -1457,6 +1496,38 @@ <h2>Functions in spt3g.maps<a class="headerlink" href="#functions-in-spt3g-maps"
<dt><code class="docutils literal notranslate"><span class="pre">make_point_source_mask(</span> <span class="pre">(object)map,</span> <span class="pre">(DoubleVector)ra,</span> <span class="pre">(DoubleVector)dec,</span> <span class="pre">(DoubleVector)radius)</span> <span class="pre">-&gt;</span> <span class="pre">G3SkyMapMask</span> <span class="pre">:</span></code></dt><dd><p>Construct a mask from the input stub map with pixels within the given radius around each point source position set to 1.</p>
</dd>
</dl>
<p id="spt3g-maps-map-modules-coadd-map-files"><strong>spt3g.maps.map_modules.coadd_map_files</strong></p>
<p>Coadd map files, optionally collating map Id’s into separate frames.</p>
<dl class="simple">
<dt><em>Arguments:</em></dt><dd><dl class="simple">
<dt>input_files<span class="classifier">list of str</span></dt><dd><p>List of input files to feed through the pipeline.</p>
</dd>
<dt>output_file<span class="classifier">str</span></dt><dd><p>Output G3 filename. If not supplied, the output frames are
returned without saving to disk.</p>
</dd>
<dt>map_ids<span class="classifier">list of str</span></dt><dd><p>A list of map Id’s to include in the coadd(s).</p>
</dd>
<dt>output_map_id<span class="classifier">str</span></dt><dd><p>Id to use for the output map frame. If <code class="docutils literal notranslate"><span class="pre">collate</span></code> is True,
this is the prefix applied to each output frame, with the
input map Id appended to it.</p>
</dd>
<dt>collate<span class="classifier">bool</span></dt><dd><p>If True, coadd individual map Id’s into separate map frames.
Otherwise, all map frames are coadded into one output frame.</p>
</dd>
<dt>weighted<span class="classifier">bool</span></dt><dd><p>If True, ensure that weights have been applied before coadding.
Otherwise, the input maps are coadded as they are.</p>
</dd>
</dl>
</dd>
<dt><em>Returns:</em></dt><dd><dl class="simple">
<dt>maps<span class="classifier">G3Frame or dict of G3Frames</span></dt><dd><p>If <code class="docutils literal notranslate"><span class="pre">collate</span></code> is True, returns a dictionary of map frames
keyed by Id. Otherwise, returns a single map frame.</p>
</dd>
</dl>
</dd>
<dt><em>Definition:</em></dt><dd><p><code class="docutils literal notranslate"><span class="pre">coadd_map_files(input_files,</span> <span class="pre">output_file=None,</span> <span class="pre">map_ids=None,</span> <span class="pre">output_map_id='Coadd',</span> <span class="pre">collate=False,</span> <span class="pre">weighted=True)</span></code></p>
</dd>
</dl>
<p id="spt3g-maps-maputils-flatsky-to-healpix"><strong>spt3g.maps.maputils.flatsky_to_healpix</strong></p>
<p>Re-pixelize a map to Healpix from one of the flat projections.</p>
<dl>
Expand Down
Binary file modified objects.inv
Binary file not shown.
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

0 comments on commit 37cd4a6

Please sign in to comment.