Giter Site home page Giter Site logo

deustua / imexam Goto Github PK

View Code? Open in Web Editor NEW

This project forked from spacetelescope/imexam

0.0 0.0 0.0 42.63 MB

imexam is a python tool for simple image examination, and plotting, with similar functionality to IRAF's imexamine

Home Page: http://imexam.readthedocs.io

Python 5.05% Jupyter Notebook 94.95%

imexam's Introduction

imexam

CI Testing Status Documentation Status Test Coverage Status Powered by Astropy Badge Appveyor

imexam is an affiliated package of AstroPy. It was designed to be a lightweight library which enables users to explore data from a command line interface, through a Jupyter notebook or through a Jupyter console. It can be used with multiple viewers, such as DS9 or Ginga, or without a viewer as a simple library to make plots and grab quick photometry information. It has been designed so that other viewers may be easily attached in the future.

For more information please see the online documentation

Note: There are two git submodules in this package. astropy_helpers has a bootstrap which will automatically download the relevent code at build time. There is also a submodule for the xpa code that talks to DS9, if you are planning to work on developing new code or installing this package from a repo download, you need to pull the xpa code using the following command after you have cloned the repository and before you "python setup.py install"

git submodule update --init -- cextern/xpa

If you are cloning the repository for the first time, you can do both steps at once using a recursive clone:

git clone --recursive https://github.com/spacetelescope/imexam.git

You can also display the docs locally after install, import imexam and then issue the following command to display the help docs in your local browser:

imexam.display_help()

To install using pip:

pip install imexam   #installs from the most recent pypi binaries

pip install git+https://github.com/spacetelescope/imexam  #installs from the current master on this repo

pip install --upgrade imexam #if you already have an older version installed

If you receive a message like this on your Mac OSX Lion+ machine when imexam.imexam() runs:

2016-02-01 11:16:11.453 python[84657:2506524] ApplePersistenceIgnoreState: Existing state will not be touched.

Try turning off the resume state:

defaults write org.python.python ApplePersistenceIgnoreState NO

If you are having display issues, some build problems may exist with the dependency packages which deal with backend graphics, try setting your matplotlib backend to Qt4Agg. You can set this in your .matplotlib/matplotlibrc file. You may also want to switch your matplotlib backend to Qt if you have a mac with the default MacOS backend specified. If you don't already have matplotlibrc file in your home directory, you can download one from their documentation: http://matplotlib.org/_static/matplotlibrc

inside ~/.matplotlib/matplotlibrc:
backend: Qt4Agg

Using the Ginga HTML5 Viewer

If you have installed Ginga, you can use the HTML5 viewer for image display with either a python terminal, jupyter console, qtconsole or Jypyter notebook session. If you are using a Windows machine you should install ginga to use as the viewer with this package. Make sure that you have installed the latest version, or you can download the development code here: https://github.com/ejeschke/ginga. There's also a new ginga plugin for imexam which is in the ginga repository in the experimental directory. This will load the imexam plotting and analysis library into the ginga gui framework.

Starting a connection to a Ginga HTML5 canvas backend for browser and Jupyter viewing:

a=imexam.connect(viewer='ginga')

You can optionally provide a port number to which the viewer is connected as well:

a=imexam.connect(viewer='ginga', port=9856)

Launching multiple DS9 windows

You can launch multiple ds9 windows either from this package or the command line. DS9 can be used to view images and arrays from any of the python terminals, consoles or the Jupyter notebook.

If you launch ds9 from outside the imexam package, you need supply the name of the window to imexam, this can be done in one of 2 ways:

  • launch ds9 with a unique title name:
ds9 -title astronomy&

then supply imexam the name of the window:

a=imexam.ds9('astronomy')
  • launch ds9 with nothing:
ds9&

then supply imexam with the XPA_METHOD from the XPA information window, this variable will contain either the INET address or the local filename representing the socket:

a=imexam.connect('82a7e674:51763')

Starting a new connection with no target specified will open a new DS9 window using a local socket by default:

a=imexam.connect()

Connecting to a DS9 window which was started from the system prompt:

imexam.list_active_ds9() # will give you the INET address or names of the open session
a=imexam.connect('address from the above listing')

Examples can be found in the package documentation, online documentation, and imexam.display_help() will pull up the installed package documentation in a web browser. You can also download the examply Jupyter notebooks available in the example_notebooks directory above.

You can also just load the plotting library and NOT connect to any viewer:

from imexam.imexamine import Imexamine
import numpy as np

plots = Imexamine()  #the plots object now has all available functions
data = np.random.rand(100,100) * np.ones((100,100)) #make some fake data
plots.plot_line(35,45,data) #shows a matplotlib window with a plot
plots.save() #saves the current plot to file

You can also set the data attribute of the plots object and then just call many plots without specifying the data again:

plots.set_data(data)
plots.plot_line(35,45)

Contributing

Please open a new issue or new pull request for bugs, feedback, or new features you would like to see. If there is an issue you would like to work on, please leave a comment and we will be happy to assist. New contributions and contributors are very welcome!

New to github or open source projects? If you are unsure about where to start or haven't used github before, please feel free to contact @sosey. Want more information about how to make a contribution? Take a look at the astropy contributing and developer documentation.

Feedback and feature requests? Is there something missing you would like to see? Please open an issue or send an email to @sosey. imexam follows the Astropy Code of Conduct and strives to provide a welcoming community to all of our users and contributors.

License

imexam is licensed under a 3-clause BSD style license (see the licenses/LICENSE.rst file).

imexam's People

Contributors

astrofrog avatar bsipocz avatar cdeil avatar ejeschke avatar embray avatar eteq avatar mwcraig avatar pllim avatar sosey avatar stscieisenhamer avatar tjhoyt avatar yoachim 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.