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
# coding: utf-8 | |
from astropy.io import fits | |
from astropy.io.fits import HDUList, ImageHDU | |
from asdf.fits_embed import AsdfInFits | |
import numpy as np | |
get_ipython().run_line_magic('rm', '-f asdf.fits') | |
image = ImageHDU(np.random.random(1000)) | |
hdulist = HDUList() |
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
#!/usr/bin/env python | |
import asdf | |
from astropy import units as u | |
from astropy.coordinates.representation import SphericalRepresentation | |
tree = {'coord': SphericalRepresentation(10*u.deg, 10*u.deg, 1*u.m)} | |
print('distance:', tree['coord'].distance) | |
with asdf.AsdfFile(tree=tree) as ff: | |
ff.write_to("test.asdf") |
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
name: asdf-test-env | |
channels: | |
dependencies: | |
- python=3.5 | |
- ipython | |
- pytest | |
- numpy>=1.13 | |
- pip: | |
- git+https://github.com/cadair/astropy@asdf_tags_coords#egg=astropy | |
- git+https://github.com/spacetelescope/asdf#egg=asdf |
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
#!/usr/bin/env python | |
from argparse import ArgumentParser | |
from multiprocessing import Process, Array, Pipe, Queue | |
from timeit import default_timer as timer | |
import numpy as np | |
def process_with_array(dest, source): | |
input_data = np.array(source, copy=False, dtype=float) |
NewerOlder