Skip to content

Commit

Permalink
Add top level algorithm description
Browse files Browse the repository at this point in the history
  • Loading branch information
Melanie Clarke committed Aug 13, 2023
1 parent 7df8901 commit 460cc9c
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
44 changes: 43 additions & 1 deletion docs/grig/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,49 @@ Grig Documentation
******************

Grig is a fully N-dimensional resampling package for irregularly
gridded data with associated errors.
gridded data with associated errors. It was primarily developed for
generating astronomical image mosaics and spectral image cubes, but has broad
applicability to scientific data arrays with or without associated errors.

Given a cloud of irregularly spaced data points, the resampling algorithm
assigns values to voxels of a regular grid by fitting data points in a local cloud
with a low-order polynomial function, by default. See the figure below for an
illustration.

The resampling algorithm has a wide set of parameters to allow customization to
particular use cases:

- Splines can be used in place of polynomial fits for the local interpolation.
- The convolution kernel may be regular or irregular.
- The kernel size and shape may be fixed or may adapt to the data.

See the :ref:`example section <resample_examples>` for more possible applications, or the
`white paper <https://raw.githubusercontent.com/SOFIA-USRA/grig/main/docs/grig/resampling/paper/Perera.pdf>`__
included with the source distribution for a complete technical description.

.. figure:: resampling/images/resample_algorithm.png
:alt: Left: Observations: Cloud of irregular data points with spatial (x,y) and
spectral (lambda) coordinates. The image shows many irregularly spaced points.
Middle: 1. Model observations as F = f(x, y, lambda) + epsilon where F = flux,
epsilon = error, and f is a polynomial function. 2. For voxel (i, j, k), derive
the local function f by fitting to a localized cloud of samples in the region
of (x-i, y-j, lambda-k). 3. Set F-i-j-k = f(x-i, y-i, lambda-k) where F-i-j-k
is the flux at voxel (i, j, k). The image shows a three dimensional grid containing
a sphere, representing the local datacloud. The sphere contains a small red cube,
representing a single output voxel.
Right: Data Cube: Regularly spaced array of voxels where each voxel element
is at coordinate (x-i, y-j, lambda-k) and i, j, k respectively mark indices
along dimensions x, y, lambda of the cube. The image shows a regular cube with
edges labeled x, y, and lambda, containing a small red cube representing the
voxel from the middle image.
:name: resample_algorithm

Resampling algorithm application to a spectral cube with two spatial dimensions and
one spectral. The algorithm assigns values to voxels of a regular grid by fitting data
points in a local cloud with a low-order polynomial function. Data points in the local
cloud are weighted by distance from the output point and by their associated error
estimates.


Getting Started
===============
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 460cc9c

Please sign in to comment.