Skip to content

LaeaSkyProj requires extent for full sky plot #77

@rhiannonlynne

Description

@rhiannonlynne

Trying to create a LaeaSkyproj plot I find that

  • If I do not specify extent, then:
    * using zoom=True in draw_hpxmap only shows half of the sky
    * using zoom=False in draw_hpxmap results in a blank plot
  • If I do specify extent, then:
    * using zoom=True shows half the sky, if extent covers less than the full sky.
    * using zoom=False works as expected.
    If extent covers the full sky, then this results in a "ValueError: Axis limits cannot be NaN or Inf". when calling draw_hpxmap.

A small example code (that can swap with_extent True/False, and then zoom could be toggled True/False):

import numpy as np
import healpy as hp
import matplotlib.pyplot as plt
import skyproj

nside = 64
hpmap = np.arange(0, hp.nside2npix(nside), 1)
# mask some part of the sky for 'zoom' (otherwise zoom=True crashes)
ra, dec = hp.pix2ang(nside, hpmap, lonlat=True)
hpmap = hpmap.astype(float)
hpmap[np.where(dec > 60)] = hp.UNSEEN

with_extent = True

fig, ax = plt.subplots()
min_lat = np.degrees(np.arccos(np.finfo(float).resolution))
if with_extent:
    sp = skyproj.LaeaSkyproj(ax=ax, lon_0=0, lat_0=-min_lat, extent = [0, 360, -min_lat, 85])
else:
    sp = skyproj.LaeaSkyproj(ax=ax, lon_0=0, lat_0=-min_lat)
im, lon_raster, lat_raster, values_raster = sp.draw_hpxmap(hpmap, zoom=False)

I might also be missing axes labels?

Image Image Image

This is with skyproj 2.0.3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions