spacetelescope / imexam

imexam is a python tool for simple image examination, and plotting, with similar functionality to IRAF's imexamine
http://imexam.readthedocs.io
BSD 3-Clause "New" or "Revised" License
75 stars 45 forks source link

Unbinned radial plot added as well as document updates #73

Closed sosey closed 8 years ago

sosey commented 8 years ago

I updated the radial profile plot to include both binned and unbinned plots of the points around the star. By default, the unbinned results will be plotted, the user can choose binned points by setting the new parameter pixels to False. I still need to add the model fit to the points.

In [8]: a.rimexam()
Out[8]: 
{'background': [False, 'Subtract background? [bool]'],
 'center': [True, 'Solve for center using 2d Gaussian? [bool]'],
 'fitplot': [False, 'Overplot profile fit?'],
 'fittype': ['Gaussian2D', 'Profile type to fit (Gaussian2D)'],
 'function': ['radial_profile'],
 'getdata': [False, 'print the plotted data values'],
 'magzero': [25.0, 'magnitude zero point'],
 'marker': ['o', 'The marker character to use, matplotlib style'],
 'pixels': [True, 'Plot all pixels at each radius? (False bins the data)'],
 'pointmode': [True, 'plot points instead of lines? [bool]'],
 'rplot': [8.0, 'Plotting radius in pixels'],
 'skyrad': [10.0, 'Background inner radius in pixels, from center of object'],
 'title': [None, 'Title of the plot'],
 'width': [5.0, 'Background annulus width in pixels'],
 'xlabel': ['Radius', 'The string for the xaxis label'],
 'ylabel': ['Flux', 'The string for the yaxis label']}

I also added scipy.stats.describe to the statistical box function, which can be specified with "describe" and used in addition to the previous np.mean/median/min type single stats.

In [5]: a.mimexam()
Out[5]: 
{'function': ['report_stat'],
 'region_size': [5, 'region size in pixels to use'],
 'stat': ['median', 'which numpy stat to return [median, min, max]']}

In [6]: a.set_plot_pars('m','stat','describe')
set report_stat_pars: stat to describe

In [7]: a.imexam()

Press 'q' to quit

2   Make the next plot in a new window
a   Aperture sum, with radius region_size 
b   Return the 2D gauss fit center of the object
c   Return column plot
e   Return a contour plot in a region around the cursor
g   Return curve of growth plot
h   Return a histogram in the region around the cursor
j   1D [Gaussian1D default] line fit 
k   1D [Gaussian1D default] column fit
l   Return line plot
m   Square region stats, in [region_size],default is median
r   Return the radial profile plot
s   Save current figure to disk as [plot_name]
t   Make a fits image cutout using pointer location
w   Display a surface plot around the cursor location
x   Return x,y,value of pixel
y   Return x,y,value of pixel

Current image /Users/sosey/test_images/iacs01t4q_flt.fits
pressed: m, report_stat
[428:433,476:481] describe: 
nobs: 25
minamx: (0.51488268, 0.89496481)
mean 0.6963587403297424
variance: 0.009489892981946468
skew: 0.22983314096927643
kurtosis: -0.49982608081795465
coveralls commented 8 years ago

Coverage Status

Coverage increased (+0.4%) to 27.18% when pulling c403e0d821085a56d04bdab93347d015d8397a39 on sosey:radialpix into 00540fc9c41021e8da08c784aa0fc76ec924eb47 on spacetelescope:master.

coveralls commented 8 years ago

Coverage Status

Coverage increased (+0.4%) to 27.18% when pulling fac0298ccbffe152a58813bed46c0ad7549441af on sosey:radialpix into 00540fc9c41021e8da08c784aa0fc76ec924eb47 on spacetelescope:master.

coveralls commented 8 years ago

Coverage Status

Coverage increased (+0.4%) to 27.18% when pulling afcfcb56e4b18657cb857bee67ab55888165150d on sosey:radialpix into 00540fc9c41021e8da08c784aa0fc76ec924eb47 on spacetelescope:master.

coveralls commented 8 years ago

Coverage Status

Coverage increased (+0.4%) to 27.18% when pulling afcfcb56e4b18657cb857bee67ab55888165150d on sosey:radialpix into 00540fc9c41021e8da08c784aa0fc76ec924eb47 on spacetelescope:master.