yorick-spydr-0.8.2/ 0000755 0000765 0000144 00000000000 11516670605 013554 5 ustar frigaut users yorick-spydr-0.8.2/spydr.glade 0000644 0000765 0000144 00000450227 11516670322 015721 0 ustar frigaut users
True
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK
spydr
False
True
vertical
False
0
True
True
vertical
True
2
0
out
True
4
True
2
vertical
176
183
True
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
False
False
2
0
True
3
2
True
True
False
8
1
2
2
3
True
0
3
local maxima
2
3
GTK_FILL
True
False
8
1
2
1
2
True
0
3
value
1
2
GTK_FILL
True
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
True
0
3
Y
0
True
False
8
1
1
2
True
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
True
0
3
X
0
True
False
8
1
1
True
<b>zoom</b>
True
label_item
False
False
0
True
2
0
out
True
2
4
True
vertical
3
Tv
True
True
False
swicth to pli mode (image)
True
True
True
False
0
True
Contours
90
True
True
False
switch to contour mode
True
True
tv
False
0
+tv
True
False
True
False
True
True
False
1
fill
True
False
True
False
True
True
False
3
2
False
1
True
Surface
90
True
True
False
switch to surface mode
True
True
True
tv
False
0
shades
True
False
True
False
True
True
True
1
False
2
True
2
2
True
Unzoom
True
True
False
Unzoom main image
True
2
limits
True
True
False
Restore limits in plot
True
1
2
2
Cut
True
True
False
Select and plot pixel value along arbitrary line
True
1
2
1
2
2
1
Histo:Reg.
True
True
False
Plot histogram of image region *displayed* in main window
with low and high values as defined by cmin and cmax
True
1
2
2
1
3
True
<b>Actions</b>
True
label_item
False
False
1
True
2
0
out
True
2
4
True
2
2
True
invert
True
True
False
True
True
1
2
True
True
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
Select color table
0 0 41 1 10 0
1
1
2
True
0
3
Color table
80
True
linear
sqrt
square
log
histeq
1
2
1
2
True
<b>LUT + ITT</b>
True
label_item
False
False
2
True
10
2
True
True
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
10
1 0 100000 0.10000000000000001 10 0
1
12
1
2
7
8
True
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
10
25 -90 90 5 10 0
1
1
2
5
6
True
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
10
75 -360 360 5 10 0
1
1
2
4
5
True
True
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
10
0 -10 10 1 1 0
1
1
2
3
4
True
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
Number of contours in contour plot
10
8 0 50 1 10 0
1
1
2
2
3
True
True
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
Low threshold for displayed image
10
0 -1e+21 1e+21 1 10 0
1
5
True
1
2
True
True
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
High threshold for displayed image
10
0 -1e+21 1e+21 1 10 0
1
5
True
1
2
1
2
True
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
10
1 1 1 1 10 0
1
1
2
6
7
0
3
image#
6
7
True
True
0
3
cmax
1
2
True
0
3
cmin
True
0
3
n_levels
2
3
True
0
3
rebin: 2^
3
4
0
3
azimuth
4
5
0
3
elevation
5
6
True
histogram bin size
0
3
histbinsize
7
8
False
False
3
False
False
0
True
vertical
True
True
505
525
True
GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK
False
2
0
505
280
True
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
False
2
1
False
4
1
vertical
6
True
vertical
Sigma Filter
True
True
False
True
False
False
0
User function 1
True
False
True
1
User Function 2
True
False
True
2
False
False
0
True
True
True
True
vertical
True
11
2
70
True
moffat
gaussian
1
2
4
5
True
0
3
function
4
5
True
False
True
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
Mag that gives 1 photons/s for whole aperture
15 15 30 1 10 0
1
2
1
2
6
7
True
False
0
3
zero point
6
7
True
False
True
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
Telescope central obstruction [fraction of diameter]
0.10000000000000001 0 1 1 10 0
1
3
1
2
9
10
True
False
0
3
central obs
9
10
True
False
True
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
Telescope diameter [m]
0.10000000000000001 0.01 100 1 10 0
1
3
1
2
8
9
True
False
0
3
tel diam
8
9
True
0
3
pixsize
True
True
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
Pixel size [arcsec]
0 0 2 1 10 0
1
5
1
2
True
0
3
boxsize
1
2
True
0
3
saturation
3
4
True
True
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
Box size for fit [pixels] and FWHM/Strehl calculation
11 3 255 2 10 0
1
True
1
2
1
2
True
True
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
Image saturation level [ADU]
0 0 10000000 1 10 0
1
1
2
3
4
True
False
0
3
wavelength
7
8
True
0
3
airmass
5
6
True
False
True
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
Image wavelength [microns]
0.29999999999999999 0.29999999999999999 20 1 10 0
1
4
1
2
7
8
True
True
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
1 1 5 1 10 0
1
3
1
2
5
6
True
False
0
3
aper. diam.
2
3
True
False
True
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
Diameter of aperture in which star flux is to be integrated for Strehl
calculations (should include all the star flux but no more) [pixels]
45 3 1023 1 10 0
1
1
2
2
3
0
Compute Strehl
True
True
False
True
True
False
1
Output magnitudes
True
True
False
True
True
False
2
Pick one
True
True
False
True
False
False
3
Pick many
True
True
False
True
False
False
4
True
PSF fit
label_item
False
1
True
True
True
vertical
True
5
2
True
True
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
1 0 1 1 10 0
1
2
1
2
4
5
True
0
3
sharp high
4
5
True
0
3
fwhm
True
True
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
Pixel size [arcsec]
0 0 50 1 10 0
1
2
1
2
True
0
3
threshold
1
2
True
0
3
roundlim
2
3
True
True
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
Boxsize for fit [pixel]
50 0 10000 1 10 0
1
2
True
1
2
1
2
True
True
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
Image saturation level [ADU]
1 0 2 1 10 0
1
2
1
2
2
3
True
0
3
sharp low
3
4
True
True
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
0.20000000000000001 0 1 1 10 0
1
2
1
2
3
4
0
Output magnitudes
True
False
True
True
False
2
Find
True
True
False
True
False
False
3
Strehl map
True
True
False
True
False
False
4
True
FIND
label_item
False
2
False
False
5
2
1
True
False
False
5
2
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
5
About Spydr
False
center-on-parent
True
dialog
Spydr
0.8.0
Francois Rigaut, Copyright 2007-2009
Display and Analysis of fits images and data cube
http://www.maumae.net/yorick/plugins.html
Copyright (C) 2007 Francois Rigaut
This program is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation, either version
3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Francois Rigaut, frigaut@gemini.edu
thanks to:
- Thibaut Paumard
- Damien Gratadour
for suggestions to improve this software.
Francois Rigaut, frigaut@gemini.edu
True
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
vertical
2
True
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
end
False
end
0
yorick-spydr-0.8.2/spydr.conf 0000644 0000765 0000144 00000005617 10754323022 015564 0 ustar frigaut users pyk_debug = 0; // turns on python/yorick communication debug
spydr_defaultdpi = 75; // change size of spydr graphic area
rad4zoom = 16; // default zoom window radius (pixels)
zoom_cmincmax = 1; // zoom scale = larger image scale?
default_symbol = 2; // default symbols
spydr_nlevs = 8; // default number of levels for contours
spydr_smooth = 4; // smooth parameters for contours (see contour)
spydr_filled = 0; // contour filled by default?
spydr_shades = 1; // use shades in surface by default?
surface_init = 0; // ?
spydr_itt = 1; // default ITT [1=lin,2=sqrt,3=square,4=log]
spydr_lut = 0; // default LUT index [0-41]
spydr_invertlut = 0; // invert LUT by default?
spydr_azimuth = 15; // default azimuth for surface plots
spydr_elevation = 25; // default elevation for surface plots
xytitles_adjust1 = [0.012,0.019]; // X and Y notch axis titles in main area
xytitles_adjust3 = [-0.005,0.020];// X and Y notch axis titles in plot area
spydr_wins = [40,41,42]; // yorick window numbers
spydr_pixsize = 1.; // default pixel size
spydr_boxsize = 51; // default box size for fwhm and strehl calculations
spydr_strehlaper = 49; // diameter of aperture to compute strehl (pixels)
// should be smaller than spydr_boxsize.
spydr_funtype = "moffat"; // default function for psf fitting
spydr_saturation = 65535.;// default saturation for psf fitting
spydr_airmass = 1.0; // default airmass for PSF calculation (?)
spydr_wavelength = 0.; // default wavelength for psf fitting / strehl
spydr_teldiam = 7.9; // default telescope diameter (psf/strehl)
spydr_cobs = 0.125; // default central obs ratio (psf/strehl)
spydr_zero_point = 25.; // default ZP for magnitude calculation
spydr_sourcediam = 0.; // Calibration source diam (arcsec) for strehl calcul.
compute_strehl = 0; // 1-> compute Strehl | 0 -> PSF fitting
output_magnitudes= 0; // Output magnitude?
spydr_log_itt_dex= 3; //
//spydr_histbinsize= 1.; // default binsize for histogram plots
spydr_histnbins= 100; // number of bins in histograms
spydr_showplugins= 0; // show plugin pane when GUI comes up?
spydr_showlower= 1; // show lower gui (1d plot)
spydr_strehlfudge= 1.0; // fudge due to various factor (spiders, etc)
spydr_sigmafilter_nsig = 6.; // nsig in sigmafilter (see doc)
spydr_savedir = "."; // default save directory
spydr_plot_in_arcsec= 0; // Graph coordinate system in arcsec? (otherwise pixels)
pldefault,opaque=1,marks=1;
// special NICI:
spydr_teldiam = 7.9*0.95;
spydr_teldiam = 7.9*0.90;
spydr_cobs = 0.27;
/* NICI:
surface of spiders = (7.9*0.95-7.9*0.27)*0.3*2. = 3.22 sq m
surface of pupil = pi/4.*(7.9*0.95)^2.-pi/4.*(7.9*0.27)^2. = 40.66 sq m
hence energy diffracted by spiders = 3.22/40.66 = 7.9%
*/
spydr_strehlfudge= 1.079;
yorick-spydr-0.8.2/spydr.i 0000644 0000765 0000144 00000213465 11516670605 015102 0 ustar frigaut users /* spydr.i
* main function to call the pygtk GUI to spydr.
* syntax: yorick -i spydr.i imname ... (see README)
*
* This file is part of spydr, an image viewer/data analysis tool
*
* $Id: spydr.i,v 1.32 2010/04/15 02:56:02 frigaut Exp $
*
* Copyright (c) 2007, Francois Rigaut
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
* $Log: spydr.i,v $
* Revision 1.32 2010/04/15 02:56:02 frigaut
*
* updated repo to 0.8.1
*
* Revision 1.31 2009/03/11 16:03:33 frigaut
* - patched (fixed?) the whole histogram thing. before, was
* crashing for image=cte. now ok.
* - increased the number of digit in GUI for cmin/cmax/binsize
* - bumped to version 0.8.0
*
* Revision 1.30 2008/02/12 13:58:43 frigaut
* changelog to version 0.7.7:
*
* - fixed a bug when spydr_lut is not 0 and one creates a new
* window.
* - other minor bug fixes.
* - updated spydr man page
* - written and published web doc on maumae.
*
* Revision 1.29 2008/02/10 15:08:07 frigaut
* Version 0.7.6:
* - can now change the dpi on the fly. ctrl++ and ctrl+- will enlarge
* or shrink the graphical areas. long time missing in yorick.
* I have tried to make the window resizable, but it's a mess. Not
* only in the management of events, but also in the policy: really,
* only enlarging proportionally makes sense.
* - changed a bit the zoom behavior: now zoom is started once (the first
* time the mouse enter drawingarea1), and does not stop from that point.
* This is not ideal/economical (although disp_zoom returns immediately
* if the mouse is not in the image window), but it has the advantage
* of being sure the disp_zoom process does not spawn multiple instances
* (recurrent issue with "after").
* - The menu items in the left menu bar are hidden/shown according to the
* window size.
* - gotten rid of a few (unused) functions in spydr.i (the progressbar
* and message functions) that were conflicting with other pyk instances.
* - there's now focus in and out functions that will reset the current
* window to what it was before the focus was given to spydr. This is
* convenient when one just want to popup a spydr window to look at an
* image, and then come back to whatever one was doing without having to
* execute a window,n command.
* - fixed a bug in disp_cpc. Now, when a "e"/"E" command is executed
* while a subimage is displayed, the "e"/"E" applies to the displayed
* subimage, not the whole image.
* - changed a bit the behavior of the lower graphical area: not the y
* range is the same as the image zcuts (cmin/cmax).
* - fixed a small bug in get_subim (using floor/ceil instead of round
* for the indices determination).
* - added "compact" keyword to the spydr function (when called from
* within yorick).
* - clipping dpi values to [30,400].
* - spydr.py: went for a self autodic instead of an explicit
* declaration of all functions.
* - implemented smoothing by x2
* - implemented 1d linear fitting
*
* Revision 1.28 2008/02/08 10:21:09 frigaut
* - bumped to version 0.7.5
*
* Revision 1.27 2008/02/08 10:19:30 frigaut
* - set larger values for the cmin and cmax min/max allowed values
* - fixed a bug in set_cmax (spydr.i)
*
* Revision 1.26 2008/02/08 09:53:42 frigaut
* - applied patch from thibaut to fix regression (error when calling spydr
* from within yorick)
*
* Revision 1.25 2008/02/07 14:51:35 frigaut
* correct typos in document section.
*
* Revision 1.24 2008/02/02 20:16:08 frigaut
* - gotten rid of clmfit in favor of direct lmfit call.
* - added batch mode
* - changed spydr startup script
* - now fitted vector is displayed vector (before was fitting
* the whole e.g. cut, and not only the displayed part).
* - fitting is slightly more robust (better starting values)
* - fixed an issue with pick-up of star in psffit when in graph
* axis are in arcsec
* - fixed an error when picking x or y cuts outside of image
* - moved some error messages from popups to status bar
* - bumped to version 0.7.4
*
* Revision 1.23 2008/02/02 05:18:08 frigaut
* fixed log header in spydr.i
*
* Revision 1.22 2008/02/02 05:12:05 frigaut
* fixed bug when picking star for fitting while being in "graphical axis
* in arcsec" mode.
*
* Revision 1.21 2008/02/02 04:59:54 frigaut
* saved fits is displayed fits, not stack image
*
* revision 1.20 2008/02/02 04:49:21 frigaut
* many changes once more:
* - can now display graphes with X/Y axis in arcsec
* - cleaned up mode switching (tv/contours/surface). Now more reliable.
* - contour filled and tv switch survive a mode switching (before, were
* reset)
* - limits are sticky between switch of mode (especially when switching
* to contours)
* - when axis in arcsec is selected, gaussian fit is expresed in arcsec too.
* - added export to pdf, postscript, encapsulated postscript
* - added menu to pick color of contour lines
* - added menu to pick color of contour marks
* - implemented contour legends on plots
* - added menu to select position of contour legends
* - new functionality to compute distance between 2 points (see shortcut
* "M" and "m").
* - rebin now works both ways (increasing and decreasing number of pixels)
* - added "hdu" command line keyword, and updated manpage.
* - added hist-equalize option to LUT
* this is version 0.7.3
*
* Revision 1.19 2008/01/30 05:28:19 frigaut
* - added spydr_pyk to avoid conflicts with other calls of pyk, and modify
* spydr_pyk for our purpose. I know this means we will not benefit from
* future pyk code improvements, but I can deal with that.
* - added check of yorick main version to avoid use with V<2.1.05 (in which
* current_mouse does not exist)
*
* Revision 1.18 2008/01/29 21:23:46 frigaut
* - upgraded version 0.7.2
* - added "save as", "save" and export to jpeg and png menus/actions
*
* Revision 1.17 2008/01/25 15:41:40 frigaut
* bumped version to 0.7.1
*
* Revision 1.16 2008/01/25 03:03:49 frigaut
* - updated license or license text to GPLv3 in all files
*
* Revision 1.15 2008/01/25 02:55:11 frigaut
* - updated DOCUMENT section of spydr
*
* Revision 1.14 2008/01/24 15:05:17 frigaut
* - added "delete from stack" feature
* - some bugfix in psffit
*
* Revision 1.13 2008/01/23 21:20:40 frigaut
* - update doc to add (forgotten) --compact command line option
*
* Revision 1.12 2008/01/23 21:11:22 frigaut
* - load of new things:
*
* New Features:
* - added a number of command line flags (see man page or spydr -h)
* - can now handle series of image of different sizes
* - can mix single image and cube
* - cmin and cmax are now set per image (sticky setting)
* - image titles are better handled
* - updated man page
* - new image can be opened from the GUI menu (filechooser, multiple
* selection ok)
* - migrated to a spydrs structure, replaced many different variables, cleaner.
* - now opens the GUI even with no image argument (can use "open" from menu)
* - all errors are now also displayed as popups (critical quits yorick
* when called from shell)
* - because some (of the more critical) errors can happen before python is
* started, I had to use zenity for the popup window. New dependency.
* - added an "append" keyword to spydr. If set, the new image is appended
* to the list of displayed image. The old ones are kept, and the total
* number of image is ++
* - append is also available from the GUI menu
* - any action on displayed image can be null by using "help->refresh
* display" (in particular, sigmafilter)
* - created "about" dialog.
* - added an "image" menu (with names of all images in stack). user can
* select image form there.
* - added an "ops" (operation) menu. Can compute median, average, sum and
* rms of cube.
* - small gui (without lower panel) form is called with --compact (-c)
*
* Bug fixes:
* - fixed path to find python and glade files
* - fixed path for configuration file
* - main routine re-written and much more robust and clean
* - (kind of) solved a issue where image got displayed several times
* because of echo from setting cmin and cmax
* - fixed thibaut bug when closing window.
* - fixed "called_from_shell" when no image argument.
* - waiting for a doc for the user buttons, set to insivible.
* - waiting for a proper implementation of find, pane set to invisible.
*
* - bug: sometimes the next/previous image does not register
*
* Revision 1.11 2008/01/17 14:49:49 frigaut
* - fixed problem with (spydr_pyk) I/O interupt, which was due to calling spydr_pyk_flush
* prematurely. Now called within first call of spydr()
*
* Revision 1.10 2008/01/17 13:17:44 frigaut
* - bumped version to 0.6.1
*
* Revision 1.9 2008/01/03 17:59:49 frigaut
* removed spydr.spec (moved name to yorick-spydr)
*
* Revision 1.8 2008/01/02 14:11:42 frigaut
* - better fit of graphical area in GUI
* - updated spec file
*
* Revision 1.7 2007/12/26 21:55:56 frigaut
* - updated Makefile for package use (instead of plugin)
* - bumped to 0.6.0
*
* Revision 1.6 2007/12/26 17:41:47 frigaut
* - removed dependency on usleep in info file
* - bumped to 0.5.3
*
* Revision 1.5 2007/12/24 17:16:52 frigaut
* bumped to version 0.5.2
* don't know why mouse-nowait.c is in here (no diff)
*
* Revision 1.4 2007/12/17 20:54:47 frigaut
* - added set/unset debug of yorick/python communication in GUI help menu
* - gotten rid of usleep calls and replaced by flush of pipe every seconds
* (as for yao)
* - added debug from python side (set pyk_debug)
*
* Revision 1.3 2007/12/17 13:29:05 frigaut
* - fixed typo in Makefile uninstall rule
* - updated one filter in nici filter list
*
* Revision 1.2 2007/12/13 13:43:27 frigaut
* - added license headers in all files
* - added LICENSE
* - slightly modified Makefile
* - updated info
* - bumped to 0.5.1
*
*
*
*/
spydr_version = "0.8.2";
require,"spydr_pyk.i";
require,"astro_util1.i";
require,"spydr_psffit.i";
require,"util_fr.i";
require,"histo.i";
require,"plot.i";
require,"spydr_plugins.i";
require,"pathfun.i";
require,"imutil.i";
require,"spydr_input_data_format.i";
struct spydr_struct{
pointer pim;
long nim;
long dims(3);
double opixsize; // original image pixel size (arcsec/pixel)
double pixsize; // current image pixel size (can be rebinned)
double wavelength;
string name;
string saveasname;
float cmin; // zcut min
float cmax; // zcut max
string space; // name of image space
};
flushing_interval=0.2;
rebin_fact=1;
//=============================
// SPYDR_PYK wrapping functions
//=============================
func spydr_pyk_status_push(msg,id=,clean_after=)
{
extern time_to_clean;
if (id==[]) id=1;
spydr_pyk,swrite(format="pyk_status_push(%d,' %s')",id,msg);
if (clean_after) {
time_to_clean = unix_time(now=1)+clean_after;
after,1,spydr_pyk_status_clean;
}
}
func spydr_pyk_status_clean(void)
{
extern time_to_clean;
if (unix_time(now=1)1) msg=sum(msg+"\\n");
// or streplace(msg,strfind("\n",msg),"\\n")
spydr_pyk,swrite(format="pyk_info('%s')",msg);
}
func spydr_pyk_info_w_markup(msg)
{
if (numberof(msg)>1) msg=sum(msg+"\\n");
// or streplace(msg,strfind("\n",msg),"\\n")
spydr_pyk,swrite(format="pyk_info_w_markup('%s')",msg);
}
func spydr_pyk_error(msg)
{
if (numberof(msg)>1) msg=sum(msg+"\\n");
// ok, here the problem is that "fatal errors", when called from shell,
// should bail you out (quit yorick). But if they do, then the python
// process is also killed and then the error message never appears on screen.
// thus the use of zenity in *all* cases.
// if (_spydr_pyk_proc) {
// spydr_pyk,swrite(format="pyk_error('%s')",msg);
// } else { // python not started yet, use zenity
system,swrite(format="zenity --error --text=\"%s\"",msg);
// }
}
func spydr_pyk_warning(msg)
{
if (numberof(msg)>1) msg=sum(msg+"\\n");
spydr_pyk,swrite(format="pyk_warning('%s')",msg);
}
//=============================
// Window management functions
// and basic display operations
//=============================
func spydr_focus_in(void)
{
extern spydr_win_had_focus;
cw=current_window();
if (noneof(cw==spydr_wins)) {
if (cw>-1) spydr_win_had_focus = cw;
}
// write,format="spydr focus in, old = %d\n",spydr_win_had_focus;
}
func spydr_focus_out(void)
{
extern spydr_win_had_focus;
if (spydr_win_had_focus>-1) {
window,spydr_win_had_focus;
// write,format="spydr focus out, restored focus to %d\n",spydr_win_had_focus;
}
}
func spydr_change_dpi(dpi)
{
extern spydr_dpi;
extern xid1,xid2,xid3;
spydr_dpi=dpi;
window,spydr_wins(1);
lims = limits();
winkill,spydr_wins(1);
// winkill,spydr_wins(2);
winkill,spydr_wins(3);
spydr_win_init,xid1,xid2,xid3,redisp=1;
explimits,lims;
}
func spydr_win_init(pid1,pid2,pid3,redisp=)
{
extern gui_realized;
extern xid1,xid2,xid3;
xid1=pid1; xid2=pid2; xid3=pid3;
window,spydr_wins(1),dpi=spydr_dpi,wait=(!redisp),width=0,height=0, \
xpos=-2,ypos=-2,style="spydr.gs",parent=pid1;
limits,square=1;
palette,"gray.gp"; // need this if loadct is used!?
/* if (imnum) {
if (!redisp) {
disp_cpc;
disp_tv;
}
}*/
if (!gui_realized) {
window,spydr_wins(2),dpi=31,wait=1,style="nobox.gs",parent=pid2, \
ypos=-27,xpos=-4;
limits,square=1;
}
window,spydr_wins(3),dpi=spydr_dpi,wait=((!redisp)&(spydr_showlower)), \
style="spydr2.gs",xpos=-2,ypos=-2,parent=pid3;
window,spydr_wins(1);
spydr_set_lut,spydr_lut;
if (redisp) return;
spydr_pyk,"done_init = 1";
gui_realized=1;
if (spydr_nim>0) {
set_imnum,1;
gui_update;
disp_cpc;
spydr_disp;
if (spydr_showlower) plot_histo;
}
}
func switch_disp(type)
{
extern spydr_disp;
extern from_disp,old_limits;
extern surface_init;
if (type==1) { // TV
spydr_disp = disp_tv;
if (from_disp==3) limits,old_limits;
from_disp=1;
} else if (type==2) { // CONTOURS
if (from_disp!=3) old_limits=limits();
spydr_disp = disp_contours;
// if (from_disp==3) explimits,old_limits;
explimits,old_limits;
from_disp=2;
} else if (type==3) { // SURFACE
if (from_disp!=3) {
old_limits=limits();
spydr_disp = disp_surface;
surface_init=1;
// window,1,style="nobox.gs";
from_disp=3;
}
} else if (type==4) { // CONTOURS + TV
spydr_disp = disp_contours_plus_tv;
if (from_disp==3) limits,old_limits;
from_disp=4;
}
spydr_disp;
}
func explimits(lim)
{
limits,lim(1),lim(2),lim(3),lim(4);
}
func disp_tv(void)
// pli display, main window
{
extern imnum;
extern spydr_imd,spydr_imdnum;
if (imnum==[]) return;
// write,format="%s ","*";
window,spydr_wins(1);
fma;
if (spydr_itt==5) {
if (nallof(spydr_imdnum==[imnum,spydr_itt,rebin_fact])) \
spydr_imd = spydr_histeq_scale(spydr_im);
} else spydr_imd = bytscl(spydr_im,cmin=cmin,cmax=cmax);
spydr_imdnum = [imnum,spydr_itt,rebin_fact];
if (spydr_plot_in_arcsec) {
pli,spydr_imd,spydrs(imnum).dims(2)*spydrs(imnum).pixsize,\
spydrs(imnum).dims(3)*spydrs(imnum).pixsize;
axtit = "arcsec";
} else {
pli,spydr_imd;
axtit = "pixels";
}
spydr_pltitle,spydrs(imnum).name+swrite(format=" %dx%d",spydrs(imnum).dims(2),spydrs(imnum).dims(3));
spydr_xytitles,axtit,axtit;
colorbar,adjust=-0.024,levs=10;
// refresh zoom now
disp_zoom,once=1;
}
spydr_disp = disp_tv;
func disp_contours(void,nofma=)
// contour display, main window
{
extern spydr_width,spydr_ccolor;
window,spydr_wins(1);
if (nofma!=1) fma;
if (spydr_plot_in_arcsec) {
fact = spydrs(imnum).pixsize;
axtit = "arcsec";
} else {
fact = 1.0f;
axtit = "pixels";
}
xy = indices(spydrs(imnum).dims)-0.5;
levs = span(cmin,cmax,spydr_nlevs);//(2:-1);
if (spydr_filled) {
plfc,spydr_im,xy(,,2)*fact,xy(,,1)*fact,levs=levs;
colorbar,adjust=-0.024,levs=10;
}
ccolor="fg";
if (spydr_ccolor==[]) spydr_ccolor="fg";
if (spydr_mcolor==[]) spydr_mcolor="fg";
if (spydr_width==[]) spydr_width=1;
if ((nofma)||(spydr_filled)) ccolor=spydr_ccolor;
plc,spydr_im,xy(,,2)*fact,xy(,,1)*fact,levs=levs,smooth=spydr_smooth,marker='A',\
msize=1.2,mspace=0.2,color=ccolor,width=spydr_width,mcolor=spydr_mcolor;
spydr_pltitle,spydrs(imnum).name+swrite(format=" %dx%d",spydrs(imnum).dims(2),spydrs(imnum).dims(3));
spydr_xytitles,axtit,axtit;
levstr = sum(swrite(format="%.1f",levs)+", ");
levstr = "["+strpart(levstr,:-2)+"]";
spydr_clegends,levs;
spydr_pyk_status_push,"levels="+levstr;
// limits,old_limits; //(1),old_limits(2),old_limits(3),old_limits(4);
}
func spydr_clegends(levs)
{
local x,y,spacing,just;
extern spydr_clabel;
if (spydr_clabel==[]) spydr_clabel="clabeltopleft";
if (spydr_clabel=="clabelnone") return;
nlevs = numberof(levs);
vp = viewport();
spacing = (vp(4)-vp(3))/40.;
if (spydr_clabel=="clabeltopleft") {
x = vp(1)+(vp(2)-vp(1))/40.;
y = vp(4)-spacing/2.;
just="LT";
} else if (spydr_clabel=="clabeltopright") {
x = vp(2)-(vp(2)-vp(1))/40.;
y = vp(4)-spacing/2.;
just="RT";
} else if (spydr_clabel=="clabelbottomleft") {
x = vp(1)+(vp(2)-vp(1))/40.;
y = vp(3)+spacing/2.+nlevs*spacing;
just="LT";
} else if (spydr_clabel=="clabelbottomright") {
x = vp(2)-(vp(2)-vp(1))/40.;
y = vp(3)+spacing/2.+nlevs*spacing;
just="RT";
}
for (i=1;i<=nlevs;i++) {
if ((abs(levs(i))>=1e-3)&&(abs(levs(i)<1e-2))) fmt=" %+.6f";
else if ((abs(levs(i))>=1e-2)&&(abs(levs(i)<1e-1))) fmt=" %+.5f";
else if ((abs(levs(i))>=1e-1)&&(abs(levs(i)<1e1))) fmt=" %+.4f";
else if ((abs(levs(i))>=1e1)&&(abs(levs(i)<1e2))) fmt=" %+.3f";
else if ((abs(levs(i))>=1e2)&&(abs(levs(i)<1e3))) fmt=" %+.2f";
else if ((abs(levs(i))>=1e3)&&(abs(levs(i)<1e5))) fmt=" %+.1f";
else fmt=" %+.2e"
s = string(&char(64+i))+swrite(format=fmt,levs(i));
plt,s,x,y,tosys=0,justify=just,font="courier",height=10,color=spydr_mcolor;
y-=spacing;
}
}
func spydr_histeq_scale(z, top=, cmin=, cmax=)
/* DOCUMENT histeq_scale(z, top=top_value, cmin=cmin, cmax=cmax)
returns a byte-scaled version of the array Z having the property
that each byte occurs with equal frequency (Z is histogram
equalized). The result bytes range from 0 to TOP_VALUE, which
defaults to one less than the size of the current palette (or
255 if no pli, plf, or palette command has yet been issued).
If non-nil CMIN and/or CMAX is supplied, values of Z beyond these
cutoffs are not included in the frequency counts.
Identical to histeq_scale except it uses sedgesort instead of sort.
faster for arrays for which many elements are repeated (e.g.
CCD arrays where pixels values are integers.
SEE ALSO: bytscl, plf, pli
*/
{
if (is_void(top)) top= bytscl([0.,1.])(2); /* palette size - 1 */
top= long(top);
if (top<0 | top>255) error, "top value out of range 0-255";
y= z(*);
if (!is_void(cmin)) y= y(where(y>=cmin));
if (!is_void(cmax)) y= y(where(y<=cmax));
y= sedgesort(y);
x= span(0.,1., numberof(y));
xp= span(0.,1., top+2);
bins= interp(y, x, xp);
list= where(bins(dif)<=0.0);
if (numberof(list)) {
/* some value (or values) of z are repeated many times --
try to handle this by adding a small slope to the sorted y */
dy= y(0)-y(1);
if (!dy) dy= 1.0;
for (eps=1.e-10 ; eps<1000.1 ; eps*=10.) {
bins= interp(y+eps*dy*x, x, xp);
list= where(bins(dif)<=0.0);
if (!numberof(list)) break;
}
if (eps>1000.) error, "impossible error??";
}
return char(max(min(digitize(z,bins)-2,top),0));
}
func set_spydr_ccolor(color)
{
extern spydr_ccolor;
if (color==spydr_ccolor) return;
spydr_ccolor = color;
spydr_disp;
}
func set_spydr_mcolor(color)
{
extern spydr_mcolor;
if (color==spydr_mcolor) return;
spydr_mcolor = color;
spydr_disp;
}
func set_spydr_clabel(clabel)
{
extern spydr_clabel;
if (clabel==spydr_clabel) return;
spydr_clabel = clabel;
spydr_disp;
}
func disp_contours_plus_tv(void)
// coutour plot + pli for main window
{
disp_tv;
disp_contours,nofma=1;
}
func disp_surface(void)
// surface plot for main window
{
extern surface_init,surf_subim;
require,"plwf.i";
// require,"pl3d.i";
if (spydr_nim<1) return;
window,spydr_wins(1);
local max_dim;
max_dim=256;
if (surface_init) {
surf_subim = get_subim();
if (surf_subim==[]) return;
if (anyof(dimsof(surf_subim)(2:3)>max_dim)) {
maxfact = max(dimsof(surf_subim)(2:3)/float(max_dim));
final_dim = long(dimsof(surf_subim)(2:3)/maxfact);
surf_subim = bilinear(surf_subim,final_dim(1),final_dim(2));
}
}
orient3,spydr_azimuth*pi/180.,spydr_elevation*(pi/180.);
light3, diffuse=.5, specular=1., sdir=[1,.5,1];
xy = indices(dimsof(surf_subim));
fma;
if (spydr_shades) {
plwf,clip(surf_subim,cmin,cmax),xy(,,2),xy(,,1),edges=0,shade=1;
} else {
plwf,clip(surf_subim,cmin,cmax),xy(,,2),xy(,,1);
}
if (surface_init) limits;
surface_init=0;
}
func spydr_pltitle(title)
// pltitle adapted for spydr
{
plth_save = pltitle_height;
pltitle_height = long(pltitle_height*spydr_defaultdpi/83.);
port= viewport();
if (current_window()==spydr_wins(1)) plth=pltitle_height;
else plth=long(pltitle_height*0.85);
plt, escapechar(title), port(zcen:1:2)(1), port(4)+0.005,
font=pltitle_font, justify="CB", height=plth;
pltitle_height = plth_save;
}
func spydr_xytitles(xtitle,ytitle,adjust)
// xytitles adapted for spydr
{
plth_save = pltitle_height;
pltitle_height = long(pltitle_height*spydr_defaultdpi/83.);
curw=current_window();
if (curw==spydr_wins(3)) pltitle_height=long(pltitle_height*0.8);
if (adjust==[]) {
if (curw==spydr_wins(1)) adjust = xytitles_adjust1;
if (curw==spydr_wins(3)) adjust = xytitles_adjust3;
}
xytitles,escapechar(xtitle),escapechar(ytitle),adjust;
pltitle_height = plth_save;
}
func spydr_set_lut(_lut)
// change the LookUp Table and Intensity Transfer Table
{
require,"idl-colors.i";
extern rlut,glut,blut,spydr_lut;
local r,g,b;
// if ((!lut)||(lut==spydr_lut)) return; // nothing to do.
window,spydr_wins(1);
if (_lut!=[]) spydr_lut = _lut;
if (_lut!=[]) { // then read and set new lut
if (_lut==0) palette,"earth.gp";
else loadct,_lut;
palette,query=1,rlut,glut,blut; // store
}
// invert?
if (spydr_invertlut) {
r=rlut(::-1); g=glut(::-1); b=blut(::-1);
} else {
r=rlut; g=glut; b=blut;
}
// itt:
if (spydr_itt<=1) { // linear
ind = span(0.,1.,spydr_ncolors);
} else if (spydr_itt==2) { // sqrt
ind = sqrt(span(0.,1.,spydr_ncolors));
} else if (spydr_itt==3) { // square
ind = (span(0.,1.,spydr_ncolors))^2.;
} else if (spydr_itt==4) { // log
ind = log10(span(10.^(-spydr_log_itt_dex),1.,spydr_ncolors)); // 8 dex
ind -= min(ind);
ind /= max(ind);
} else if (spydr_itt>=5) { // histeq
ind = span(0.,1.,spydr_ncolors);
}
ind = long(round(ind*(spydr_ncolors-1)+1));
r = r(ind); g = g(ind); b = b(ind);
// and finally, load the palette:
for (i=1;i<=3;i++) {
window,spydr_wins(i);
palette,r,g,b;
}
spydr_disp;
}
func disp_cpc(e,all=)
{
extern cmin,cmax,imnum,spydrs,gui_realized;
if (spydr_nim<1) return;
if (all) eq_nocopy,subim,spydr_im;
else subim=get_subim(x1,x2,y1,y2);
if (subim==[]) subim = spydr_im; // init, not defined
if (e==0) {
cmin = min(subim);
cmax = max(subim);
} else {
tmp = minmax(cpc(subim,0.1,0.999));
cmin = tmp(1);
cmax = tmp(2);
}
// deal with image==constant
if (cmax==cmin) {
cmin -= 0.5;
cmax += 0.5;
}
spydrs(imnum).cmin = cmin;
spydrs(imnum).cmax = cmax;
if (gui_realized) \
spydr_pyk,swrite(format="y_set_cmincmax(%f,%f,%f,1)",float(cmin),float(cmax),float(cmax-cmin)/100.);
}
func rad4zoom_incr(void) { rad4zoom=min(rad4zoom+1,spydrs(imnum).dims(2)/2); }
func rad4zoom_decr(void) { rad4zoom=max(rad4zoom-1,0); }
//=================================
// PLOT functions
//=================================
func spydr_compute_distance(zero)
{
extern zero_coord;
if ((zero)||(zero_coord==[])) {
zero_coord = current_mouse(spydr_wins(1));
spydr_pyk_status_push,swrite(format="coordinates = (%.2f,%.2f)",zero_coord(1),zero_coord(2));
return;
}
coord = current_mouse(spydr_wins(1));
if (coord==[]) return;
if (zero_coord==[]) return;
dis = abs(coord(1)-zero_coord(1),coord(2)-zero_coord(2));
spydr_pyk_status_push,swrite(format="coordinates = (%.2f,%.2f), dist. to ref = %.2f pixels = %.3f \"",\
coord(1),coord(2),dis,dis*spydrs(imnum).pixsize);
}
func show_lower_gui(visibility)
{
spydr_pyk,swrite(format="glade.get_widget('togglelower').set_active(%d)",visibility(1));
}
func plot_cut(void)
{
extern onedx,onedy;
curw = current_window();
window,spydr_wins(1);
spydr_pyk_status_push,"Click and drag over desired cut";
m=mouse(1,2,"Click and drag over desired cut");
spydr_pyk_status_push,"";
if (spydr_plot_in_arcsec) m(1:4)=spydr_arcsec_to_pixels(m(1:4));
x1=m(1); y1=m(2);
x2=m(3); y2=m(4);
d = abs(x2-x1,y2-y1);
x = span(x1,x2,long(ceil(d)));
y = span(y1,y2,long(ceil(d)));
cut_y = spline2(spydr_im,x,y);
cut_x = sqrt( (x-x1)^2. + (y-y1)^2.);
if (spydr_plot_in_arcsec) {
if (spydr_check_pixsize()) return;
cut_x *= spydrs(imnum).pixsize;
xtit = "arcsec";
} else xtit="pixels";
show_lower_gui,1;
window,spydr_wins(3);
fma;
plh,cut_y,cut_x;
limits,square=0; limits;
spydr_xytitles,xtit,"value";
spydr_pltitle,swrite(format="[%.1f,%.1f] to [%.1f,%.1f]",x1,y1,x2,y2);
limits;
range,cmin-0.1*(cmax-cmin),cmax;
// plmargin,0.02;
window,curw;
onedx=cut_x;
onedy=cut_y;
}
func plot_xcut(j)
{
extern onedx,onedy;
if (spydr_nim<1) return;
if (spydr_plot_in_arcsec) {
if (spydr_check_pixsize()) return;
fact = spydrs(imnum).pixsize;
xtit = "arcsec";
} else {
fact = 1.0f;
xtit="pixels";
}
if (j==[]) {
cur=get_cursor();
if (cur==[]) return;
j = cur(2)
}
if ((j<1)||(j>spydrs(imnum).dims(3))) return;
get_subim,i1,i2,j1,j2;
curw = current_window();
show_lower_gui,1;
window,spydr_wins(3);
fma;
cut_y=spydr_im(,j);
cut_x=indgen(spydrs(imnum).dims(2))*fact;
plh,cut_y,cut_x;
spydr_xytitles,xtit,"value";
spydr_pltitle,swrite(format="line# %d",j);
limits,i1*fact,i2*fact,cmin-0.1*(cmax-cmin),cmax;
window,curw;
onedx=cut_x(long(i1):long(i2));
onedy=cut_y(long(i1):long(i2));
}
func plot_ycut(i)
{
extern onedx,onedy;
if (spydr_nim<1) return;
if (spydr_plot_in_arcsec) {
if (spydr_check_pixsize()) return;
fact = spydrs(imnum).pixsize;
xtit = "arcsec";
} else {
fact = 1.0f;
xtit="pixels";
}
if (i==[]) {
cur=get_cursor();
if (cur==[]) return;
i = cur(1)
}
if ((i<1)||(i>spydrs(imnum).dims(2))) return;
get_subim,i1,i2,j1,j2;
curw = current_window();
show_lower_gui,1;
window,spydr_wins(3);
fma;
cut_y=spydr_im(i,);
cut_x=indgen(spydrs(imnum).dims(3))*fact;
plh,cut_y,cut_x;
spydr_xytitles,xtit,"value";
spydr_pltitle,swrite(format="column# %d",i);
limits,j1*fact,j2*fact,cmin-0.1*(cmax-cmin),cmax;
window,curw;
onedx=cut_x(long(j1):long(j2));
onedy=cut_y(long(j1):long(j2));
}
func spydr_gauss_foo(x,aa)
{
return aa(1)+aa(2)*exp(-0.5*((x-aa(3))/(sign(aa(4))*(abs(aa(4))+1e-12)))^2.);
}
func spydr_line_foo(x,aa)
{
return aa(1)+aa(2)*x;
}
func fit_1d(type)
/* DOCUMENT fit_1d(type)
fit a function to the 1D display
type: 0=line
1=gaussian
SEE ALSO:
*/
{
extern onedx,onedy;
local units;
if (onedy==[]) {
spydr_pyk_status_push,"Nothing to fit",clean_after=5;
return;
}
if (numberof(onedy)!=numberof(onedx)) {
spydr_pyk_status_push,"onedy and onedx do not have the same dimensions!",clean_after=5;
return;
}
bkgrd = median(onedy);
if (type==1) {
sigestimate = sum(onedy>max(onedy/2.))*(onedx(2)-onedx(1))/2.35;
a = [bkgrd,max(onedy)-bkgrd,onedx(wheremax(onedy))(1),sigestimate];
r= lmfit(spydr_gauss_foo,onedx,a,onedy);
yfit = spydr_gauss_foo(onedx,a);
a(4)=abs(a(4));
// if (spydr_plot_in_arcsec) units="arcsec"; else units="pixels";
units = "";
spydr_pyk_status_push,swrite(format=\
"gaussian, max=%f @ x=%.3f, sig=%.3f%s (fwhm=%.3f), background=%f", \
a(2),a(3),a(4),units,a(4)*2.355,a(1));
} else if (type==0) {
a = [bkgrd,0.];
r= lmfit(spydr_line_foo,onedx,a,onedy,stdev=1);
yfit = spydr_line_foo(onedx,a);
std = *r.stdev;
spydr_pyk_status_push,swrite(format= \
"linear fit, constant=%.5g+/-%.5g, slope=%.5g+/-%.5g",a(1),std(1),a(2),std(2));
}
curw = current_window();
window,spydr_wins(3);
plh,yfit,onedx,color="red";
window,curw;
}
func plot_radial(void)
{
extern onedx,onedy;
if (spydr_nim<1) return;
cur=get_cursor();
subim=get_subim(i1,i2,j1,j2);
if (subim==[]) return;
curw = current_window();
show_lower_gui,1;
window,spydr_wins(3);
xy = indices(dimsof(subim))-(cur(1:2)-[i1,j1]+1)(-,-,);
d = abs(xy(,,1),xy(,,2));
fma;
if (spydr_plot_in_arcsec) {
if (spydr_check_pixsize()) return;
fact = spydrs(imnum).pixsize;
xtit = "arcsec";
} else {
fact = 1.0f;
xtit="pixels";
}
onedx = d(*)*fact;
onedy = subim(*);
onedx = _(-onedx(::-1),onedx);
onedy = _(onedy(::-1),onedy);
w = sort(onedx);
onedx = onedx(w);
onedy = onedy(w);
// plp,subim,d*fact,symbol=default_symbol,size=0.3;
plp,onedy,onedx,symbol=default_symbol,size=0.3;
spydr_xytitles,xtit,"value";
limits;
plmargin,0.02;
window,curw;
}
func plot_histo(void)
{
extern onedx,onedy;
if (spydr_nim<1) return;
subim=get_subim(x1,x2,y1,y2); //must be in window,1 when doing that.
if (subim==[]) return;
if (!spydr_histnbins) spydr_histnbins=100;
if (spydr_histbinsize==0) binsize=(cmax-cmin)/spydr_histnbins;
else binsize = spydr_histbinsize;
// deal with all zero arrays
if (binsize==0) binsize=1;
spydr_histbinsize = binsize;
spydr_pyk,swrite(format="y_parm_update('binsize',%f)",float(spydr_histbinsize));
hy = histo2(subim(*),hx,binsize=binsize,binmin=cmin,binmax=cmax);
if (numberof(hx)==0) {
hx = [cmin,cmax];
hy = [0,0];
} else if (numberof(hx)==1) {
hx = [cmin,hx(1),cmax];
hy = [0,hy(1),0];
}
curw = current_window();
show_lower_gui,1;
window,spydr_wins(3);
fma;
plh,hy,hx;
// plmargin,0.02;
spydr_pltitle,swrite(format="%s: histogram of region [%d:%d,%d:%d]",spydrs(imnum).name,x1,x2,y1,y2);
spydr_pyk_status_push,swrite(format=" %s: avg=%4.7g | med=%4.7g | rms=%4.7g",
spydrs(imnum).name,avg(subim),sedgemedian(subim(*)),subim(*)(rms));
spydr_xytitles,"value","number in bin";
limits;
plmargin;
window,curw;
onedx = hx;
onedy = hy;
}
func do_limits(void)
{
curw = current_window();
window,spydr_wins(3);
limits,square=0;
limits;
window,curw;
}
//============================
// Convenience Functions
//============================
func spydr_exportjpeg(name)
{
extern spydr_savedir;
if ((strpart(name,-3:0)!=".jpg")&&(strpart(name,-4:0)!=".jpeg")) name+=".jpg";
spydrs(imnum).saveasname = basename(name);
spydr_savedir = dirname(name);
window,spydr_wins(1);
jpeg,name;
write,format="Image exported to %s\n",name;
spydr_pyk_status_push,swrite(format="Image exported to %s",name),clean_after=5;
}
func spydr_exportpng(name)
{
extern spydr_savedir;
if (strpart(name,-3:0)!=".png") name+=".png";
spydrs(imnum).saveasname = basename(name);
spydr_savedir = dirname(name);
window,spydr_wins(1);
png,name;
write,format="Image exported to %s\n",name;
spydr_pyk_status_push,swrite(format="Image exported to %s",name),clean_after=5;
}
func spydr_exportpdf(name)
{
extern spydr_savedir;
if (strpart(name,-3:0)!=".pdf") name+=".pdf";
spydrs(imnum).saveasname = basename(name);
spydr_savedir = dirname(name);
window,spydr_wins(1);
pdf,name;
write,format="Image exported to %s\n",name;
spydr_pyk_status_push,swrite(format="Image exported to %s",name),clean_after=5;
}
func spydr_exportps(name)
{
extern spydr_savedir;
if (strpart(name,-2:0)==".ps") name=strpart(name,1:-3);
spydrs(imnum).saveasname = basename(name);
spydr_savedir = dirname(name);
window,spydr_wins(1);
hcps,name;
write,format="Image exported to %s.ps\n",name;
spydr_pyk_status_push,swrite(format="Image exported to %s.ps",name),clean_after=5;
}
func spydr_exporteps(name)
{
extern spydr_savedir;
if (strpart(name,-3:0)==".eps") name=strpart(name,1:-4);
spydrs(imnum).saveasname = basename(name);
spydr_savedir = dirname(name);
window,spydr_wins(1);
eps,name;
write,format="Image exported to %s.eps\n",name;
spydr_pyk_status_push,swrite(format="Image exported to %s.eps",name),clean_after=5;
}
func spydr_save(void)
{
extern spydr_savedir;
name = spydr_savedir+"/"+escapechar2save(spydrs(imnum).saveasname);
if (strpart(name,-4:0) != ".fits") name+=".fits";
// fits_write,name,*spydrs(imnum).pim,overwrite=1;
fits_write,name,spydr_im,overwrite=1;
write,format="Image saved in %s\n",name;
spydr_pyk_status_push,swrite(format="Image saved in %s",name),clean_after=5;
}
func spydr_saveas(name)
{
extern spydr_savedir;
if (strpart(name,-4:0) != ".fits") name+=".fits";
spydrs(imnum).saveasname = basename(name);
spydr_savedir = dirname(name);
fits_write,name,*spydrs(imnum).pim,overwrite=1;
write,format="Image saved in %s\n",name;
spydr_pyk_status_push,swrite(format="Image saved in %s",name),clean_after=5;
}
func escapechar2save(s)
{
s=streplace(s,strfind(".fits",s,n=20),"");
s=streplace(s,strfind("/",s,n=20),":");
s=streplace(s,strfind(" ",s,n=20),"_");
return s;
}
//===============================
func spydr_cubeops(opn)
{
local cube;
if (spydr_nim<1) return;
if (nallof(spydrs.dims==spydrs(1).dims)) {
spydr_pyk_error,"cubeops: all images must have the same size";
return;
}
spydr_pyk,"set_cursor_busy(1)";
spydr_pyk_status_push,"Processing cube operation, please wait...";
cube = array(float,_(3,spydrs(1).dims(2:3),spydr_nim));
for (i=1;i<=spydr_nim;i++) cube(,,i) = *spydrs(i).pim;
cube = cube(,,where(spydrs.space!="results"));
if (opn==1) {
res = median(cube,3);
spydr,res,append=1,name="cube median";
} else if (opn==2) {
res = cube(,,avg);
spydr,res,append=1,name="cube average";
} else if (opn==3) {
res = cube(,,sum);
spydr,res,append=1,name="cube sum";
} else if (opn==4) {
res = cube(,,rms);
spydr,res,append=1,name="cube rms";
}
spydrs(0).space="results";
cube=[];
spydr_pyk,"set_cursor_busy(0)";
spydr_pyk_status_push,"Processing cube operation: Done.",clean_after=5;
}
func spydr_rebin(fact2)
// rebin the image by 2,3,4
{
extern spydr_im,cur_limits,rebin_init,rebin_fact,rebin_stamp;
window,spydr_wins(1);
fact = 2.^fact2;
if (fact==rebin_fact) return;
// if (fact==1) {
// spydr_im = *spydrs(imnum).pim;
// spydrs(imnum).pixsize = spydrs(imnum).opixsize;
// spydrs(imnum).dims = dimsof(spydr_im); // update dims
// rebin_fact=1;
// return;
// }
spydr_im=*spydrs(imnum).pim;
if (fact>1) {
spydr_im = spline2(spydr_im,fact); // interpolate
} else if (fact<1) {
for (i=-1;i>=fact2;i--) {
newdims = dimsof(spydr_im)/2*2;
spydr_im = bin2(spydr_im(1:newdims(2),1:newdims(3)))/4.;
}
}
spydrs(imnum).dims = dimsof(spydr_im); // update dims
// set news limits so that area displayed is unchanged:
if (!spydr_plot_in_arcsec) {
these_limits = limits();
these_limits(1:4) /= rebin_fact; // what were the real limits with previous fact
limits,_(these_limits(1:4)*fact,these_limits(5));
}
rebin_fact = fact; // keep for next rebin
spydrs(imnum).pixsize = spydrs(imnum).opixsize/fact;
spydr_pyk,swrite(format="y_parm_update('pixsize',%f)",float(spydrs(imnum).pixsize));
spydr_pyk_status_push,swrite(format="Image rebinned to %dx%d",\
spydrs(imnum).dims(2),spydrs(imnum).dims(3)),clean_after=5;
}
func get_subim(&x1,&x2,&y1,&y2)
{
if (spydr_nim<1) return;
curw = current_window();
window,spydr_wins(1);
lim=limits();
if (spydr_plot_in_arcsec) lim(1:4) = spydr_arcsec_to_pixels(lim(1:4));
x1=long(floor(clip(lim(1),1,spydrs(imnum).dims(2))));
x2=long(ceil(clip(lim(2),1,spydrs(imnum).dims(2))));
y1=long(floor(clip(lim(3),1,spydrs(imnum).dims(3))));
y2=long(ceil(clip(lim(4),1,spydrs(imnum).dims(3))));
if ( (x1==x2) || (y1==y2) ) {
// spydr_pyk_status_push,"WARNING: (get_subim) Nothing to show";
// write,"WARNING: (get_subim) Nothing to show";
return;
}
window,curw;
return spydr_im(x1:x2,y1:y2)
}
func toggle_xcut(void) {
extern xcut, ycut;
ycut=0;
xcut = 1-xcut;
if (xcut) plot_xcut;
if (xcut) spydr_pyk_status_push,"\"X\" again to stop continuous X cuts";
else spydr_pyk_status_push,"";
}
func toggle_ycut(void) {
extern xcut, ycut;
xcut=0;
ycut = 1-ycut;
if (ycut) plot_ycut;
if (ycut) spydr_pyk_status_push,"\"Y\" again to stop continuous Y cuts";
else spydr_pyk_status_push,"";
}
func toggle_animate(state)
{
plsys,1;
if (state==0) fma;
if (state!=[]) animate,state; else animate;
}
func gui_update(void)
{
extern spydrs,imnum,spydr_lut;
extern first_update;
if (imnum==[]) return; // GUI open but no image
spydr_pyk,swrite(format="window.set_title('spydr - %s')",spydrs(imnum).name);
spydr_pyk,swrite(format="current_image_saveas_name = '%s'",escapechar2save(spydrs(imnum).saveasname));
spydr_pyk,swrite(format="y_parm_update('binsize',%f)",float(spydr_histbinsize));
spydr_pyk,swrite(format="y_parm_update('nlevs',%d)",long(spydr_nlevs));
spydr_pyk,swrite(format="y_parm_update('pixsize',%f)",float(spydrs(imnum).pixsize));
spydr_pyk,swrite(format="y_parm_update('boxsize',%d)",long(spydr_boxsize));
spydr_pyk,swrite(format="y_parm_update('saturation',%f)",float(spydr_saturation));
spydr_pyk,swrite(format="y_parm_update('airmass',%f)",float(spydr_airmass));
spydr_pyk,swrite(format="y_parm_update('wavelength',%f)",float(spydrs(imnum).wavelength));
spydr_pyk,swrite(format="y_parm_update('teldiam',%f)",float(spydr_teldiam));
spydr_pyk,swrite(format="y_parm_update('zero_point',%f)",float(spydr_zero_point));
spydr_pyk,swrite(format="y_parm_update('cobs',%f)",float(spydr_cobs));
spydr_pyk,swrite(format="y_parm_update('strehl_aper_diameter',%f)",float(spydr_strehlaper));
spydr_pyk,swrite(format="y_set_checkbutton('compute_strehl',%d)",long(compute_strehl));
spydr_pyk,swrite(format="glade.get_widget('plugins').set_active(%d)",spydr_showplugins);
spydr_pyk,swrite(format="y_set_checkbutton('output_magnitudes',%d)",long(output_magnitudes));
spydr_pyk,swrite(format="y_set_cmincmax(%f,%f,%f,0)",float(cmin),float(cmax),float(cmax-cmin)/100.);
spydr_pyk,swrite(format="y_set_lut(%d)",spydr_lut);
spydr_pyk,swrite(format="y_set_invertlut(%d)",spydr_invertlut);
spydr_pyk,swrite(format="y_set_itt(%d)",clip(long(spydr_itt-1),0,4));
if (first_update==[]) {
spydr_pyk,swrite(format="currentsavedir = '%s'",spydr_savedir);
spydr_pyk,"glade.get_widget('menubar_images').set_sensitive(1)";
spydr_pyk,"glade.get_widget('menubar_ops').set_sensitive(1)";
spydr_pyk,"glade.get_widget('save').set_sensitive(1)";
spydr_pyk,"glade.get_widget('export').set_sensitive(1)";
spydr_pyk,"glade.get_widget('saveas').set_sensitive(1)";
spydr_pyk,swrite(format="glade.get_widget('debug').set_active(%d)",pyk_debug);
spydr_pyk,swrite(format="glade.get_widget('plot_in_arcsec').set_active(%d)",spydr_plot_in_arcsec);
spydr_pyk,swrite(format="glade.get_widget('cmincmax').set_active(%d)",zoom_cmincmax);
// spydr_pyk,swrite(format="glade.get_widget('%s').set_active(1)",spydr_ccolor);
first_update=1;
}
sync_view_menu;
}
func imchange_update(void)
{
extern imnum,cmin,cmax;
spydr_pyk,swrite(format="y_parm_update('pixsize',%f)",float(spydrs(imnum).pixsize));
spydr_pyk,swrite(format="y_parm_update('wavelength',%f)",float(spydrs(imnum).wavelength));
spydr_pyk,swrite(format="y_parm_update('zero_point',%f)",float(spydr_zero_point));
spydr_pyk,swrite(format="y_set_cmincmax(%f,%f,%f,0)",float(cmin),float(cmax),float(cmax-cmin)/100.);
spydr_disp;
}
//==============================
// ZOOM, cursor and misc graphic
//==============================
prevxy = [0,0];
func get_cursor(wid)
/* DOCUMENT get_cursor(wid)
returns [xpos,ypos]
where xpos,ypos is the cursor x and y coordinates
Returns [] if not in correct window;
SEE ALSO:
*/
{
if (wid==[]) wid=spydr_wins(1);
cur = current_mouse(wid);
if (cur==[]) return;
if (spydr_plot_in_arcsec) {
// return in pixels
if (spydr_check_pixsize()) return;
cur(1:2) = spydr_arcsec_to_pixels(cur(1:2));
} else {
cur(1:2) = cur(1:2)+1; //ceil
}
cur = long(cur);
return cur;
}
stop_zoom=0;
func spydr_clean(void)
{
extern spydrs,imnum;
extern spydr_im,cmin,cmax;
extern spydr_fh,x1,x2,y1,y2;
extern imnamen,spydr_nim,xcut,ycut;
spydr_get_available_windows;
imnamen=spydr_nim=xcut=ycut=0;
stop_zoom=1;
spydrs=spydr_im=imnum=spydr_fh=x1=x2=y1=y2=[];
}
func spydr_check_pixsize(void)
{
if (spydrs(imnum).pixsize==0) {
spydr_pyk_error,"Coordinates requested in arcsec but pixsize is 0!";
return 1;
} else return 0;
}
func spydr_set_plot_in_arcsec(flag)
{
extern spydr_plot_in_arcsec;
if (flag) if (spydr_check_pixsize()) return;
spydr_plot_in_arcsec = flag;
spydr_disp;
unzoom;
limits;
}
func spydr_arcsec_to_pixels(arcsec)
{
if (spydr_check_pixsize()) return;
return long(arcsec/spydrs(imnum).pixsize)+1;
}
zoom_started=0;
func start_zoom(void)
{
extern stop_zoom,zoom_started;
if (zoom_started) return; // already running.
zoom_started=1;
disp_zoom;
}
func disp_zoom(once=)
{
extern from_disp,stop_zoom,from_imnum;
extern rad4zoom;
if (stop_zoom) {
stop_zoom=0;
return;
}
// write,format="%s ","+";
cur = get_cursor();
if ( (cur==[]) || (from_disp==3) ) { // not in correct window
if (!once) after,0.05,disp_zoom;
return;
}
if ((from_imnum==[])||(from_imnum==imnum)) {
if (allof(prevxy==cur(1:2)) && (prevz==rad4zoom)) { // same positon as before
if (!once) after,0.05,disp_zoom;
return;
}
}
from_imnum=imnum;
sys = cur(3);
if (sys!=0) {
i = clip(cur(1),1,spydrs(imnum).dims(2));
j = clip(cur(2),1,spydrs(imnum).dims(3));
spydr_pyk,swrite(format="y_set_xyz('%d','%d','%4.5g')",\
i,j,float(spydr_im(i,j)));
local_rad=min([5,rad4zoom]);
x1 = clip(i-local_rad,1,spydrs(imnum).dims(2));
x2 = clip(i+local_rad,1,spydrs(imnum).dims(2));
y1 = clip(j-local_rad,1,spydrs(imnum).dims(3));
y2 = clip(j+local_rad,1,spydrs(imnum).dims(3));
spydr_pyk,swrite(format="y_text_parm_update('localmax','%4.5g')",\
float(max(spydr_im(x1:x2,y1:y2))));
sim=spydr_im(x1:x2,y1:y2);
wm = where2(sim==max(sim))(,1)-local_rad-1;
if ((i-local_rad)<1) wm(1) += (1-i+local_rad);
if ((j-local_rad)<1) wm(2) += (1-j+local_rad);
rad4zoom = min(rad4zoom,min(spydrs(imnum).dims(2:3))/2-1);
x1 = i-rad4zoom;
x2 = i+rad4zoom;
y1 = j-rad4zoom;
y2 = j+rad4zoom;
if (x1<1) { x1=1; x2=2*rad4zoom+1; }
else if (x2>spydrs(imnum).dims(2)) { x2=spydrs(imnum).dims(2); x1=x2-2*rad4zoom; }
if (y1<1) { y1=1; y2=2*rad4zoom+1; }
else if (y2>spydrs(imnum).dims(3)) { y2=spydrs(imnum).dims(3); y1=y2-2*rad4zoom; }
window,spydr_wins(2);
fma;
if (zoom_cmincmax) {
//pli,bytscl(spydr_im(x1:x2,y1:y2),cmin=cmin,cmax=cmax);
pli,spydr_imd(x1:x2,y1:y2),2*rad4zoom+1,2*rad4zoom+1;
} else pli,spydr_im(x1:x2,y1:y2),2*rad4zoom+1,2*rad4zoom+1;
// limits,0,2*rad4zoom+1,0,2*rad4zoom+1;
limits;
// plot local maxima location
plp,j-y1+wm(2)+0.5,i-x1+wm(1)+0.5,symbol=2,color="blue",width=1;
// plot cursor location
plp,j-y1+0.5,i-x1+0.5,symbol=2,color="red",width=3;
// x and y cuts
if (xcut) {
plot_xcut,j;
} else if (ycut) {
plot_ycut,i;
}
window,spydr_wins(1);
}
prevxy = cur(1:2);
prevz = rad4zoom;
if (!once) after,0.05,disp_zoom;
}
func escapechar(s)
{
s=streplace(s,strfind("_",s,n=20),"!_");
s=streplace(s,strfind("^",s,n=20),"!^");
return s;
}
func spydr_shortcut_help(void)
{
help_text = ["",
"The following shortcuts are available:",
" x/y: Plot line/column under cursor",
" X/Y: Toggle continuous plot of line/column",
" under cursor",
" c: Interactive plot of cut across image",
" h: Plot histogram of visible region",
" r: Radial plot centered on cursor",
" f: Gaussian fit to 1d plot",
" F: Linear fit to 1d plot",
" e: Adjust min and max cut to 10% and 99.9% "," of distribution of visible region",
" E: Reset min and max cut to min and max "," of visible region",
" n/p: Next/prevous image",
" D: Delete current image from stack",
" R: Replace stack image by displayed image",
" s: Sigma filter visible image region",
" S: 2x2 smooth visible image region",
" M: Mark coordinate zero point (see m)",
" m: Compute distance to coordinate zero point",
" -/+: Decrease/Increase zoom factor in zoom window",
" u: Unzoom",
" ?: This help",""];
write,format="%s\n",help_text(2:-1);
spydr_pyk_info_w_markup,help_text;
}
func strehl_convert(sfrom,wfrom,wto)
{
return exp(wfrom^2.*log(sfrom)/wto^2.)
}
func set_imnum(nn,from_python,force=)
{
extern spydrs,imnum,rebin_fact;
extern spydr_im,cmin,cmax;
extern gui_realized;
//write,format="YORICK: Request for set_imnum %d\n",nn;
if ((nn==imnum)&&(!force)) return;
if (nn>spydr_nim) return;
imnum = nn;
spydr_im = *(spydrs(imnum).pim);
spydrs(imnum).dims = dimsof(spydr_im);
spydrs(imnum).pixsize = spydrs(imnum).opixsize;
rebin_fact=1;
if ((spydrs(imnum).cmin==0)&(spydrs(imnum).cmax==0)) disp_cpc,1,all=1;
else {
cmin = spydrs(imnum).cmin;
cmax = spydrs(imnum).cmax;
}
if ((from_python==[])&&(gui_realized)) {
spydr_pyk,swrite(format="set_imnum(%d,%d,%d)",nn,spydr_nim,(spydr_nim>1));
}
if (gui_realized) {
spydr_pyk,swrite(format="window.set_title('spydr - %s')",spydrs(nn).name);
spydr_pyk,swrite(format="current_image_saveas_name = '%s'",escapechar2save(spydrs(imnum).saveasname));
}
}
func spydr_redisp(void)
{
extern spydrs,imnum,spydr_im;
spydr_im = *(spydrs(imnum).pim);
spydr_disp;
}
func set_cmin(pycmin)
{
extern spydrs,cmin,imnum;
// write,format="pycmin=%f, cmin=%f\n",pycmin,cmin;
// because the precision was cut by the yorick -> python -> yoric
// transfer, we have to allow for some slack
if ((cmax-cmin)!=0) if ((abs(pycmin-cmin)/(cmax-cmin))<1e-3) return;
if (pycmin>cmax) {
spydr_pyk_status_push,"cmin > cmax, ignoring",clean_after=5;
return;
}
cmin = spydrs(imnum).cmin = pycmin;
spydr_disp;
}
func set_cmax(pycmax)
{
extern spydrs,cmax,imnum;
// write,format="pycmax=%f, cmax=%f\n",pycmax,cmax;
// because the precision was cut by the yorick -> python -> yoric
// transfer, we have to allow for some slack
if ((cmax-cmin)!=0) if ((abs(pycmax-cmax)/(cmax-cmin))<1e-3) return;
if (pycmax0) targets = args(wtargets);
flags = args(wflags);
nflags = numberof(flags);
valid = array(0,nflags);
for (i=1;i<=nflags;i++) {
if (flags(i)=="--batch") {
batch,1;
valid(i)=1;
}
if ((flags(i)=="--debug")|(flags(i)=="-d")) {
pyk_debug=1;
valid(i)=1;
}
if ((flags(i)=="--help")|(flags(i)=="-h")) {
print_help;
}
if (flags(i)=="--invert") {
spydr_invertlut=1;
valid(i)=1;
}
if ((flags(i)=="--fullgui")|(flags(i)=="-g")) {
spydr_showplugins=1;
valid(i)=1;
}
if ((flags(i)=="--compact")|(flags(i)=="-c")) {
spydr_showlower=0;
valid(i)=1;
}
if (flags(i)=="--dpi") {
if (i==nflags) print_help,flags(i);
spydr_dpi=0;
sread,flags(i+1),spydr_dpi;
valid(i:i+1)=1;
}
if (flags(i)=="--hdu") {
if (i==nflags) print_help,flags(i);
spydr_hdu=0;
sread,flags(i+1),spydr_hdu;
valid(i:i+1)=1;
}
if (flags(i)=="--itt") {
if (i==nflags) print_help,flags(i);
spydr_itt=0;
sread,flags(i+1),spydr_itt;
valid(i:i+1)=1;
}
if ((flags(i)=="--conf")|(flags(i)=="-f")) {
if (i==nflags) print_help,flags(i);
spydr_conffile="";
sread,flags(i+1),spydr_conffile;
valid(i:i+1)=1;
}
if (flags(i)=="--azimuth") {
if (i==nflags) print_help,flags(i);
spydr_azimuth=0;
sread,flags(i+1),spydr_azimuth;
valid(i:i+1)=1;
}
if (flags(i)=="--elevation") {
if (i==nflags) print_help,flags(i);
spydr_elevation=0;
sread,flags(i+1),spydr_elevation;
valid(i:i+1)=1;
}
if ((flags(i)=="--pixsize")|(flags(i)=="--platescale")|(flags(i)=="-p")) {
if (i==nflags) print_help,flags(i);
spydr_pixsize=0.;
sread,flags(i+1),spydr_pixsize;
// spydr_set_pixsize;
valid(i:i+1)=1;
}
if ((flags(i)=="--boxsize")|(flags(i)=="-b")) {
if (i==nflags) print_help,flags(i);
spydr_boxsize=0;
sread,flags(i+1),spydr_boxsize;
valid(i:i+1)=1;
}
if ((flags(i)=="--saturation")|(flags(i)=="-s")) {
if (i==nflags) print_help,flags(i);
spydr_saturation=0;
sread,flags(i+1),spydr_saturation;
valid(i:i+1)=1;
}
if ((flags(i)=="--wavelength")|(flags(i)=="-w")) {
if (i==nflags) print_help,flags(i);
spydr_wavelength=0.;
sread,flags(i+1),spydr_wavelength;
valid(i:i+1)=1;
}
if (flags(i)=="--zeropoint") {
if (i==nflags) print_help,flags(i);
spydr_zero_point=0.;
sread,flags(i+1),spydr_zero_point;
valid(i:i+1)=1;
}
if (flags(i)=="--nbins") {
if (i==nflags) print_help,flags(i);
spydr_histnbins=0;
sread,flags(i+1),spydr_histnbins;
valid(i:i+1)=1;
}
if ((flags(i)=="--strehlaper")|(flags(i)=="-m")) {
if (i==nflags) print_help,flags(i);
spydr_strehlaper=0.;
sread,flags(i+1),spydr_strehlaper;
valid(i:i+1)=1;
}
}
if (anyof(valid==0)) {
write,format=" *** ERROR: Unknow flag %s ***\n",flags(where(valid==0)(1));
print_help;
if (spydr_context=="called_from_shell") quit;
}
return targets;
}
func print_help(field)
{
if (field) write,format="Syntax error, missing value for %s:\n",field;
else write,format="%s\n","Syntax error:";
write,format="%s\n","spydr [--conf conffile --dpi value --itt value --azimuth value --elevation value";
write,format="%s\n"," --hdu value --pixsize|platescale value --boxsize value --saturation value ";
write,format="%s\n"," --wavelength value --zeropoint value --nbins value --strehlaper value";
write,format="%s\n"," --invert --debug --fullgui --compact --batch] image1.fits [image2.fits ...]";
if (spydr_context=="called_from_shell") quit;
}
func which_spydrconf(void) {
// look for a possible user's spydr.conf:
require,"pathfun.i";
local file,path;
path1 = pathform(_("./",Y_USER,Y_SITE,"/etc/"));
file = find_in_path("spydr.conf",takefirst=1,path=path1);
if (file==[]) {
path2 = pathform(_("./",Y_USER,Y_SITE)+"share/");
file = find_in_path("spydr.conf",takefirst=1,path=path2);
}
if (file==[]) {
path3 = pathform(_("./",Y_USER,Y_SITE)+"share/spydr/");
file = find_in_path("spydr.conf",takefirst=1,path=path3);
}
if (file==[]) {
spydr_pyk_error,swrite(format="Can't find spydr.conf in %s:%s:%s\n",path1,path2,path3);
error,swrite(format="Can't find spydr.conf in %s:%s:%s\n",path1,path2,path3);
}
// write,format=" Using %s\n",file;
return file;
}
func spydr_quit(void)
{
extern spydr_context,stop_zoom,spydr_win_had_focus;
extern gui_realized,zoom_started,spydr_disp;
extern first_update;
if (spydr_context=="called_from_shell") {
quit;
} else {
spydr_clean;
stop_zoom=1;
gui_realized=0;
zoom_started=0;
first_update=[];
spydr_disp=disp_tv;
_spydr_pyk_proc=[];
if (spydr_win_had_focus>-1) window,spydr_win_had_focus;
}
}
func add_view_menu(item,ind)
{// unused
spydr_pyk,swrite(format="add_to_image_menu('%s',%d)",item,ind);
}
func sync_view_menu(void)
{
spydr_pyk,"reset_image_menu()";
for (i=1;i<=numberof(spydrs);i++) {
spydr_pyk,swrite(format="add_to_image_menu('%s',%d)",spydrs(i).name,i);
}
}
//=======================
// MAIN ROUTINE
//=======================
func spydr(vimage,..,wavelength=,pixsize=,name=,append=,hdu=,compact=)
/* DOCUMENT spydr,image,..,wavelength=,pixsize=,name=,append=,hdu=,compact=
Software Package in Yorick for Data Reduction
From the command line
$ spydr [options] image*.fits cube.fits
$ yorick -i path_to_spydr/spydr.i image1 image2 ...
where image can contain wildcards.
For options, see man page.
or, within yorick:
spydr,"image1.fits",im2
where "image1.fits" is a filename (can contain widl cards)
arguments can mix strings (filenames, possibly with widlcards),
and images or data cube.
EXAMPLES:
$ spydr --dpi 80 20070730_2*.fits
$ spydr -c 20070730_2[2-3]?.fits 20070730_241.fits
> spydr,"~/ascam/2007jun26/20070625T2000*.fits"
> spydr,["20070730_1[1-3].fits","20070730_23.fits"]
> spydr,"20070730_1[1-3].fits","20070730_23.fits"
> spydr,image,append=1
> spydr,im1,"cube45.fits"
KEYWORDS:
wavelength=: set wavelength for the image/cube arguments
pixsize=: set pixel size (plate scale) for the image/cube arguments
name=: set name (for display) for the image/cube arguments
append=append image/cube argument to existing image stack
RESTRICTIONS:
- only fits images handled to date
- the ITT display is not very well handled
USE:
Once loaded, number of possibilities are offered by the GUI.
There is a number of shortcuts. Type "?" or go to the help
menu to list them all. Shortcuts events are received only
when the cursor is in the GUI main graphic window.
INSTALLATION:
- Linux packages normally install an executable and man page. With other
installers, or other OSes, you can define an alias or write a wrapper
to conveniently call spydr from the command line without having to write
the "yorick -i ..."
Example of a spydr wrapper:
#!/bin/sh
rlwrap yorick -i spydr/spydr.i $* || yorick -i spydr/spydr.i $*
SEE ALSO:
*/
{
extern spydrs,imnum;
extern spydr_win_had_focus;
extern spydr_im,cmin,cmax;
extern spydr_fh, spydr_nim;
extern xcut, ycut, imnamen;
extern flushing,spydr_showlower;
local imname,im,nim,wavelength,pixsize,im;
default_wavelength = (wavelength?wavelength:spydr_wavelength);
default_pixsize = (pixsize?pixsize:spydr_pixsize);
default_imname = (name?name:"image");
if (compact==1) spydr_showlower=0;
if (compact==0) spydr_showlower=1;
pyk_cmd=[python_exec,path2glade,swrite(format="%d",spydr_showlower), \
swrite(format="%d",spydr_dpi), \
swrite(format="%d",spydr_showplugins)];
if (noneof(current_window()==spydr_wins) ){
spydr_win_had_focus = current_window();
}
// write,format="to spydr window, old = %d\n",spydr_win_had_focus;
if (spydr_append) {
// ugly hack to circumvent funcdef inability to deal with keywords
append=1;
spydr_append=0;
}
if (_spydr_pyk_proc==[]) append=0; // does not make sense in that case
if (!append) spydr_clean;
else {
orig_nim=spydr_nim;
window,spydr_wins(1);
unzoom;
}
// loop on # of arguments
do {
if (vimage==[]) break; // spydr called without argument.
if (structof(vimage)==string) {
//===============================
// Dealing with filename. read it
//===============================
// loop on number of elements in argument (if string vector)
for (nn=1;nn<=numberof(vimage);nn++) {
image = vimage(nn);
// image is a single element, but may contain wildcards (if passed
// from within yorik, otherwise, shell expands it.
// expand image name in case of wild cards
imname = findfiles(image);
if (imname==[]) {
spydr_pyk_error,swrite(format="Can not find %s\n",image);
// if (spydr_context=="called_from_shell") quit;
error,swrite(format="Can not find %s\n",image);
}
// loop on elements
for (mm=1;mm<=numberof(imname);mm++) {
// read out image:
im = spydr_fits_read(imname(mm),fh,hdu=(hdu?hdu:spydr_hdu));
wavelength = figure_image_wavelength(fh);
pixsize = figure_image_pixsize(fh);
if (dimsof(im)(1)==2) { // single image
nim = 1;
grow,spydrs,spydr_struct();
spydrs(0).pim = &im;
spydrs(0).pixsize = spydrs(0).opixsize = pixsize;
spydrs(0).wavelength = wavelength;
spydrs(0).name = spydrs(0).saveasname = basename(imname(mm));
spydrs(0).dims = dimsof(im);
} else if (dimsof(im)(1)==3) { // data cube.
nim = dimsof(im)(4);
// let's splice the cube in single images for spydr_cube:
for (i=1;i<=nim;i++) {
grow,spydrs,spydr_struct();
spydrs(0).pim = &(im(,,i));
spydrs(0).pixsize = spydrs(0).opixsize = pixsize;
spydrs(0).wavelength = wavelength;
spydrs(0).name = basename(imname(mm));
spydrs(0).name += swrite(format=" %d/%d",i,nim);
spydrs(0).saveasname = spydrs(0).name;
spydrs(0).dims = dimsof(im(,,i));
}
} else {
info,image;
spydr_pyk_error,"spydr only works on images and data cubes";
if ((spydr_context=="called_from_shell")&&(spydr_nim==0)) quit;
error,"spydr only works on images and data cubes";
}
spydr_nim += nim;
}
}
} else {
//=========================================
// image argument are images, not file name
//=========================================
image = vimage;
pixsize = default_pixsize;
wavelength = default_wavelength;
if (dimsof(image)(1)==2) { // single image
nim = 1;
grow,spydrs,spydr_struct();
spydrs(0).pim = ℑ
spydrs(0).pixsize = spydrs(0).opixsize = pixsize;
spydrs(0).wavelength = wavelength;
default_imname = (name?name:"image")+swrite(format="%d",++imnamen);
spydrs(0).name = spydrs(0).saveasname = default_imname;
spydrs(0).dims = dimsof(image);
} else if (dimsof(image)(1)==3) { // data cube
nim = dimsof(image)(4);
// let's splice the cube in single images for spydr_cube:
default_imname = (name?name:"cube")+swrite(format="%d",++imnamen);
for (i=1;i<=nim;i++) {
grow,spydrs,spydr_struct();
spydrs(0).pim = &(image(,,i));
spydrs(0).pixsize = spydrs(0).opixsize = default_pixsize;
spydrs(0).wavelength = default_wavelength;
spydrs(0).name = default_imname;
spydrs(0).name += swrite(format=" %d/%d",i,nim);
spydrs(0).saveasname = spydrs(0).name;
spydrs(0).dims = dimsof(image(,,i));
}
} else {
info,image;
spydr_pyk_error,"spydr only works on images and data cubes";
if ((spydr_context=="called_from_shell")&&(spydr_nim==0)) quit;
error,"spydr only works on images and data cubes";
}
spydr_nim += nim;
}
} while ((vimage=next_arg())!=[]);
// binsize=1 if image=integers, 0 else.
// if 0, use nbin in hist calculation
//if (!spydr_histbinsize) spydr_histbinsize = (max(abs(*(spydrs(1).pim))%1)==0?1:0);
// span the python process, and hook to existing _spydr_pyk_proc (see spydr_pyk.i)
if (!_spydr_pyk_proc) {
_spydr_pyk_proc = spawn(pyk_cmd, _spydr_pyk_callback);
write,"\n SPYDR v"+spydr_version+" ready ";
} else {
// there's already a GUI around. hence we're not going to receive
// a signal from python to bring up windows and display. we have
// to init the display here:
if (append) set_imnum,orig_nim+1; else set_imnum,1;
gui_update;
disp_cpc;
spydr_disp;
if (spydr_showlower) plot_histo;
write,"\n ";
}
if (flushing==0) spydr_pyk_flush;
}
// ======================================
// Processing of command line arguments
// setting default, reading out conf file
// spawning python process.
//=======================================
// when called from the command line:
arg = get_argv();
// were we invoqued from shell or from the yorick prompt?
spydr_context = "called_from_session";
if (anyof(arg=="spydr.i")) spydr_context="called_from_shell";
//--------------------------------
// check that yorick version >= 2.1.05
yv1=yv2=yv3=0;
sread,Y_VERSION,format="%d.%d.%d",yv1,yv2,yv3;
vok=( (yv1>2) | ( (yv1==2)&(yv2>1) ) | ( (yv1==2)&(yv2==1)&(yv3>=5) ));
if (!vok) {
spydr_pyk_error,"spydr requires yorick version 2.1.05 or greater";
if (spydr_context=="called_from_shell") quit;
error,"spydr requires yorick version 2.1.05 or greater";
}
//--------------------------------
// look for python and glade files
Y_PYTHON = get_env("Y_PYTHON");
Y_GLADE = get_env("Y_GLADE");
Y_CONF = get_env("Y_CONF");
y_user = streplace(Y_USER,strfind("~",Y_USER),get_env("HOME"))
if (noneof(Y_PYTHON)) \
Y_PYTHON="./:"+y_user+":"+pathform(_(y_user,Y_SITES,Y_SITE)+"python/");
if (noneof(Y_GLADE)) \
Y_GLADE="./:"+y_user+":"+pathform(_(y_user,Y_SITES,Y_SITE)+"glade/");
// try to find spydr.py
path2py = find_in_path("spydr.py",takefirst=1,path=Y_PYTHON);
if (is_void(path2py)) {
// not found. bust out
spydr_pyk_error,swrite(format="Can't find spydr.py in %s.\n",Y_PYTHON);
if (spydr_context=="called_from_shell") quit;
error,swrite(format="Can't find spydr.py in %s.\n",Y_PYTHON);
}
path2py = dirname(path2py);
write,format=" Found spydr.py in %s\n",path2py;
// try to find spydr.glade
path2glade = find_in_path("spydr.glade",takefirst=1,path=Y_GLADE);
if (is_void(path2glade)) {
// not found. bust out
spydr_pyk_error,swrite(format="Can't find spydr.glade in %s\n",Y_GLADE);
if (spydr_context=="called_from_shell") quit;
error,swrite(format="Can't find spydr.glade in %s\n",Y_GLADE);
}
path2glade = dirname(path2glade);
write,format=" Found spydr.glade in %s\n",path2glade;
//---------------------------------------------------------
// parse arguments a first time for possible spydr_conffile
if (spydr_context=="called_from_shell") parse_flags,arg;
// include configuration file
if (spydr_conffile==[]) spydr_conffile = which_spydrconf();
write,format=" Using %s\n",spydr_conffile;
if (findfiles(spydr_conffile)==[]) {
spydr_pyk_error,swrite(format="Can not find configuration file %s",spydr_conffile);
if (spydr_context=="called_from_shell") quit;
error,swrite(format="Can not find configuration file %s",spydr_conffile);
}
require,spydr_conffile;
// set other defaults
spydr_ncolors=240;
from_disp = 1;
spydr_dpi = spydr_defaultdpi;
if (spydr_histbinsize==[]) spydr_histbinsize=0;
if (spydr_wins==[]) spydr_wins = [0,0,0];
pldefault,maxcolors=spydr_ncolors;
// parse arguments a second time (to override conffile defaults)
if (spydr_context=="called_from_shell") targets = parse_flags(arg);
spydr_dpi = clip(spydr_dpi,30,400);
// spawned gtk interface
python_exec = path2py+"/spydr.py";
pyk_cmd=[python_exec,path2glade,swrite(format="%d",spydr_showlower),swrite(format="%d",spydr_dpi), \
swrite(format="%d",spydr_showplugins)];
if (spydr_context=="called_from_shell") spydr,targets;
yorick-spydr-0.8.2/spydr.1 0000644 0000765 0000144 00000010120 10754363426 014774 0 ustar frigaut users .TH SPYDR 1 "2008 January 02"
.UC 4
.SH NAME
spydr \- GUI for Image display and analysis with yorick
.SH SYNOPSIS
.TP 2
Spydr (pronounce spider) can be invoqued from the shell
.B spydr
[ options ]
.I image1.fits
[ image2.fits ... ]
.br
where the fits images can contain single images (not necessarily of
the same size) or data cube. Widlcards are allowed in names.
.TP 3
or within yorick
.B #include "spydr.i"
.br
.B spydr,im1,im2,cube
.br
.B spydr,"image1.fits",...
.SH COMMAND LINE OPTIONS
.TP
.BI \-\-conf\ file
configuration file.
.TP
.BI \-\-hdu\ value
Specify a fits HDU to read
.TP
.BI \-\-dpi\ value
Yorick dpi value (yorick default = 75, spydr default = 83). Any value
between 30 and 150 make sense.
.TP
.BI \-\-itt\ value
Intensity Transfer Table (1=linear, 2=sqrt, 3=square, 4=log, 5=hist equalized)
.TP
.BI \-\-pixsize\ value
Pixel size (or plate scale) in arcsec.
.TP
.BI \-\-boxsize\ value
Size of box for PSF fitting and Strehl calculation (pixels)
.TP
.BI \-\-saturation\ value
Value above which pixels have to be considered as saturated (ADU)
.TP
.BI \-\-wavelength\ value
Force wavelength for all images
.TP
.BI \-\-zeropoint\ value
Photometric zeropoint (magnitude)
.TP
.BI \-\-nbins\ value
Number of bins for histograms
.TP
.BI \-\-strehlaper\ value
Diameter of circular mask for Strehl calculations (pixels). The flux
is integrated in a circle of this diameter, while the sky is estimated
from the remaining pixels within the box of size "boxsize"
.TP
.BI \-\-batch
Turn on yorick batch mode (yorick quits when encountering an
error). This flag is recommended when starting spydr from a
non\-interactive session (e.g. from a gnome applet).
.TP
.BI \-\-debug
Turn on the verbose mode (debugging mode).
.TP
.BI \-\-invert
Invert LUT
.TP
.BI \-\-fullgui
Show the plugin pane when the GUI is realized
.TP
.BI \-\-compact
Hide the lower part of the GUI at startup
.SH DESCRIPTION
.I Spydr
is a GUI for image visualization and simple analysis (cuts, zoom,
values, statistics, histogram, sigma filter) with changeable LUT and
ITT. Spydr has a couple of plugins to measure FWHM and Strehl. Press
"?" on the main display area to get a popup help:
The following shortcuts are available:
x/y: Plot line/column under cursor
X/Y: Toggle continuous plot of line/column
under cursor
c: Interactive plot of cut across image
h: Plot histogram of visible region
r: Radial plot centered on cursor
f: Fit 1d gaussian to 1d plot
e: Adjust min and max cut to 10% and 99.9%
of distribution
E: Reset min and max cut to min and max
of visible region
n/p: Next/prevous image
s: Sigma filter displayed image
\-/+: Decrease/Increase zoom factor in zoom window
?: This help
.SH EXAMPLES
From the shell:
$ spydr \-\-dpi 74 \-\-fullgui 20070730_2*.fits
$ spydr \-\-pixsize 0.127 20070730_2[2\-3]?.fits 20070730_241.fits
Within yorick:
> spydr,"~/ascam/2007jun26/20070625T2000*.fits"
> spydr,["20070730_1[1\-3].fits","20070730_23.fits"]
> spydr,image
> spydr,[im1,im2]
> spydr,im1,im2
.SH ENVIRONMENT VARIABLES
.TP
.BI Y_PYTHON
Force the path to spydr.py. The default path is
.B ./:Y_USER:Y_USER/python/:Y_SITES/python/:Y_SITE/python/
.TP
.BI Y_GLADE
Force the path to spydr.glade. The default path is
.B ./:Y_USER:Y_USER/glade/:Y_SITES/glade/:Y_SITE/glade/
.TP
.BI Y_CONF
Force the path to spydr.conf. The default path is
.B ./:Y_USER:Y_SITE:/etc/:
.br
.B ./share/:Y_USER/share/:Y_SITE/share/:
.br
.B ./share/spydr/:Y_USER/share/spydr/:Y_SITE/share/spydr/
.SH RESTRICTIONS AND BUGS
- only fits images handled to date
- the ITT display is not very well handled
.SH AUTHOR
.PP
Francois Rigaut, Gemini Observatory
.PP
.SH FILES
.PP
Input files:
.TP 12
spydr.conf
The spydr configuration file. Needed. It should have come with your
installation. The routine which_spydrconf() returns the path to the
used spydr.conf. The following directories are searched for
spydr.conf, in this order:
Y_USER, Y_SITE, /etc, Y_USER/share, Y_SITE/share, Y_USER/share/spydr,
Y_SITE/share/spydr. If you wish to modify the defaults, copy the file
over to Y_USER and modify at will.
.PP
Output files: none.
.SH SEE ALSO
yorick(1), yao(1)
yorick-spydr-0.8.2/spydr.xpm 0000644 0000765 0000144 00000006107 10747120577 015452 0 ustar frigaut users /* XPM */
static char * spider_xpm[] = {
"50 50 26 1",
" c None",
". c #FFFFFF",
"+ c #F7FAD4",
"@ c #FFFFFD",
"# c #FFFFCF",
"$ c #D3D4A2",
"% c #B0A361",
"& c #9D8B46",
"* c #88802E",
"= c #6F611E",
"- c #FCFFF1",
"; c #80835D",
"> c #FFFFF9",
", c #676747",
"' c #4F4719",
") c #313010",
"! c #B6C3B5",
"~ c #000000",
"{ c #9BABA9",
"] c #0E0D06",
"^ c #A3B093",
"/ c #4C5244",
"( c #303B33",
"_ c #DCE4D9",
": c #7D877D",
"< c #989890",
" ",
" . ..++++@. ",
" #$. @%&&*===&- ",
" .$;> #%&**,'*=,&$ ",
" +&=$ .&*=='=====,&. ",
" %))!.;===')'''==,'! ",
" ..-!@.$~~{.)]'))]')'='));. ..",
" .%&%=&*,)~;+~~]]]~)=)))]';$^;,/",
" .%&$=']]]~'^~~~~~~)]~)])=*'))((",
" .,$.$)~~~~]/~~~~~~~~]]])'''(;)/",
" .-_=: @/~~~~~]~~~~~~~~]~]))]);.]<",
" .$&&)])%../~~)~~~~~~~~~~~]]])))^. ",
" @&*'']~~)../~~(~~~~~]~~~]])=&&'^. ",
" .$,&)),;)~~~;.+]~~~~~~]),,/~])';;,^ ",
" >;'(),=$ .)~~~/%'~]]]]])'',;']]])(()!. ",
" -;,,^.. .(~~~]]))]~~~])))'=')~)/]]),. ",
" .^,^>. .{))~~]]~]~~~~~])'*')]~))~~]:. ",
" .:,/;. .)~)'~~))])]~~~~~')=']]~])(~~~_ ",
" .)](> .=])])]]*,/']~~~~~]'))]]~)!.(~~, ",
" .:!. .%)]~~])]]]~])]~~~~~)')]])_ .(~/ ",
" .;']]~~]]~~~~~]~~~~~~~]]~]/. /~{ ",
" ^)]]_{]]~~~~~~)]]~~~~~)])]/. -~~. ",
" +')); _~~~~~]]])]]~~~]]]))]). ,~(. ",
" .(~],../~~]~])])))~~~~~]])))]{ (~_ ",
" .,~~! >~~()]'))))]~~~~~~,:)))/ {~! ",
" .,]]_ ;~(.:),)))]~~~~~~~. {))). .]). ",
" ;]~! .)~_ ._,]))~~~~~~~~. .))]_ !~! ",
" !]~: ^]/. ./~))~~~~]~~)> .{)~/ {{ ",
" .(]/. _]~. ./~)~~~,.<({_ .(~~! ",
" ;]^. :~( ./])~~~: ,]~, ",
" .;]; !/. .)])~~)+ .))/ ",
" ;~]. .)))~~/. {]~. ",
" _]]! !))]~~{ :]~/ ",
" .;], <~)]~~! .]~]. ",
" ;], ;~)]~~_ <](. ",
" +]~< /])]~/. .. ",
" ,~). -()])_ ",
" '~_ .:~{ ",
" -_ :~, ",
" ,~/ ",
" .(~: ",
" ./]. ",
" >~]. ",
" ,~( ",
" .]~{ ",
" .]~. ",
" .;: ",
" ",
" ",
" "};
yorick-spydr-0.8.2/spydr2.gs 0000644 0000765 0000144 00000003271 10730226467 015335 0 ustar frigaut users # Gist style sheet made by Yorick write_style function
# Created: Mon Jun 11 16:44:27 2007
# (1 coordinate systems)
landscape= 0
default= { legend= 0,
viewport= { 0.195, 0.66, 0.68, 0.88 },
ticks= {
horiz= {
nMajor= 5.0, nMinor= 25.0, logAdjMajor= 1.2, logAdjMinor= 1.2,
nDigits= 3, gridLevel= 1, flags= 0x02b,
tickOff= 0.0007, labelOff= 0.010,
tickLen= { 0.009, 0.006, 0.004, 0.0027, 0.0018 },
tickStyle= { color= -2, type= 1, width= 1.0 },
gridStyle= { color= -2, type= 3, width= 1.0 },
textStyle= { color= -2, font= 0x08, height= 0.0182,
orient= 0, alignH= 0, alignV= 0, opaque= 0 },
xOver= 0.395, yOver= 0.370 },
vert= {
nMajor= 5.0, nMinor= 25.0, logAdjMajor= 1.2, logAdjMinor= 1.2,
nDigits= 4, gridLevel= 1, flags= 0x02b,
tickOff= 0.0007, labelOff= 0.006,
tickLen= { 0.009, 0.006, 0.004, 0.0027, 0.0018 },
tickStyle= { color= -2, type= 1, width= 1.0 },
gridStyle= { color= -2, type= 3, width= 1.0 },
textStyle= { color= -2, font= 0x08, height= 0.0182,
orient= 0, alignH= 0, alignV= 0, opaque= 0 },
xOver= 0.150, yOver= 0.370 },
frame= 1,
frameStyle= { color= -2, type= 1, width= 1.0 }}}
system= { legend= "System 0" }
legends= {
x= 0.046980, y= 0.360000, dx= 0.375800, dy= 0.000000,
textStyle= { color= 254, font= 0x00, height= 0.015600,
orient= 0, alignH= 1, alignV= 1, opaque= 0 },
nchars= 36, nlines= 20, nwrap= 2 }
clegends= {
x= 0.618200, y= 0.864300, dx= 0.000000, dy= 0.000000,
textStyle= { color= 254, font= 0x00, height= 0.015600,
orient= 0, alignH= 1, alignV= 1, opaque= 0 },
nchars= 14, nlines= 28, nwrap= 1 }
yorick-spydr-0.8.2/LICENSE 0000644 0000765 0000144 00000104513 10746246735 014574 0 ustar frigaut users GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
yorick-spydr-0.8.2/Makefile 0000644 0000765 0000144 00000012014 11516661154 015211 0 ustar frigaut users # these values filled in by yorick -batch make.i
Y_MAKEDIR=/usr/lib/yorick/2.2
Y_EXE=/usr/lib/yorick/2.2/bin/yorick
Y_EXE_PKGS=
Y_EXE_HOME=/usr/lib/yorick/2.2
Y_EXE_SITE=/usr/share/yorick/2.2
#
# !! THIS IS NOT A PLUGIN !!
# This is a package made of several interpreted
# include file. This makefile is just used to install,
# uninstall it or build the distribution tar file.
# ------------------------------------------------ macros for this package
# used for distribution
PKG_NAME = spydr
# include files for this package
PKG_I=spydr.i spydr_plugins.i spydr_psffit.i spydr_various.i spydr_pyk.i spydr_input_data_format.i
# autoload file for this package, if any
PKG_I_START=spydr_start.i
# override macros Makepkg sets for rules and other macros
# Y_HOME and Y_SITE in Make.cfg may not be correct (e.g.- relocatable)
Y_HOME=$(Y_EXE_HOME)
Y_SITE=$(Y_EXE_SITE)
DEST_Y_SITE=$(DESTDIR)$(Y_SITE)
DEST_Y_HOME=$(DESTDIR)$(Y_HOME)
DEST_Y_BINDIR=$(DEST_Y_HOME)/bin
# ------------------------------------- targets and rules for this package
build:
@echo "Nothing to build. This is not a plugin"
@echo "other targets: install, uninstall, clean"
@echo "for maintainers: package, distpkg"
clean::
-rm -rf pkg
install::
mkdir -p $(DEST_Y_SITE)/python
mkdir -p $(DEST_Y_SITE)/glade
mkdir -p $(DEST_Y_SITE)/i
mkdir -p $(DEST_Y_SITE)/i-start
mkdir -p $(DEST_Y_SITE)/g
mkdir -p $(DEST_Y_SITE)/gist
mkdir -p $(DEST_Y_SITE)/share/spydr
mkdir -p $(DEST_Y_BINDIR)
cp -p $(PKG_I) $(DEST_Y_SITE)/i/
cp -p $(PKG_I_START) $(DEST_Y_SITE)/i-start/
cp -p spydr.py $(DEST_Y_SITE)/python/
cp -p spydr.glade $(DEST_Y_SITE)/glade/
cp -p spydr*.gs $(DEST_Y_SITE)/g/
cp -p spydr*.gs $(DEST_Y_SITE)/gist/
cp -p spydr.conf $(DEST_Y_SITE)/share/spydr/
cp -p LICENSE $(DEST_Y_SITE)/share/spydr/
cp -p README $(DEST_Y_SITE)/share/spydr/
cp -p test3.fits $(DEST_Y_SITE)/share/spydr/
cp -p spydr $(DEST_Y_BINDIR)/
uninstall::
-cd $(DEST_Y_SITE)/i; rm $(PKG_I)
-cd $(DEST_Y_SITE)/i-start; rm $(PKG_I_START)
-rm $(DEST_Y_SITE)/python/spydr.py
-rm $(DEST_Y_SITE)/glade/spydr.glade
-rm $(DEST_Y_SITE)/g/spydr*.gs
-rm $(DEST_Y_SITE)/gist/spydr*.gs
-rm -rf $(DEST_Y_SITE)/share/spydr
-rm $(DEST_Y_BINDIR)/spydr
# -------------------------------------------- package build rules
PKG_VERSION = $(shell (awk '{if ($$1=="Version:") print $$2}' $(PKG_NAME).info))
# .info might not exist, in which case he line above will exit in error.
# packages or devel_pkgs:
PKG_DEST_URL = packages
package:
mkdir -p pkg/$(PKG_NAME)/dist/y_site/i
mkdir -p pkg/$(PKG_NAME)/dist/y_site/python
mkdir -p pkg/$(PKG_NAME)/dist/y_site/glade
mkdir -p pkg/$(PKG_NAME)/dist/y_site/g
mkdir -p pkg/$(PKG_NAME)/dist/y_site/gist
mkdir -p pkg/$(PKG_NAME)/dist/y_home/i-start
mkdir -p pkg/$(PKG_NAME)/dist/y_site/share/spydr
mkdir -p pkg/$(PKG_NAME)/dist/y_home/bin
cp -p $(PKG_I) pkg/$(PKG_NAME)/dist/y_site/i/
cp -p spydr.py pkg/$(PKG_NAME)/dist/y_site/python/
cp -p spydr.glade pkg/$(PKG_NAME)/dist/y_site/glade/
cp -p *.gs pkg/$(PKG_NAME)/dist/y_site/g/
cp -p *.gs pkg/$(PKG_NAME)/dist/y_site/gist/
cp -p spydr.conf pkg/$(PKG_NAME)/dist/y_site/share/spydr/
cp -p LICENSE pkg/$(PKG_NAME)/dist/y_site/share/spydr/
cp -p README pkg/$(PKG_NAME)/dist/y_site/share/spydr/
cp -p test3.fits pkg/$(PKG_NAME)/dist/y_site/share/spydr/
cp -p spydr pkg/$(PKG_NAME)/dist/y_home/bin/
cd pkg/$(PKG_NAME)/dist/y_site/i/; if test -f "check.i"; then rm check.i; fi
if test -f "check.i"; then cp -p check.i pkg/$(PKG_NAME)/.; fi
if test -n "$(PKG_I_START)"; then cp -p $(PKG_I_START) \
pkg/$(PKG_NAME)/dist/y_home/i-start/; fi
cp -p $(PKG_NAME).info pkg/$(PKG_NAME)/$(PKG_NAME).info
cd pkg; tar zcvf $(PKG_NAME)-$(PKG_VERSION)-pkg.tgz $(PKG_NAME)
distbin: package
#tarball there
if test -f "pkg/$(PKG_NAME)-$(PKG_VERSION)-pkg.tgz" ; then \
ncftpput -f $(HOME)/.ncftp/maumae www/yorick/packages/tarballs/ \
pkg/$(PKG_NAME)-$(PKG_VERSION)-pkg.tgz; fi
#info files in each architecture directory
if test -f "pkg/$(PKG_NAME)/$(PKG_NAME).info" ; then \
ncftpput -f $(HOME)/.ncftp/maumae www/yorick/packages/darwin-ppc/info/ \
pkg/$(PKG_NAME)/$(PKG_NAME).info; fi
if test -f "pkg/$(PKG_NAME)/$(PKG_NAME).info" ; then \
ncftpput -f $(HOME)/.ncftp/maumae www/yorick/packages/darwin-i386/info/ \
pkg/$(PKG_NAME)/$(PKG_NAME).info; fi
if test -f "pkg/$(PKG_NAME)/$(PKG_NAME).info" ; then \
ncftpput -f $(HOME)/.ncftp/maumae www/yorick/packages/linux-ppc/info/ \
pkg/$(PKG_NAME)/$(PKG_NAME).info; fi
if test -f "pkg/$(PKG_NAME)/$(PKG_NAME).info" ; then \
ncftpput -f $(HOME)/.ncftp/maumae www/yorick/packages/linux-x86/info/ \
pkg/$(PKG_NAME)/$(PKG_NAME).info; fi
distsrc:
make clean; rm -rf pkg
cd ..; tar --exclude pkg --exclude .svn --exclude CVS --exclude *.spec -zcvf \
$(PKG_NAME)-$(PKG_VERSION)-src.tgz yorick-$(PKG_NAME)-$(PKG_VERSION);\
ncftpput -f $(HOME)/.ncftp/maumae www/yorick/packages/src/ \
$(PKG_NAME)-$(PKG_VERSION)-src.tgz
ncftpput -f $(HOME)/.ncftp/maumae www/yorick/contrib/ \
../$(PKG_NAME)-$(PKG_VERSION)-src.tgz
# -------------------------------------------------------- end of Makefile
yorick-spydr-0.8.2/spydr_start.i 0000644 0000765 0000144 00000000034 10730226465 016277 0 ustar frigaut users autoload, "spydr.i", spydr;
yorick-spydr-0.8.2/test3.fits 0000644 0000765 0000144 00002354000 10737225273 015512 0 ustar frigaut users SIMPLE = T / true FITS file created by Yorick BITPIX = -32 / IEEE single precision floating point NAXIS = 2 / number of dimensions NAXIS1 = 400 / length of 1st dimension NAXIS2 = 400 / length of 2nd dimension END @ðHM?×Ñ:?ØÂ?6]?MÛ?ìºÆ?>Ë?:_?(7¾$ÔÅ?a¾Ó?B>þ\¾?Ó0¾³?&