Skip to content

Commit

Permalink
Release commit created with Cranko.
Browse files Browse the repository at this point in the history
+++ cranko-release-info-v1
[[projects]]
qnames = ["toasty", "pypa"]
version = "0.9.0"
age = 0

+++
  • Loading branch information
cranko committed Aug 25, 2021
2 parents cf78e15 + 046fea2 commit add47e9
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# toasty 0.9.0 (2021-08-25)

- Add a `plate-caree-panorama` projection mode to the `tile-allsky` command
(#55, @astrodavid10).


# toasty 0.8.0 (2021-08-19)

- Add a `--name` argument to the `tile-wwtl` command (#53, #54, @astrodavid10,
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/tile-allsky.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ mapped on to the image. Allowed types are:
the right. This is the format in which planetary maps are typically
represented. If you use this option when you should have used
``plate-carree``, or vice versa, your map come out flipped horizontally.
- ``plate-carree-panorama`` — like the default “plate carrée” projection, but
the image is interpreted as a 360 degree panoramic image

.. _equirectangular: https://en.wikipedia.org/wiki/Equirectangular_projection

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def get_long_desc():

setup_args = dict(
name = 'toasty', # cranko project-name
version = '0.8.0', # cranko project-version
version = '0.9.0', # cranko project-version
description = 'Generate TOAST image tile pyramids from existing image data',
long_description = get_long_desc(),
long_description_content_type = 'text/markdown',
Expand Down
4 changes: 3 additions & 1 deletion toasty/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,16 @@ def load_from_wwtl(self, cli_settings, wwtl_path, cli_progress=False):
return img


def toast_base(self, sampler, depth, is_planet=False, **kwargs):
def toast_base(self, sampler, depth, is_planet=False, is_pano=False, **kwargs):
from .toast import sample_layer

self._check_no_wcs_yet()
sample_layer(self.pio, sampler, depth, **kwargs)

if is_planet:
self.imgset.data_set_type = DataSetType.PLANET
elif is_pano:
self.imgset.data_set_type = DataSetType.PANORAMA
else:
self.imgset.data_set_type = DataSetType.SKY

Expand Down
8 changes: 7 additions & 1 deletion toasty/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def tile_allsky_getparser(parser):
metavar = 'PROJTYPE',
default = 'plate-carree',
help = 'The projection type of the input image (default: %(default)s; choices: %(choices)s)',
choices = ['plate-carree', 'plate-carree-galactic', 'plate-carree-ecliptic', 'plate-carree-planet'],
choices = ['plate-carree', 'plate-carree-galactic', 'plate-carree-ecliptic', 'plate-carree-planet', 'plate-carree-panorama'],
)
parser.add_argument(
'--parallelism', '-j',
Expand Down Expand Up @@ -173,6 +173,7 @@ def tile_allsky_impl(settings):
img = ImageLoader.create_from_args(settings).load_path(settings.imgpath)
pio = PyramidIO(settings.outdir)
is_planet = False
is_pano = False

if settings.projection == 'plate-carree':
from .samplers import plate_carree_sampler
Expand All @@ -187,6 +188,10 @@ def tile_allsky_impl(settings):
from .samplers import plate_carree_planet_sampler
sampler = plate_carree_planet_sampler(img.asarray())
is_planet = True
elif settings.projection == 'plate-carree-panorama':
from .samplers import plate_carree_sampler
sampler = plate_carree_sampler(img.asarray())
is_pano = True
else:
die('the image projection type {!r} is not recognized'.format(settings.projection))

Expand All @@ -202,6 +207,7 @@ def tile_allsky_impl(settings):
sampler,
settings.depth,
is_planet=is_planet,
is_pano=is_pano,
parallel=settings.parallelism,
cli_progress=True,
)
Expand Down

0 comments on commit add47e9

Please sign in to comment.