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
import requests | |
import yaml | |
old_schema_url = "https://raw.githubusercontent.com/spacetelescope/jwst/e154d67fa415ce526cfd9359ae4330bd56c112a6/jwst/datamodels/schemas/core.schema.yaml" | |
new_schema_url = "https://raw.githubusercontent.com/braingram/jwst/bug/schema_nonunique_enum/jwst/datamodels/schemas/core.schema.yaml" | |
enum_values = [] | |
for url in (old_schema_url, new_schema_url): | |
with requests.get(url) as r: | |
d = yaml.safe_load(r.text) |
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
import io | |
import asdf | |
b = io.BytesIO(b"""#ASDF 1.0.0 | |
#ASDF_STANDARD 1.5.0 | |
%YAML 1.1 | |
%TAG ! tag:stsci.edu:asdf/ | |
--- !core/asdf-1.1.0 |
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
import asdf | |
import jwst.datamodels | |
import numpy | |
af = asdf.AsdfFile({'data': numpy.zeros((10, 10), dtype='f4')}) | |
af.write_to('tmp.asdf') | |
with asdf.open('tmp.asdf', mode='r') as af: | |
m = jwst.datamodels.MultiExposureModel() | |
data = af['data'] | |
assert data.__class__.__name__ == 'NDArrayType' |
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
import os | |
import shutil | |
import time | |
import numpy | |
import zarr | |
n_times = 10 | |
image_size = (4000, 4000, 50) |
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
import copy | |
import pprint | |
import asdf | |
import astropy.time | |
from astropy.units import Quantity | |
import deepdiff | |
from deepdiff.operator import BaseOperator | |
import gwcs | |
from gwcs.converters.tests.test_wcs import _assert_wcs_equal |
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
{"$schema": "asdf://stsci.edu/datamodels/roman/schemas/rad_schema-1.0.0", "id": "asdf://stsci.edu/datamodels/roman/schemas/wfi_image-1.0.0", "title": "The Schema for WFI Level 2 Images.", "datamodel_name": "ImageModel", "archive_meta": "None", "type": "object", "properties": {"meta": {"allOf": [{"$schema": "asdf://stsci.edu/datamodels/roman/schemas/rad_schema-1.0.0", "id": "asdf://stsci.edu/datamodels/roman/schemas/common-1.0.0", "title": "Common metadata properties", "allOf": [{"$schema": "asdf://stsci.edu/datamodels/roman/schemas/rad_schema-1.0.0", "id": "asdf://stsci.edu/datamodels/roman/schemas/basic-1.0.0", "title": "Basic Information", "type": "object", "properties": {"calibration_software_version": {"title": "Calibration Software Version Number", "description": "The version number of the calibration software used in processing this\nfile.\n", "tag": "asdf://stsci.edu/datamodels/roman/tags/calibration_software_version-1.0.0"}, "filename": {"title": "File Name", "description": "The auto-generated name of |
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
import time | |
import numpy as np | |
from scipy.ndimage import binary_dilation, binary_propagation | |
from stdatamodels.jwst.datamodels import dqflags | |
GOOD = dqflags.group["GOOD"] | |
DNU = dqflags.group["DO_NOT_USE"] |