logical-1.0.0

A model performing logical operations on arrays.

Outline

Schema Definitions

This node must validate against all of the following:

  • This type is an object with the following properties:

    • condition

      string

      A string representing the logical operation, one of GT, LT, NE, EQ

      No length restriction

      Only the following values are valid for this node:

      • GT

      • LT

      • NE

      • EQ

    • compareto

      object

      A number or ndarray to compare to using the condition. If ndarray then the input array, compareto and value should have the same shape.

      This node must validate against any of the following:

    • value

      object

      Value to substitute where condition is True.

      This node must validate against any of the following:

Examples

If the input is less that 10, set its value to NaN.:

!<tag:stsci.edu:jwst_pipeline/logical-1.0.0>
  compareto: 10
  condition: LT
  value: .nan

If the input is less that [1,2,3,4], set its value to [5,6,7,8]. The input array should have the same shape. :

!<tag:stsci.edu:jwst_pipeline/logical-1.0.0>
  compareto: [1 ,2, 3, 4]
  condition: LT
  value: [5, 6, 7, 8]

Original Schema

%YAML 1.1
---
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01"
id: "http://stsci.edu/schemas/jwst_pipeline/logical-1.0.0"
title: >
  A model performing logical operations on arrays.

examples:
  -
    - If the input is less that 10, set its value to NaN.

    - |
        !<tag:stsci.edu:jwst_pipeline/logical-1.0.0>
          compareto: 10
          condition: LT
          value: .nan
  -
    - |
        If the input is less that [1,2,3,4], set its value to [5,6,7,8].
        The input array should have the same shape.

    - |
        !<tag:stsci.edu:jwst_pipeline/logical-1.0.0>
          compareto: [1 ,2, 3, 4]
          condition: LT
          value: [5, 6, 7, 8]


allOf:
  - $ref: "http://stsci.edu/schemas/asdf/transform/transform-1.2.0"
  - type: object
    properties:
      condition:
        description: |
          A string representing the logical operation,
          one of GT, LT, NE, EQ
        type: string
        enum: [GT, LT, NE, EQ]
      compareto:
        description: |
          A number or ndarray to compare to using the condition.
          If ndarray then the input array, compareto and value should have the same shape.
        anyOf:
          - tag: "tag:stsci.edu:asdf/core/ndarray-*"
          - type: array
          - type: number
      value:
        description: |
          Value to substitute where condition is True.
        anyOf:
          - tag: "tag:stsci.edu:asdf/core/ndarray-*"
          - type: array
          - type: number