https://github.com/phdenzel/model-zapper
Zapp through GLASS lens models
https://github.com/phdenzel/model-zapper
analysis gravitational-lensing macos-app python
Last synced: 7 months ago
JSON representation
Zapp through GLASS lens models
- Host: GitHub
- URL: https://github.com/phdenzel/model-zapper
- Owner: phdenzel
- Created: 2018-10-11T17:09:14.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-11-22T03:04:03.000Z (almost 3 years ago)
- Last Synced: 2023-03-24T07:35:42.108Z (over 2 years ago)
- Topics: analysis, gravitational-lensing, macos-app, python
- Language: Python
- Homepage: https://git.io/fxViB
- Size: 646 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.org
Awesome Lists containing this project
README
#+TITLE: ModelZapper
#+AUTHOR: phdenzelModelZapper is a supplementary app to [[https://github.com/jpcoles/glass][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 [[https://github.com/phdenzel/model-zapper/releases][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: [[https://github.com/phdenzel/glass/blob/master/setenv][setenv]]) before running
#+BEGIN_SRC shell
python modelzapper.py
#+END_SRC*** 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.
#+BEGIN_SRC shell
./configure
#+END_SRC
This will set up a virtual python environment and download all required
libraries.
After the environment and required libraries are downloaded, use ~install~
#+BEGIN_SRC shell
./install
#+END_SRC
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
#+BEGIN_SRC shell
python modelzapper.py [gls.state]
#+END_SRC*** Build the app
Once you configured and installed ~modelzapper.py~, building the app is
easy! Enter the virtual environment and run ~py2app~ with
#+BEGIN_SRC shell
source activate
python setup.py py2app
#+END_SRC
or alternatively use
#+BEGIN_SRC shell
./rebuild
#+END_SRC
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))
- [[https://github.com/phdenzel/glass][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][https://github.com/phdenzel/local-python-install]]
(try installing the frameworks in standard locations though,
e.g. ~/Library/Frameworks/~).