Code Monkey home page Code Monkey logo

healmex's Introduction

healmex

A package providing Matlab bindings to the HEALPix C++ package.

Build Requirements

  • GCC 7+ (or a compiler which supports C++17's structured bindings)
  • Matlab R2019b+
  • CMake 3.9.0+
  • pkg-config (or pkgconf)
  • Internet connection (to download HEALPix sources)
    • HEALPix v3.60 is used
  • HEALPix's build requirements, such as:
    • GNU Autotools (autoreconf, make, etc)
    • CFITSIO

At this time, compilation and use on Linux is the only tested and supported platform.

It is not planned to provide support for any versions of Matlab older than R2018a since it is the first version which provides the interleaved complex data storage format. This new option finally provides a format compatible with standard complex data types (e.g. double complex in C and complex<double> in C++). In Matlab's prior format, complex arrays must be duplicated (doubling memory requirements) and copied on each entrance/exit across the Matlab/C++ boundary.

Installation Instructions

The repository can be cloned via git from GitHub:

$ git clone https://github.com/jmert/healmex.git

Configuration is performed via CMake's cmake or ccmake commands. For non-interactive use, the installation prefix (where the compiled MEX function and associated Matlab scripts) are installed to can be configured with:

$ cmake -DCMAKE_INSTALL_PREFIX=~/matlab/healmex

where ~/matlab/healmex can be any other path of your choice. Then to build and install

$ make && make install

The build will start by downloading HEALPix, unpacking it, and compiling the C++ library. (The C and Fortran components are not built!) After that, the MEX function bindings to HEALPix's C++ APIs are compiled.

To use within Matlab, the installation path should be added into Matlab's runtime path:

>> addpath('~/matlab/healmex')

Adding a similar line to your startup.m file may be useful.

Configuration Options

The following are available options which can be set during configuration. Each should be set in either the interact ccmake prompt or via a CMake variable definition with cmake -DVAR=VALUE.

  • ASPACKAGE: Defaults to ON. If ON, the package is installed as a Matlab package. Otherwise if OFF, the package is installed as a flat set of functions.

Usage

If installed as a Matlab package, the bindings in Matlab are presented as methods within the healmex package namespace.

Help is available for each binding

>> help healmex.pix2ang
  [theta, phi] = pix2ang(nside, ipix, varargin)

  INPUTS
    nside       The HEALPix Nside parameter.
    ipix        Pixel indices.
  ...

with descriptions of the calling convention for each binding. For example, a call to pix2ang to convert pixel 72 in an Nside = 4 map to θ and φ coordinates is accomplished with a call like:

>> [th,ph] = healmex.pix2ang(4, 74)

th =

    1.4033


ph =

    0.7854

If installed in the flat form, the healmex. prefix from calls should be removed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.