Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to TiledDataset for missing, irregular or overlapping tiles #487

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion dkist/io/asdf/converters/tiled_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,23 @@ class TiledDatasetConverter(Converter):
tags = [
"tag:dkist.nso.edu:dkist/tiled_dataset-0.1.0",
"asdf://dkist.nso.edu/tags/tiled_dataset-1.0.0",
"asdf://dkist.nso.edu/tags/tiled_dataset-1.1.0",
]
types = ["dkist.dataset.tiled_dataset.TiledDataset"]

def from_yaml_tree(cls, node, tag, ctx):
from dkist.dataset.tiled_dataset import TiledDataset

return TiledDataset(node["datasets"], node["inventory"])
try:
mask = node["mask"]
except KeyError:
mask = None
SolarDrew marked this conversation as resolved.
Show resolved Hide resolved

return TiledDataset(node["datasets"], node["inventory"], mask)

def to_yaml_tree(cls, tiled_dataset, tag, ctx):
tree = {}
tree["inventory"] = tiled_dataset._inventory
tree["datasets"] = tiled_dataset._data.tolist()
tree["mask"] = tiled_dataset._data.mask.tolist()
SolarDrew marked this conversation as resolved.
Show resolved Hide resolved
return tree
35 changes: 35 additions & 0 deletions dkist/io/asdf/resources/schemas/tiled_dataset-1.1.0.yaml
SolarDrew marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
%YAML 1.1
---
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01"
id: "asdf://dkist.nso.edu/schemas/tiled_dataset-1.0.0"

title: |
A DKIST Tiled Dataset object.
description:
The container for a set of Dataset objects.

type: object
properties:
datasets:
description: A nested structure of Dataset objects
type: array
items:
type: array
items:
anyOf:
- tag: "asdf://dkist.nso.edu/tags/dataset-1.*"
- null: true
inventory:
description: A copy of the inventory record for this dataset.
type: object
mask:
description: A mask to indicate if invalid or missing Datasets should be ignored.
type: array
items:
type: array
items:
- type: boolean

required: [datasets, inventory, mask]
additionalProperties: false
...
Loading