Skip to main content

No project description provided

Project description

hpinterp

A faster (~100x) and more accurate interpolation algorithm for HEALPix maps by Prof. Jonathan Sievers. The code pre-interpolates the map data in advance, saving time at the evaluation stage.

Installation

pip install hpinterp

Example

import numpy as np
import healpy as hp

from hpinterp import InterpMap

map_ = hp.read_map("your_map.fits")

# Set nest=True if your map has nested ordering
interp_map = InterpMap(map_)

# Generating example coordinate grid of co-latitude and longitude in radians
npoints = int(1e5)
theta = np.random.rand(npoints) * np.pi
phi = np.random.rand(2 * npoints) * 2 * np.pi

# Get interpolated values. Set lonlat=True if using longitude and latitude in degrees
interp_result = interp_map(theta, phi)
# or
interp_result = interp_map.get_interp_val(theta, phi)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hpinterp-0.1.2.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

hpinterp-0.1.2-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file hpinterp-0.1.2.tar.gz.

File metadata

  • Download URL: hpinterp-0.1.2.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.10.6 Linux/5.19.0-32-generic

File hashes

Hashes for hpinterp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 37aa848e0c58e6868d21aaa4e3a17ec761a7c5bd55647de061343c7c8a1ca20e
MD5 29ca23b31e26416f1b5bbbf6601d0b49
BLAKE2b-256 b01dac42ade70219fb54f1c819669dd43d9e9cd7cfe8c27c48c6500ca51422fe

See more details on using hashes here.

File details

Details for the file hpinterp-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: hpinterp-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.10.6 Linux/5.19.0-32-generic

File hashes

Hashes for hpinterp-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d8b8a0865e779934c1188d3c5b83359b0d7af9b087a46b68ae7ae206111e9fe5
MD5 21c247f5fb6d06433d7bed3edf67a9e3
BLAKE2b-256 c110297e2c580bc56b97e0e4241fb60aac221eed034ce4383cba2a115b2c569a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page