Skip to main content

Monte cArlo weiGhted PIxel rEmapping

Project description

MAGPIE: Monte cArlo weiGhted PIxel rEmapping

CircleCI codecov Documentation Status

Author Krishna Naidoo
Version 0.2.1
Repository https://github.com/knaidoo29/magpie
Documentation https://magpie-doc.readthedocs.io/

Introduction

MAGPIE is a python module for remapping bins (in 1D), pixels (in 2D) and cells (in 3D) into different coordinate systems. The package will enable data to be remapped from cartesian to polar coordinates, cartesian to spherical polar coordinates and will enable rotations of these systems. When carrying out coordinate transformations we typically take the center of the pixel or cell and apply the transform without considering the surface area of the pixel (or volume of the cell). In MAGPIE this is taken into account by applying two remapping schemes. The first weights pixels to a new coordinate grid using monte-carlo integration. The second uses a dense grid (denser than the new coordinate grid) which is rebinned to the target coordinate grid. In both cases we sample the surface area or volume of the new coordinate pixels to accurately remap the data. The monte-carlo method is more accurate but scales poorly to 3D. For 2D this scheme will work very well even for moderately large datasets. The dense grid method, while less accurate, is very fast and should be used for large data sets and all 3D transformations. In 1D these are computed exactly without requiring the approximate schemes above.

Dependencies

MAGPIE is being developed in Python 3.8 but should work on all versions >3.4. MAGPIE is written mostly in python but with some heavy computation carried out in Fortran. Compiling the Fortran source code will require the availability of a fortran compiler usually gfortran (which comes with gcc).

The following Python modules are required.

For testing you will require nose or pytest.

Installation

Magpie can be installed in a variety of ways:

  1. Using pip:

Not yet setup

  1. Using conda:

Not yet setup

  1. By cloning the github repository::
    git clone https://github.com/knaidoo29/magpie.git
    cd magpie
    python setup.py build
    python setup.py install

Once this is done you should be able to call magpie from python:

    import magpie

Support

If you have any issues with the code or want to suggest ways to improve it please open a new issue (here) or (if you don't have a github account) email krishna.naidoo.11@ucl.ac.uk.

Version History

  • Version 0.2:

    • Restructured layout and the incorporation of documentation and unit testing for eventual first release.
    • Randoms in a variety of coordinate systems: cartesian, polar, spherical and from an input PDF/CDF and subsampling and stochastic weights.
    • Cartesian coordinate remapping in 1D, 2D and 3D.
  • Version 0.1:

    • Coordinate transformations between cartesian, polar and spherical polar coordinates.
    • Rebinning in 1D (computed exactly), in 2D and 3D via monte-carlo weighted remapping and a dense mesh.
    • Randoms in cartesian, polar and sphercal polar coordinates.
    • Rotation transformations.
    • Polar coordinate utilities and integration for polar grid to radial profiles.
    • Plotting routine for orthographic projection of unit sphere data.

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

magpie-pkg-0.2.1.tar.gz (39.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

magpie_pkg-0.2.1-py3.9-macosx-10.9-x86_64.egg (208.5 kB view details)

Uploaded Egg

magpie_pkg-0.2.1-cp39-cp39-macosx_10_9_x86_64.whl (134.9 kB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

File details

Details for the file magpie-pkg-0.2.1.tar.gz.

File metadata

  • Download URL: magpie-pkg-0.2.1.tar.gz
  • Upload date:
  • Size: 39.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.0.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for magpie-pkg-0.2.1.tar.gz
Algorithm Hash digest
SHA256 6b853ed95760f9be201d510b2bf5fa9e47d8ad7dba9118e074df80b21ae774c2
MD5 1e40892b2acc4fa6876ace559dafd199
BLAKE2b-256 fdf8724b9ec5368ede97913c3fcd59b64d728f9609a0bc198f5b3f5ffe7e487f

See more details on using hashes here.

File details

Details for the file magpie_pkg-0.2.1-py3.9-macosx-10.9-x86_64.egg.

File metadata

  • Download URL: magpie_pkg-0.2.1-py3.9-macosx-10.9-x86_64.egg
  • Upload date:
  • Size: 208.5 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.0.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for magpie_pkg-0.2.1-py3.9-macosx-10.9-x86_64.egg
Algorithm Hash digest
SHA256 bc0577721f5e02e35f188bd105a6af921c7fd8587d1d3631406ab616bb6b84c6
MD5 d02b7e202ad2e3d957fac0b19f91f99d
BLAKE2b-256 fc2f724ee361dd06d60f98860130bd7881ad3eef8e6c67229ace29e2726f6c63

See more details on using hashes here.

File details

Details for the file magpie_pkg-0.2.1-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: magpie_pkg-0.2.1-cp39-cp39-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 134.9 kB
  • Tags: CPython 3.9, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.0.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for magpie_pkg-0.2.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5e4c92b864a47661caa9e6e846ef131df3fe4356dfa17b5337c0f39c1e2361c8
MD5 64c828e927e25052e542400f955b86f2
BLAKE2b-256 92422e72aca5b2ba68cb3ff884cf4b633edae616066587bd6f552676b3633d40

See more details on using hashes here.

Supported by

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