Code Monkey home page Code Monkey logo

polymv's Introduction

polyMV

ascl:2007.009 GitHub license

polyMV is a Python package that converts multipolar coefficients (alms in healpix order) into Multipole Vectors (MVs) and also Fréchet Vectors (FVs) given a specific multipole.

Any publications making use of polyMV should cite this paper: R. A. Oliveira, T. S. Pereira, and M. Quartin, CMB statistical isotropy confirmation at all scales using multipole vectors, Phys. Dark Univ. 30 (2020) 100608 (arXiv:1812.02654 [astro-ph.CO]).

Checkout MVs and FVs from Planck 2015 and 2018 temperature maps in DOI.

Instalation

polyMV uses MPSolve. MPSolve is a C package that finds roots of polynomials with high speed and precision. Before installing polyMV, compile and install MPSolve:

MPSolve part:

  1. Download MPSolve from source (make sure you have all dependencies):

    git clone https://github.com/robol/MPSolve.git
  2. In MPSolve folder, run:

    bash autogen.sh
  3. Configure:

    ./configure --prefix=<path-to-installation-folder>
  4. Compile in parallel (it's faster):

    make -j 4

    In this case, the compilation will run in 4 threads.

  5. Install MPSolve:

    make install

polyMV part:

  1. Clone this repository:

    git clone https://github.com/oliveirara/polyMV.git
  2. Inside src folder, open mpsolve.py and replace the path for "libmps.so.3" on line 7:

    • on macOS:
    _mps = ctypes.CDLL("libmps.so.3") -> _mps = ctypes.CDLL("<path-to-installation-folder>/MPSolve/lib/libmps.3.dylib")
    • on Linux:
    _mps = ctypes.CDLL("libmps.so.3") -> _mps = ctypes.CDLL("<path-to-installation-folder>/MPSolve/lib/libmps.so.3")

polyMV is implemented to obtain fast roots of polynomials with precision up to 8 digits (about 0.02" on multipole scales). If you need more precision you should change in mpsolve.py file:

  • Line 88:
_mps.mps_context_set_output_prec(self._c_ctx, ctypes.c_long(53)) -> _mps.mps_context_set_output_prec(self._c_ctx, ctypes.c_long(XX))

where XX is the number of bits, not decimals.

  • Line 89:
Goal.MPS_OUTPUT_GOAL_ISOLATE -> Goal.MPS_OUTPUT_GOAL_APPROXIMATE
  1. Install:

    pip install .

You also can add the flag --user to install locally.

Notebooks:

In notebooks folder you will find some examples of how to use polyMV.


This work was funded by Conselho Nacional de Desenvolvimento Científico e Tecnológico (CNPq), Coordenação de Aperfeiçoamento de Pessoal de Nível Superior (CAPES) and Fundação Araucária (PBA-2016).

polymv's People

Contributors

oliveirara avatar

Watchers

 avatar  avatar  avatar

Forkers

wolffem

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.