Skip to content

Commit

Permalink
#159 fix flake8 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Bradley Augstein authored and Bradley Augstein committed Jun 12, 2024
1 parent b62c9f3 commit 49da57b
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions glass/observations.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,58 +33,55 @@
import numpy as np
import healpy as hp
import math

from typing import Optional, Tuple, List
from numpy.typing import ArrayLike

from .core.array import cumtrapz


def vmap_full(nside: int) -> np.ndarray:

'''visibility map for full sky
Parameters
----------
nside : int
The NSIDE parameter of the resulting HEALPix map.
Returns
-------
vis : array_like
A HEALPix :term:`visibility map`.
'''

m = np.ones(hp.nside2npix(nside))
return m


def vmap_disc(nside: int, coords: Tuple[float, float] = (60, 60),
radius: float = 20) -> np.ndarray:
radius: float = 20) -> np.ndarray:

'''visibility map for a disc on the full sky
Parameters
----------
nside : int
The NSIDE parameter of the resulting HEALPix map.
coords : Tuple[float, float]
colatitude and longitude in degress
Returns
-------
vis : array_like
A HEALPix :term:`visibility map`.
'''

vec = hp.ang2vec(coords[0]/180*np.pi, coords[1]/180*np.pi)
ipix_disc = hp.query_disc(nside=nside, vec=vec, radius=np.radians(radius))
m = np.zeros(hp.nside2npix(nside))
m[ipix_disc] = 1
return m


def vmap_galactic_ecliptic(nside: int, galactic: Tuple[float, float] = (30, 90),
ecliptic: Tuple[float, float] = (20, 80)
) -> np.ndarray:
Expand Down Expand Up @@ -119,7 +116,7 @@ def vmap_galactic_ecliptic(nside: int, galactic: Tuple[float, float] = (30, 90),
raise TypeError('ecliptic stripe must be a pair of numbers')

m = np.ones(hp.nside2npix(nside))
#m[hp.query_strip(nside, *galactic)] = 0
m[hp.query_strip(nside, *galactic)] = 0
m = hp.Rotator(coord='GC').rotate_map_pixel(m)
m[hp.query_strip(nside, *ecliptic)] = 0
m = hp.Rotator(coord='CE').rotate_map_pixel(m)
Expand Down

0 comments on commit 49da57b

Please sign in to comment.