-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from nden/add-polynomials
add polynomial schemas
- Loading branch information
Showing
5 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
%YAML 1.1 | ||
--- | ||
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01" | ||
id: "http://stsci.edu/schemas/asdf/0.1.0/transform/polynomial" | ||
tag: "tag:stsci.edu:asdf/0.1.0/transform/polynomial" | ||
title: > | ||
A Polynomial model. | ||
description: | | ||
A polynomial model represented by its coefficients stored in | ||
an ndarray of shape ``(n+1,)`` for univariate polynomials or ``(n+1, n+1)`` | ||
for polynomials with 2 variables, where ``n`` is the highest total degree | ||
of the polynomial. | ||
:math:`P = \sum_{i, j=0}^{i+j=n}c_{ij} * x^{i} * y^{j}` | ||
Invertability: This transform is not automatically invertible. | ||
examples: | ||
- | ||
- :math:`P = 1.2 + 0.3 * x + 56.1 * x^{2}` | ||
- | | ||
!transform/polynomial | ||
coefficients: !core/ndarray | ||
[1.2, 0.3, 56.1] | ||
- | ||
- :math:`P = 1.2 + 0.3 * x + 3 * x * y + 2.1 * y^{2}` | ||
- | | ||
!transform/polynomial | ||
coefficients: !core/ndarray | ||
[[1.2, 0.0, 2.1], | ||
[0.3, 3.0, 0.0], | ||
[0.0, 0.0, 0.0]] | ||
type: object | ||
properties: | ||
coefficients: | ||
description: | | ||
An array with coefficients. | ||
anyOf: | ||
- $ref: ../core/ndarray | ||
- type: array | ||
required: [coefficients] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
%YAML 1.1 | ||
--- | ||
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01" | ||
id: "http://stsci.edu/schemas/asdf/0.1.0/transform/scale" | ||
tag: "tag:stsci.edu:asdf/0.1.0/transform/scale" | ||
title: > | ||
A Scale model. | ||
description: > | ||
Multiply the input by a factor. | ||
type: object | ||
properties: | ||
factor: | ||
type: number | ||
description: Multiplication factor. | ||
requiredProperties: [factor] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
%YAML 1.1 | ||
--- | ||
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01" | ||
id: "http://stsci.edu/schemas/asdf/0.1.0/transform/shift" | ||
tag: "tag:stsci.edu:asdf/0.1.0/transform/shift" | ||
title: > | ||
A Shift opeartion. | ||
description: > | ||
Apply an offset in one direction. | ||
type: object | ||
properties: | ||
offset: | ||
type: number | ||
description: Offset in one direction. | ||
requiredProperties: [offset] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters