Граф коммитов

366 Коммитов

Автор SHA1 Сообщение Дата
Peter Williams c2414918e5 toasty/io.py: document the data returned by read_image() 2020-06-16 16:44:24 -04:00
Peter Williams 9a6180cbc0 toasty/pipeline.py: when reindexing, skip folders without index.wtml 2020-03-31 14:11:57 -04:00
Peter Williams b1dd50543f
Merge pull request #12 from pkgw/skip-done
pipeline: skip already-done images
2020-03-21 18:27:10 -04:00
Peter Williams 30fc3989e5 toasty/pipeline.py: I guess we can skip the "pass" statements when there are docstrings 2020-03-21 17:17:53 -04:00
Peter Williams 10e0acbeda toasty/pipeline.py: in fetch-inputs, report stats on candidate and cached images 2020-03-21 16:59:06 -04:00
Peter Williams 5ffd7fdd6c toasty/pipeline.py: also add a mechanism to skip unprocessed images 2020-03-21 16:57:10 -04:00
Peter Williams 441393e37f toasty/pipeline.py: don't attempt to re-process images that have already been processed
Just check whether they've got an index.wtml in the repository.
2020-03-21 16:50:40 -04:00
Peter Williams 42ffe9592b
Merge pull request #11 from pkgw/pipeline
Add the AstroPix pipeline
2020-03-20 21:52:35 -04:00
Peter Williams 43230df3f7 toasty/tests/test_pipeline.py: try to inch up the cli.py coverage 2020-03-20 21:37:00 -04:00
Peter Williams 0697b8e731 .travis.yml: give up on Python 3.6
datetime.fromisoformat was only introduced in 3.7, and I don't feel like
jumping through any hoops to try to maintain compatibility with older versions
at the moment.
2020-03-20 21:32:10 -04:00
Peter Williams 7330ea91af toasty/tests/test_pipeline.py: add a super minimal, hacky test 2020-03-20 20:50:14 -04:00
Peter Williams 7e20770263 toasty/tests/test_study.py: update XML to track new wwt_data_formats behavior 2020-03-20 19:08:37 -04:00
Peter Williams a7022564e7 docs/pipeline.rst: document this whole pipeline business 2020-03-20 18:53:51 -04:00
Peter Williams 9456459c96 docs: integrate new toasty.pipeline module 2020-03-18 00:22:43 -04:00
Peter Williams a8d2d4fe57 toasty/cli.py: add the pipeline-reindex command 2020-03-18 00:13:51 -04:00
Peter Williams b9e7ed287d toasty/pipeline.py: make the local backend writeable, and add list_items()
The new ABC method will be usefil for the final stage of the pipeline.
2020-03-18 00:13:23 -04:00
Peter Williams 69207a1932 toasty/pipeline.py: turns out we can do some helpful normalization of the AstroPix modtimes 2020-03-17 23:49:11 -04:00
Peter Williams 8292d6a8b9 toasty/cli.py: better metavariables for some of the pipeline CLI interfaces 2020-03-17 23:48:27 -04:00
Peter Williams 07d6a0ce59 toasty/cli.py: update for wwt_data_formats 0.1.0 2020-03-17 23:47:55 -04:00
Peter Williams 24de2dd74e toasty/pipeline.py: sketchy hack to embed modification times in the WTMLs 2020-03-09 14:52:01 -04:00
Peter Williams af4a3f9818 docs: update 2020-03-09 14:35:35 -04:00
Peter Williams caaf2ffc20 toasty/pipeline.py: work out a scheme for testing and publishing 2020-03-09 14:35:22 -04:00
Peter Williams 19f827a3fe toasty/pipeline.py: add the "publish" pipeline stage 2020-03-09 13:33:00 -04:00
Peter Williams b5f2010328 toasty/pipeline.py: provide explanations with NotActionableErrors 2020-03-09 13:04:57 -04:00
Peter Williams bd3acaa887 toasty/pipeline.py: initial work on this
A framework for pipeline image processing and WMTL-ization, since we
expect/want this to be a common use case for `toasty`.
2020-03-09 12:26:24 -04:00
Peter Williams 4e5d74e902 toasty/pyramid.py: support a second pyramid hierarchy scheme 2020-03-07 23:49:12 -05:00
Peter Williams 8f5af1f311 toasty: remove some unneeded imports 2020-03-07 16:40:23 -05:00
Peter Williams 2bcd73f74c toasty/study.py: add a make_thumbnail_bitmap utility function 2020-03-07 16:38:55 -05:00
Peter Williams 5ba5b2c850
Merge pull request #10 from pkgw/basic-study
Basic support for "study" images
2020-02-25 16:21:55 -05:00
Peter Williams 3de5971159 Rewrite docs and README to reflect toasty's broader applications 2020-02-25 16:07:08 -05:00
Peter Williams f5685df0b5 toasty/tests/test_study.py: add some tests for the study module 2020-02-25 15:37:14 -05:00
Peter Williams b479055ab9 toasty/tests/NGC253ALMA.jpg: add this test resource file
Source:
https://public.nrao.edu/gallery/alma-sees-starbursting-clouds-inside-ngc-253/
. Credit: B. Saxton (NRAO/AUI/NSF); ALMA (NRAO/ESO/NAOJ); A. Leroy.

This file is convenient since it's big enough to be worth tiling in WWT *and*
it contains AVM metadata. And it's not super large as these things go.
2020-02-25 15:21:01 -05:00
Peter Williams afbb4d8b07 toasty/tests/__init__.py: centralize some test infrastructure here 2020-02-25 15:13:14 -05:00
Peter Williams 57d25d0f86 toasty/pyramid.py: centralize next_highest_power_of_2() here 2020-02-25 15:07:54 -05:00
Peter Williams ce23d70e11 toasty/multi_tan.py: remove execute bit 2020-02-25 15:04:58 -05:00
Peter Williams f757f25f10 .travis.yml: stop CI'ing on Python 2.7 2020-02-21 19:55:08 -05:00
Peter Williams 7b8cc2257d toasty/merge.py: get the "cascade" proces to work with RGB image tiles
We need to do a better job of ignoring nonexistent tiles, and also be careful
about handling whether the existing tiles have 3 or 4 color channels (e.g, RGB
vs. RGBA) in them.
2020-02-21 19:35:22 -05:00
Peter Williams 53f2370adf Add study-sample-image-tiles subcommand
This takes a big RGB image, loads it into memory, and breaks it into tiles for
future visualization as a WWT "study". The process is pretty straightforward
because it is not actually necessary to know anything about the image
coordinates on the sky, or do any downsampling.
2020-02-21 18:07:29 -05:00
Peter Williams 1b59a1e649 toasty/io.py: rename read_png() to the more correct read_image() 2020-02-21 16:33:54 -05:00
Peter Williams 96cef477f2 Start depending on wwt_data_formats 2020-02-20 16:54:31 -05:00
Peter Williams 5f1154a863
Merge pull request #9 from pkgw/acknowledgments
Acknowledge additional sources of support
2019-09-15 21:06:58 -04:00
Peter Williams 1b2afd8986 Acknowledge additional sources of support 2019-09-15 20:42:11 -04:00
Peter Williams 5d2246c6d6
Merge pull request #8 from pkgw/tests
Replace the test data suite
2019-09-06 22:20:00 -04:00
Peter Williams 2a7dc3bffc Beef up the tests and get that coverage up! 2019-09-06 22:07:41 -04:00
Peter Williams 1d3e2b891b toasty/tests/test_toast.py: re-add the Galactic HEALPix test
There was a script to do the resampling, so this was easier to get back
than I expected. Here's what I ran:

```
import numpy as np
import healpy as hp
from astropy.coordinates import Galactic, ICRS
import astropy.units as u

nest = True
map = hp.read_map('earth_healpix_equ.fits', nest=nest)

theta, phi = hp.pix2ang(64, np.arange(map.size), nest)
l, b = phi, np.pi / 2 - theta

g = Galactic(l * u.rad, b * u.rad)
f = g.transform_to(ICRS)
ra, dec = f.ra.rad, f.dec.rad

map = hp.get_interp_val(map, np.pi / 2 - dec, ra, nest)

hp.write_map('earth_healpix_gal.fits', map, nest=nest, coord='G', fits_IDL=False, column_names='I')
```
2019-09-06 21:20:05 -04:00
Peter Williams 09272ae9b3 toasty/tests: revamp the test data
The images used in the test data set were based on the famous "Lena" test
image, which -- besides not being helpful for providing an intuitive grasp of
the spherical projections at play -- is now widely recognized as problematic.

So, we have replaced these images with new ones. The basis image is
`Equirectangular_projection_SW-tweaked.jpg`, which is derived from the
following Wikimedia asset:
<https://commons.wikimedia.org/wiki/File:Equirectangular_projection_SW.jpg>,
associated with <https://en.wikipedia.org/wiki/Equirectangular_projection>.
The recommended Wikimedia credit line is: Strebe - Own work, CC BY-SA 3.0,
<https://commons.wikimedia.org/w/index.php?curid=16115228>. I modified the
image by cropping a small border and resizing to a reasonable size for the Git
repository.

I created a HEALPixified version of this image, which is in a plate carree
projection, with the following script:

```
import healpy as hp
from matplotlib.image import pil_to_array
import numpy as np
from PIL import Image

IMG_PATH = 'toasty/tests/Equirectangular_projection_SW-tweaked.jpg'
NSIDE = 64

array = pil_to_array(Image.open(IMG_PATH))
grayscale = (array.sum(axis=2) // 3).astype(np.uint8)
colat = np.linspace(0, np.pi, grayscale.shape[0])[:, None]
lon = np.linspace(np.pi, -np.pi, grayscale.shape[1])
pix = hp.ang2pix(NSIDE, colat, lon)
healpix = np.zeros(hp.nside2npix(NSIDE), dtype=grayscale.dtype)
healpix[pix] = grayscale
hp.fitsfunc.write_map('healpix.fits', healpix, fits_IDL=False, column_names='I')
```

I haven't yet bothered with a version in Galactic coordinates, so I removed
the corresponding test case. I also removed the `test_planet` files which I
were unused.
2019-09-06 21:07:51 -04:00
Peter Williams 532a2beab4 toasty/cli.py: add some new CLI commands
Coincidentally these are the ones I need to update the data files in the test
suite. But they cover a nice range of use cases.
2019-09-06 21:02:48 -04:00
Peter Williams ca8be9e3c5 toasty/merge.py: new module collecting tile-merge logic 2019-09-06 21:00:03 -04:00
Peter Williams 0cdb247cb3 toasty/toast.py: add a structured sampler class 2019-09-06 20:37:48 -04:00
Peter Williams 75359c5663 toasty/pyramid.py: add some more utilities for generic pyramids 2019-09-06 20:35:28 -04:00