Skip to main content

Spherical implementation of the Rolling Hough Transform

Project description


sphericalrht is a fast, efficient implementation of the Rolling Hough Transform that runs directly on the sphere, using spherical harmonic convolutions. The documentation can be found at readthedocs and the package is distributed over PyPI.

Installation

Run the following in a terminal to install:

pip install sphericalrht

If installing on a computing cluster, you may want to run the following instead:

pip install sphericalrht --user

Note that the sphericalrht package requires at least Python 3.7.

Usage

The code runs in parallel on as many CPUs as available, so feel free to request many CPUs when submitting a job. The only input parameters that affect the runtime and memory are nside and norients. Here's an example of how to run the algorithm and read in the results:

from sphericalrht import CubeAndStokes

cube_and_stokes = CubeAndStokes(
    in_map="/path/to/input_map.fits",       # Input .fits map
    nside=1024,                             # NSIDE of output maps
    out_dir="/path/to/output_directory",    # Directory to save results in
    wlen=75,                                # window diameter [arcmins]
    fwhm=30,                                # high-pass filter scale [arcmins]
    thresh=0.7,                             # threshold fraction (0-1)
    norients=100)                           # number of orientation angles

cube_and_stokes.build_and_save()


# Load the output maps
import healpy as hp

I, Q, U = hp.read_map("/path/to/output_maps.fits", field=(0,1,2))


# Optionally, load the output of all orientation angles for each pixel
import h5py

with h5py.File("/path/to/output_cube.h5") as cube_file:
    spherical_rht_out = cube_file["spherical_rht_cube"][:, PIXEL_INDEX]

References & Attribution

The paper introducing this package is in preparation. If you make use of this code in your research, please contact halalgeorge@gmail.com for discussing proper citations.

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

sphericalrht-1.0.4.tar.gz (21.9 kB view hashes)

Uploaded Source

Built Distribution

sphericalrht-1.0.4-py3-none-any.whl (9.6 kB view hashes)

Uploaded Python 3

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