GithubHelp home page GithubHelp logo

phdenzel / model-zapper Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 663 KB

Zapp through GLASS lens models

Home Page: https://git.io/fxViB

Python 97.22% Shell 2.78%
macos-app python gravitational-lensing analysis

model-zapper's Introduction

ModelZapper

ModelZapper is a supplementary app to GLASS which can inspect, analyze, and filter GLASS “states”. Free-form gravitational lens modelling techniques which are used in GLASS, generally try to deal with the mass-sheet degeneracy (an intrinsic problem in gravitational lens modelling) by exploring the solution space in a Monte-Carlo sampling approach. Every lens model is therefore built out of many different models that solve the lens equation with the given priors. Such an ensemble model usually looks fine on average, but not all models in the ensemble might be valid or realistic solutions to the observed lens. This is where ModelZapper comes in. With this app, one can manually go through the GLASS ensemble and select realistic models, filter out the unrealistic solutions, and save the filtered ensemble in a new GLASS state.

Binaries can be directly downloaded here (currently only for macOS).

Setup

Generally, modelzapper.py should be runnable without installation. Just make sure to properly add the pre-installed glass paths to the PYTHONPATH (for an example see: setenv) before running

python modelzapper.py

Install

To properly install modelzapper.py (in order to build the app yourself or to run the app within a virtual python environment), first run configure in the root directory of the repo.

./configure

This will set up a virtual python environment and download all required libraries. After the environment and required libraries are downloaded, use install

./install

This will compile the glass source code into src, and move the build into libs and includes directories. If glass was compiled without errors, modelzapper.py should be able to run (without setting any PYTHONPATH or PATH) as

python modelzapper.py [gls.state]

Build the app

Once you configured and installed modelzapper.py, building the app is easy! Enter the virtual environment and run py2app with

source activate
python setup.py py2app

or alternatively use

./rebuild

After the command(s) finish, you should find two new directories in your repo, dist and build. In dist you’ll find your standalone macOS app that is ready to be double-clicked.

Requirements

To build the app yourself, you need a Python framework with an integrated Tkinter library (or linked to Tcl/Tk frameworks). The app relies on several python modules which are installable via e.g. pip. Since the app interfaces with glass, a runnable version of glass is essential. To summarize (also see requirements.txt):

  • Python framework (==2.7)
  • Tkinter (built-in or linked to Tcl and Tk frameworks (>= 8.6))
  • glass
  • virtualenv
  • numpy
  • scipy
  • matplotlib
  • PIL

More

Since it is not really easy to install glass, let alone automatically, chances are you might have problems running the app. If so, try building it yourself. In order to be able to build the app though, python must be installed as a framework. It is also recommended to install a newer Tcl/Tk framework than the one that comes with the macOS system. For more details see https://github.com/phdenzel/local-python-install (try installing the frameworks in standard locations though, e.g. /Library/Frameworks/).

model-zapper's People

Contributors

phdenzel avatar

Watchers

 avatar  avatar  avatar

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.