Skip to content

Category: IDL hints

idl color plotting on screen and to (postscript) file – somehat obsolete 2014

For a comprehensive description of how to do idl color plotting both to screen and to postscript file,

see http://myweb.facstaff.wwu.edu/~larsonk/docs/idlcolors.pdf

and note that some params may well be set up on your log in to idl, via your file .idlstartup

——————————–

as a (better?) alternative, use Fanning’s color routines, which we have on our system.  Discussion is at http://www.astro.ucla.edu/~mperrin/idl/colors.shtml

To get documentation on fsc_color, type doc_library,’fsc_color’ (recall that this is the format for getting documentation for any non-std idl routine).

HOWEVER SEE POST AUGUST 2014 regarding UPDATE TO FANNING COLOR ROUTINES

Note for example that I got a blue plot with

findgen x(5)

y=sin(300*x)

Plot, x,y, Color=FSC_Color(‘Dodger Blue’)

–Joel

idl interactive gaussian fitting widget

Tom Callister downloaded an IDL routine from NASA FUSE spacecraft idl site called xgaussfit.pro that does interactive

Gaussian fits via widget.  He got it running here after some effort and it is at /usr/share/astro/idlshare/locallib/pulsegaussfit.pro

idl homemade plot symbols

UPDATE 2012 MAY JMW:  SYMBOL is now included as part of IDL.  By the way here is the calling sequence:
PLOT,X,Y,PSYM=SYM(NUMBER)

————————————————————–

IDL has a poor selection of plot symbols, so I downloaded routines from the web that do a better job.  Look at symbol.pro in /usr/share/astro/idlshare/local.

I should somehow put this in a library but for now I copied and pasted the routines (except the first, driver routine) into the top of a user file and then called it to get nice fat filled circles.

See /data/psrdata/swigglitch/GlitchRead.4.1.pro

 

idl71 install notes

==========================================================
IDL71 Install instructions
==========================================================

NOTE: These files are stashed in /etc/secret/idl71:

idl71-install-notes.txt
idl71-license.dat
astron.tar.gz


# cd /usr/local
# mv itt itt70
# mkdir itt
# cd itt

As the installation booklet suggested might happen, my attempt to run the install script failed with:


[root@algol itt]# /media/IDL71/install_unix.sh
bash: /media/IDL71/install_unix.sh: /bin/sh: bad interpreter: Permission denied

I applied the remedy they suggested:

[root@algol itt]# umount /dev/hdb
[root@algol itt]# mount -o ro -t udf /dev/hdb /media

NOTE: For algol, the device was ‘/dev/hdb’, but for sirius the device was ‘/dev/scd0’:

[root@Sirius itt]# umount /dev/scd0
[root@Sirius itt]# mount -o ro -t udf /dev/scd0 /media

… and then ran the installer again:

[root@algol itt]# /media/install_unix.sh

The installer launched and asked me what I wanted to install. I chose only IDL program files and skipped the “CIA High Res Maps” and “Dicom Network Services” options.

After install, a ‘Product Environment’ window pops up. I chose the ‘Create Links’ option.

The “Licensing/Registration Program” window pops up. I chose to run the license wizard, but it seems as if SELinux kept it from popping up. Instead, the installer finished by giving me the full path the the license wizard so that I could run it later:

/usr/local/itt/idl71/bin/ittlicense

When I launched the license wizard by hand I got SELinux warnings:

[root@algol itt]# /usr/local/itt/idl71/bin/ittlicense
/usr/local/itt/idl71/bin/bin.linux.x86/idl: error while loading shared libraries: /usr/local/itt/idl71/bin/bin.linux.x86/libidl.so.7.1: cannot restore segment prot after reloc: Permission denied
rm: cannot remove `/root/.ittlicense_tmp': No such file or directory
[root@algol itt]#

The SELinux troubleshoot browser posted an alert, and specified the commnands necessary to make SELinux shut up. I issued those commands, but the wizard posted a window complaining about another SElinux denial… At this point I changed the systems SELinux state from ‘Enforcing” to “Permissive”…

I pasted the license.dat info into the text typin and clicked through all the options (install license mgr, launch license mgr) and then select Exit.

NOTE: the idl71 license wizard makes it’s own provisions for starting the license manager at boot time. So I removed the old idl70 specific license manager launching command from /etc/rc.d/rc.local:

/usr/local/itt/idl70/bin/lmgrd -c /usr/local/itt/license/license.dat

NOTE: Must also kill the running lmgrd process for the previous version.

Made sure all current users ~/.cshrc file contained the correct idl_setup call. They did. Here’s the proper command:

source /usr/local/itt/idl/bin/idl_setup

Installed the goddard lib:


mkdir /usr/local/itt/idl70/lib/goddard
cd /usr/local/itt/idl70/lib/goddard
wget http://idlastro.gsfc.nasa.gov/ftp/astron.tar.gz
tar -xvzf ./astron.tar.gz
chown root:users -R .

I then rebooted, logged in as bduffy, ran a csh shell and issued the idlde command. Seemed to work….

============================================================
Install issues on Sirius and Mirzam
============================================================

On Sirius (and Mirzam) the installation experience was different. After setting SELinux to Permissive mode, I launched the license wizard and it it segfaulted.


[root@Sirius itt]# /usr/local/itt/idl71/bin/ittlicense
IDL Version 7.1 (linux x86 m32). (c) 2009, ITT Visual Information Solutions

% Embedded IDL: ITT Visual Information Solutions, License Wizard.
% Embedded IDL: ITT Visual Information Solutions, License Wizard.
% Loaded DLM: XML.
/usr/local/itt/idl71/bin/ittlicense: line 36: 27919 Segmentation fault $IDL_DIR/bin/idl $* -em=$IDL_DIR/lib/hook/ittlicense.sav
[root@Sirius itt]#

NOTE: I could launch idlde, but it complained about the missing license manager…

SOLUTION:

I could see on algol how the license manager was launched. There’s a file in /etc/init.d/sys5_idl_lmgrd and symlinks to it in /etc/rc.d/rc*.d. So:

From algol:

rsync -av /etc/init.d/sys5_idl_lmgrd root@sirius:/etc/init.d/

From Sirius:


ln -s /etc/init.d/sys5_idl_lmgrd /etc/rc.d/rc0.d/K01sys5_idl_lmgrd
ln -s /etc/init.d/sys5_idl_lmgrd /etc/rc.d/rc2.d/S99sys5_idl_lmgrd
ln -s /etc/init.d/sys5_idl_lmgrd /etc/rc.d/rc3.d/S99sys5_idl_lmgrd
ln -s /etc/init.d/sys5_idl_lmgrd /etc/rc.d/rc4.d/S99sys5_idl_lmgrd
ln -s /etc/init.d/sys5_idl_lmgrd /etc/rc.d/rc5.d/S99sys5_idl_lmgrd

I then rebooted, saw lmgrd start properly at boot, and after logging in as bduffy was able to launch idlde w/o any license warnings.

============================================================
idlde libGL error on Sirius and Mirzam
============================================================

When I tested idlde by logging in as bduffy and launching idlde from Mirzam, idlde posted this warning message to it’s text window:


IDL Version 7.1 (linux x86 m32). (c) 2009, ITT Visual Information Solutions
Installation number: 217420.
Licensed for use by: Carleton College

G’day!
% Compiled module: ADDPATH.
% Compiled module: AODEFDIR.
% Compiled module: P8.
% Compiled module: LDCOLPH.
libGL error: open DRM failed (Operation not permitted)
libGL error: reverting to (slow) indirect rendering
% Unsupported X Windows visual (class: PseudoColor, depth: 8).
Substituting default (class: TrueColor, Depth: 24).

NOTE: On algol, I get this message instead. It’s notable that the license wizard didn’t fail on algol…


IDL Version 7.1 (linux x86 m32). (c) 2009, ITT Visual Information Solutions
Installation number: 210557.
Licensed for use by: Carleton College

G’day!
% Compiled module: ADDPATH.
% Compiled module: AODEFDIR.
% Compiled module: P8.
% Compiled module: LDCOLPH.
libGL warning: 3D driver claims to not support visual 0x4b
% Unsupported X Windows visual (class: PseudoColor, depth: 8).
Substituting default (class: TrueColor, Depth: 24).
% Compiled module: DOPHSBALL.

SOLUTION:

On mirzam I noticed that we didn’t see these errors running as root, and so Matt and I looked at /dev/dri/* and /dev/dri/card0 had perms of 600. When we chmod’d them to 666, idlde didn’t post the errors. So then the challenge was to find the right file that would change these perms at the right time. At first I thought that modding the line at the bottom of /etc/security/console.perms.d/50-default.perms would do it, but it didn’t work. We think it’s because the dri devices don’t exist at the time this file is applied at boot, but only after X is launched. The proper place/way to set the perms it to append these lines to /etc/X11/xorg.conf:


Section "DRI"
Mode 0666
EndSection

Oddly, although applying this fix to Sirius seemed to work, there is no /dev/dri on Sirius, and running fglrxinfo segv’s, so something isn’t quite right…

If IDL help browser will not come up . . .

Bruce figured out that the problem is that we share our home directory across all hosts, so idlhelp gets confused about which host it is on. (It does not keep track of this.)

So the fix is to get rid of the directory in your home directory that has the incorrect information:

in <homedirectory>/.idl/itt

type

rm -rf idlhelp

We think it is the .metadata/.connection file that causes the problem, but eliminating it does not do the job.

IDL help browser bug fix

Joel installed a bug fix for the help browser on redhat 5 machines. (new sirius, new mirzam). As of 13 Feb 2009, it is installed on all three licensees (incl algol).

If you use idlde, it is transparent.

If you use command line idl, you have to type idlhelp before typing idl

Joel had to contact idl support to find out about it.  For ref,  XULRunner patch for IDL 7.0,http://www.ittvis.com/services/techtip.asp?ttid=4395

idl70 and goddard library upgrade

I basically followed the idl64 install instructions already posted in this blog.

Joel had received the idl70 update email from itt, and that contains the instructions on where to download the license file and the tar.gz file containing the install image.

[bduffy 2009-02-04: I’ve put a copy of the relevant license.dat and tar.gz files into /etc/secret/exchange/idl70/]

As root:

cd /usr/local

Because /usr/local/itt already existed and contained idl64, I moved the original /usr/local/itt to itt64 to move it out of the way. I will delete it later after I’m comfortable that the install went smoothly.

mv ./itt ./itt64
mkdir itt
cd itt
mv /root/idl70linux.x86.tar.gz
tar -xvzf idl70linux.x86.tar.gz
cd ./license
cp /etc/secret/idl7-license.txt ./license.dat

I then edited /usr/local/itt/license/license.dat to contain only the license entry for this box.

chmod 644 ./license.dat

cd /usr/local/itt

Then ran the ‘install’ script:

./install

Said ‘y’ to all prompts

Chose option 1) for creating symbolic links and defining the IDL environment. It created several symbolic links.

Finally the install script asked if we wanted to start “DICOM Network Services at boot time”. I answered ‘n’.

Restarted the license mgr by issuing these commands:

/usr/local/itt/idl70/bin/lmdown
/usr/local/itt/idl70/bin/lmgrd -c /usr/local/itt/license/license.dat

NOTE: On Mirzam (but not Sirius) I ran into trouble issuing the lmdown command. Turns out the problem was that the ‘IDL_DIR’ env var was set in root’s .tcshrc file and that changed the scripts behaviour. I removed the setting of the ‘IDL_DIR’ from root’s .tcshrc file and that fixed the problem.

I also removed all the old idl6.3 related /etc/*/*_idl_* files on both Mirzam and Sirius.

Tested that idl70 was installed by issuing the ‘idl’ command at the command prompt. Seemed to work.

To get the idl lm to start at boot time, I edited /etc/rc.d/rc.local and removed this line:

/usr/local/itt/idl64/bin/lmgrd -c /usr/local/itt/license/license.dat

… and added this line:

/usr/local/itt/idl70/bin/lmgrd -c /usr/local/itt/license/license.dat

Made sure all current users ~/.cshrc file contained the correct idl_setup call. They did. Here’s the proper command:

source /usr/local/itt/idl/bin/idl_setup

Then installed the goddard lib:

mkdir /usr/local/itt/idl70/lib/goddard

Downloaded http://idlastro.gsfc.nasa.gov/ftp/astron.tar.gz
to /usr/local/itt/idl70/lib/goddard

cd /usr/local/itt/idl70/lib/goddard
tar -xvzf ./astron.tar.gz

how to run idl procedures (.pro) from val

to compile procedures:
.run filename.pro
for ex, to compile the average.pro procedure i say:

.run average

to execute a given procedure, for example to execute average after compiling the average procedure, i simply type:

average

(See next idlhints post for info on how to run a .batch file)