logical-0.7.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
    • 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-0.7.0>
  compareto: 10
  condition: LT
  value: .nan

Original Schema

%YAML 1.1
---
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01"
id: "http://stsci.edu/schemas/jwst_pipeline/logical-0.7.0"
tag: "tag:stsci.edu:jwst_pipeline/logical-0.7.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-0.7.0>
          compareto: 10
          condition: LT
          value: .nan

allOf:
  - $ref: "tag:stsci.edu:asdf/transform/transform-1.1.0"
  - type: object
    properties:
      condition:
        description: |
          A string representing the logical operation,
          one of GT, LT, NE, EQ
        type: string
      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:
          - $ref: "tag:stsci.edu:asdf/core/ndarray-1.0.0"
          - type: number
      value:
        description: |
          Value to substitute where condition is True.
        anyOf:
          - $ref: "tag:stsci.edu:asdf/core/ndarray-1.0.0"
          - type: number