Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dchaddock committed Jun 23, 2024
1 parent 0c318c8 commit 5c44703
Show file tree
Hide file tree
Showing 11 changed files with 773 additions and 385 deletions.
30 changes: 15 additions & 15 deletions docs/code/pyaurorax_api_reference/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/code/pyaurorax_api_reference/pyaurorax/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ <h1 class="title">Package <code>pyaurorax</code></h1>
&#34;&#34;&#34;

# versioning info
__version__ = &#34;1.0.0-rc1&#34;
__version__ = &#34;1.0.0&#34;

# documentation excludes
__pdoc__ = {&#34;cli&#34;: False, &#34;pyaurorax&#34;: False}
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ <h1 class="title">Module <code>pyaurorax.tools.calibration</code></h1>
<h2 class="section-title" id="header-functions">Functions</h2>
<dl>
<dt id="pyaurorax.tools.calibration.rego"><code class="name flex">
<span>def <span class="ident">rego</span></span>(<span>images: numpy.ndarray, cal_flatfield: Optional[pyucalgarysrs.data.classes.Calibration] = None, cal_rayleighs: Optional[pyucalgarysrs.data.classes.Calibration] = None, step_dark_frame_correction: bool = True, step_flatfield_correction: bool = True, step_rayleighs_conversion: bool = True, exposure_length_sec: float = 2.0) ‑> numpy.ndarray</span>
<span>def <span class="ident">rego</span></span>(<span>images: numpy.ndarray, cal_flatfield: Optional[pyucalgarysrs.data.classes.Calibration] = None, cal_rayleighs: Optional[pyucalgarysrs.data.classes.Calibration] = None, step_dark_frame_correction: bool = True, step_flatfield_calibration: bool = True, step_rayleighs_calibration: bool = True, exposure_length_sec: float = 2.0) ‑> numpy.ndarray</span>
</code></dt>
<dd>
<div class="desc"><p>Apply various calibration adjustments to a single or set of images raw images.</p>
Expand All @@ -74,13 +74,13 @@ <h2 id="args">Args</h2>
the <code>step_flatfield_corection</code> is set to True.</dd>
<dt><strong><code>cal_rayleighs</code></strong> :&ensp;<code><a title="pyaurorax.data.ucalgary.Calibration" href="../../data/ucalgary/index.html#pyaurorax.data.ucalgary.Calibration">Calibration</a></code></dt>
<dd>Calibration object containing the Rayleighs data to utilize. This field is required if
the <code>step_rayleighs_conversion</code> is set to True.</dd>
the <code>step_rayleighs_calibration</code> is set to True.</dd>
<dt><strong><code>step_dark_frame_correction</code></strong> :&ensp;<code>bool</code></dt>
<dd>Perform the dark frame correction step. Defaults to <code>True</code>.</dd>
<dt><strong><code>step_flatfield_correction</code></strong> :&ensp;<code>bool</code></dt>
<dt><strong><code>step_flatfield_calibration</code></strong> :&ensp;<code>bool</code></dt>
<dd>Perform the flatfield correction step. Defaults to <code>True</code>. Note that the <code>cal_flatfield</code> parameter
must be supplied if this is True.</dd>
<dt><strong><code>step_rayleighs_conversion</code></strong> :&ensp;<code>bool</code></dt>
<dt><strong><code>step_rayleighs_calibration</code></strong> :&ensp;<code>bool</code></dt>
<dd>Perform the Rayleighs conversion step. Defaults to <code>True.</code> Note that the <code>cal_rayleighs</code> parameter
must be supplied if this is True.</dd>
<dt><strong><code>exposure_length_sec</code></strong> :&ensp;<code>float</code></dt>
Expand All @@ -106,8 +106,8 @@ <h2 id="raises">Raises</h2>
cal_flatfield: Optional[Calibration] = None,
cal_rayleighs: Optional[Calibration] = None,
step_dark_frame_correction: bool = True,
step_flatfield_correction: bool = True,
step_rayleighs_conversion: bool = True,
step_flatfield_calibration: bool = True,
step_rayleighs_calibration: bool = True,
exposure_length_sec: float = 2.0,
) -&gt; np.ndarray:
&#34;&#34;&#34;
Expand All @@ -121,13 +121,13 @@ <h2 id="raises">Raises</h2>
the `step_flatfield_corection` is set to True.
cal_rayleighs (pyaurorax.data.ucalgary.Calibration):
Calibration object containing the Rayleighs data to utilize. This field is required if
the `step_rayleighs_conversion` is set to True.
the `step_rayleighs_calibration` is set to True.
step_dark_frame_correction (bool):
Perform the dark frame correction step. Defaults to `True`.
step_flatfield_correction (bool):
step_flatfield_calibration (bool):
Perform the flatfield correction step. Defaults to `True`. Note that the `cal_flatfield` parameter
must be supplied if this is True.
step_rayleighs_conversion (bool):
step_rayleighs_calibration (bool):
Perform the Rayleighs conversion step. Defaults to `True.` Note that the `cal_rayleighs` parameter
must be supplied if this is True.
exposure_length_sec (float):
Expand All @@ -145,9 +145,9 @@ <h2 id="raises">Raises</h2>
ValueError: issues encountered with supplied parameters.
&#34;&#34;&#34;
# verify that we have everything we need for each requested step
if (step_flatfield_correction is True and cal_flatfield is None):
if (step_flatfield_calibration is True and cal_flatfield is None):
raise ValueError(&#34;The cal_flatfield parameter must be supplied to perform the flatfield correction step&#34;)
if (step_rayleighs_conversion is True and cal_rayleighs is None):
if (step_rayleighs_calibration is True and cal_rayleighs is None):
raise ValueError(&#34;The cal_rayleighs parameter must be supplied to perform the rayleighs conversion step&#34;)

# init
Expand All @@ -160,19 +160,19 @@ <h2 id="raises">Raises</h2>
calibrated_images = perform_dark_frame_correction(images, 5)

# apply the flatfield correction
if (step_flatfield_correction is True and cal_flatfield is not None):
calibrated_images = perform_flatfield_correction(calibrated_images, cal_flatfield)
if (step_flatfield_calibration is True and cal_flatfield is not None):
calibrated_images = perform_flatfield_calibration(calibrated_images, cal_flatfield)

# apply the rayleighs conversion
if (step_rayleighs_conversion is True and cal_rayleighs is not None):
if (step_rayleighs_calibration is True and cal_rayleighs is not None):
calibrated_images = perform_rayleighs_correction(calibrated_images, cal_rayleighs, exposure_length_sec)

# return
return calibrated_images</code></pre>
</details>
</dd>
<dt id="pyaurorax.tools.calibration.trex_nir"><code class="name flex">
<span>def <span class="ident">trex_nir</span></span>(<span>images: numpy.ndarray, cal_flatfield: Optional[pyucalgarysrs.data.classes.Calibration] = None, cal_rayleighs: Optional[pyucalgarysrs.data.classes.Calibration] = None, step_dark_frame_correction: bool = True, step_flatfield_correction: bool = True, step_rayleighs_conversion: bool = True, exposure_length_sec: float = 5.0) ‑> numpy.ndarray</span>
<span>def <span class="ident">trex_nir</span></span>(<span>images: numpy.ndarray, cal_flatfield: Optional[pyucalgarysrs.data.classes.Calibration] = None, cal_rayleighs: Optional[pyucalgarysrs.data.classes.Calibration] = None, step_dark_frame_correction: bool = True, step_flatfield_calibration: bool = True, step_rayleighs_calibration: bool = True, exposure_length_sec: float = 5.0) ‑> numpy.ndarray</span>
</code></dt>
<dd>
<div class="desc"><p>Apply various calibration adjustments to a single or set of images raw images.</p>
Expand All @@ -185,13 +185,13 @@ <h2 id="args">Args</h2>
the <code>step_flatfield_corection</code> is set to True.</dd>
<dt><strong><code>cal_rayleighs</code></strong> :&ensp;<code><a title="pyaurorax.data.ucalgary.Calibration" href="../../data/ucalgary/index.html#pyaurorax.data.ucalgary.Calibration">Calibration</a></code></dt>
<dd>Calibration object containing the Rayleighs data to utilize. This field is required if
the <code>step_rayleighs_conversion</code> is set to True.</dd>
the <code>step_rayleighs_calibration</code> is set to True.</dd>
<dt><strong><code>step_dark_frame_correction</code></strong> :&ensp;<code>bool</code></dt>
<dd>Perform the dark frame correction step. Defaults to <code>True</code>.</dd>
<dt><strong><code>step_flatfield_correction</code></strong> :&ensp;<code>bool</code></dt>
<dt><strong><code>step_flatfield_calibration</code></strong> :&ensp;<code>bool</code></dt>
<dd>Perform the flatfield correction step. Defaults to <code>True</code>. Note that the <code>cal_flatfield</code> parameter
must be supplied if this is True.</dd>
<dt><strong><code>step_rayleighs_conversion</code></strong> :&ensp;<code>bool</code></dt>
<dt><strong><code>step_rayleighs_calibration</code></strong> :&ensp;<code>bool</code></dt>
<dd>Perform the Rayleighs conversion step. Defaults to <code>True.</code> Note that the <code>cal_rayleighs</code> parameter
must be supplied if this is True.</dd>
<dt><strong><code>exposure_length_sec</code></strong> :&ensp;<code>float</code></dt>
Expand All @@ -217,8 +217,8 @@ <h2 id="raises">Raises</h2>
cal_flatfield: Optional[Calibration] = None,
cal_rayleighs: Optional[Calibration] = None,
step_dark_frame_correction: bool = True,
step_flatfield_correction: bool = True,
step_rayleighs_conversion: bool = True,
step_flatfield_calibration: bool = True,
step_rayleighs_calibration: bool = True,
exposure_length_sec: float = 5.0,
) -&gt; np.ndarray:
&#34;&#34;&#34;
Expand All @@ -232,13 +232,13 @@ <h2 id="raises">Raises</h2>
the `step_flatfield_corection` is set to True.
cal_rayleighs (pyaurorax.data.ucalgary.Calibration):
Calibration object containing the Rayleighs data to utilize. This field is required if
the `step_rayleighs_conversion` is set to True.
the `step_rayleighs_calibration` is set to True.
step_dark_frame_correction (bool):
Perform the dark frame correction step. Defaults to `True`.
step_flatfield_correction (bool):
step_flatfield_calibration (bool):
Perform the flatfield correction step. Defaults to `True`. Note that the `cal_flatfield` parameter
must be supplied if this is True.
step_rayleighs_conversion (bool):
step_rayleighs_calibration (bool):
Perform the Rayleighs conversion step. Defaults to `True.` Note that the `cal_rayleighs` parameter
must be supplied if this is True.
exposure_length_sec (float):
Expand All @@ -256,9 +256,9 @@ <h2 id="raises">Raises</h2>
ValueError: issues encountered with supplied parameters.
&#34;&#34;&#34;
# verify that we have everything we need for each requested step
if (step_flatfield_correction is True and cal_flatfield is None):
if (step_flatfield_calibration is True and cal_flatfield is None):
raise ValueError(&#34;The cal_flatfield parameter must be supplied to perform the flatfield correction step&#34;)
if (step_rayleighs_conversion is True and cal_rayleighs is None):
if (step_rayleighs_calibration is True and cal_rayleighs is None):
raise ValueError(&#34;The cal_rayleighs parameter must be supplied to perform the rayleighs conversion step&#34;)

# init
Expand All @@ -271,11 +271,11 @@ <h2 id="raises">Raises</h2>
calibrated_images = perform_dark_frame_correction(images, 5)

# apply the flatfield correction
if (step_flatfield_correction is True and cal_flatfield is not None):
calibrated_images = perform_flatfield_correction(calibrated_images, cal_flatfield)
if (step_flatfield_calibration is True and cal_flatfield is not None):
calibrated_images = perform_flatfield_calibration(calibrated_images, cal_flatfield)

# apply the rayleighs conversion
if (step_rayleighs_conversion is True and cal_rayleighs is not None):
if (step_rayleighs_calibration is True and cal_rayleighs is not None):
calibrated_images = perform_rayleighs_correction(calibrated_images, cal_rayleighs, exposure_length_sec)

# return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,14 @@ <h1 class="title">Module <code>pyaurorax.tools.classes.montage</code></h1>
Timestamps corresponding to each montage image.
&#34;&#34;&#34;

def __init__(self, data: np.ndarray, timestamp: List[datetime.datetime]):
def __init__(self, data: np.ndarray, timestamp: List[datetime.datetime], n_channels: int):
# public vars
self.data = data
self.timestamp = timestamp

# private vars
self.__n_channels = n_channels

def __str__(self) -&gt; str:
return self.__repr__()

Expand Down Expand Up @@ -160,12 +163,12 @@ <h1 class="title">Module <code>pyaurorax.tools.classes.montage</code></h1>

# for each image
for ax, i in zip(axs.flat, range(0, len(self.timestamp))):
if (len(self.data.shape) == 3):
if (self.__n_channels == 1):
# single channel
ax.imshow(self.data[:, :, i], cmap=cmap, origin=&#34;lower&#34;, interpolation=&#34;nearest&#34;)
elif (len(self.data.shape) == 4):
elif (self.__n_channels == 3):
# single channel
ax.imshow(self.data[:, :, i], cmap=cmap, origin=&#34;lower&#34;, interpolation=&#34;nearest&#34;)
ax.imshow(self.data[:, :, :, i], cmap=cmap, origin=&#34;lower&#34;, interpolation=&#34;nearest&#34;)
else:
raise ValueError(&#34;Can only plot 3 or 4 dimensional data (series of single-channel or RGB mages), but found data of shape %s&#34; %
(self.data.shape))
Expand All @@ -176,7 +179,7 @@ <h1 class="title">Module <code>pyaurorax.tools.classes.montage</code></h1>
if (timestamps_display is True):
ax.text(
int(np.floor(self.data.shape[1] / 2.)),
0.5,
5,
self.timestamp[i].strftime(timestamps_format),
ha=&#34;center&#34;,
fontsize=timestamps_fontsize,
Expand Down Expand Up @@ -232,7 +235,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
<dl>
<dt id="pyaurorax.tools.classes.montage.Montage"><code class="flex name class">
<span>class <span class="ident">Montage</span></span>
<span>(</span><span>data: numpy.ndarray, timestamp: List[datetime.datetime])</span>
<span>(</span><span>data: numpy.ndarray, timestamp: List[datetime.datetime], n_channels: int)</span>
</code></dt>
<dd>
<div class="desc"><p>Class representation for a montage</p>
Expand Down Expand Up @@ -260,11 +263,14 @@ <h2 id="attributes">Attributes</h2>
Timestamps corresponding to each montage image.
&#34;&#34;&#34;

def __init__(self, data: np.ndarray, timestamp: List[datetime.datetime]):
def __init__(self, data: np.ndarray, timestamp: List[datetime.datetime], n_channels: int):
# public vars
self.data = data
self.timestamp = timestamp

# private vars
self.__n_channels = n_channels

def __str__(self) -&gt; str:
return self.__repr__()

Expand Down Expand Up @@ -354,12 +360,12 @@ <h2 id="attributes">Attributes</h2>

# for each image
for ax, i in zip(axs.flat, range(0, len(self.timestamp))):
if (len(self.data.shape) == 3):
if (self.__n_channels == 1):
# single channel
ax.imshow(self.data[:, :, i], cmap=cmap, origin=&#34;lower&#34;, interpolation=&#34;nearest&#34;)
elif (len(self.data.shape) == 4):
elif (self.__n_channels == 3):
# single channel
ax.imshow(self.data[:, :, i], cmap=cmap, origin=&#34;lower&#34;, interpolation=&#34;nearest&#34;)
ax.imshow(self.data[:, :, :, i], cmap=cmap, origin=&#34;lower&#34;, interpolation=&#34;nearest&#34;)
else:
raise ValueError(&#34;Can only plot 3 or 4 dimensional data (series of single-channel or RGB mages), but found data of shape %s&#34; %
(self.data.shape))
Expand All @@ -370,7 +376,7 @@ <h2 id="attributes">Attributes</h2>
if (timestamps_display is True):
ax.text(
int(np.floor(self.data.shape[1] / 2.)),
0.5,
5,
self.timestamp[i].strftime(timestamps_format),
ha=&#34;center&#34;,
fontsize=timestamps_fontsize,
Expand Down Expand Up @@ -550,12 +556,12 @@ <h2 id="raises">Raises</h2>

# for each image
for ax, i in zip(axs.flat, range(0, len(self.timestamp))):
if (len(self.data.shape) == 3):
if (self.__n_channels == 1):
# single channel
ax.imshow(self.data[:, :, i], cmap=cmap, origin=&#34;lower&#34;, interpolation=&#34;nearest&#34;)
elif (len(self.data.shape) == 4):
elif (self.__n_channels == 3):
# single channel
ax.imshow(self.data[:, :, i], cmap=cmap, origin=&#34;lower&#34;, interpolation=&#34;nearest&#34;)
ax.imshow(self.data[:, :, :, i], cmap=cmap, origin=&#34;lower&#34;, interpolation=&#34;nearest&#34;)
else:
raise ValueError(&#34;Can only plot 3 or 4 dimensional data (series of single-channel or RGB mages), but found data of shape %s&#34; %
(self.data.shape))
Expand All @@ -566,7 +572,7 @@ <h2 id="raises">Raises</h2>
if (timestamps_display is True):
ax.text(
int(np.floor(self.data.shape[1] / 2.)),
0.5,
5,
self.timestamp[i].strftime(timestamps_format),
ha=&#34;center&#34;,
fontsize=timestamps_fontsize,
Expand Down
Loading

0 comments on commit 5c44703

Please sign in to comment.