&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& Welcome to the Davis Group idl code library! &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& This library has been created for the convenience of those looking for code to process CHEAS data of many types, as well as to provide codes that may be helpful for new coding requirements. No need to reinvent the wheel! IF YOU HAVEN'T DONE SO ALREADY YOU MAY NEED TO SET YOUR IDL PATH TO EASILY USE THE CODE IN THE LIBRARY - SEE INSTRUCTIONS ON HOW TO DO THIS BELOW. IF YOU PUT A NEW CODE SOMEWHERE PLEASE BE SURE TO SET THE MODE TO ALLOW PERMISSION OF OTHERS TO AT LEAST COPY THE FILE. I RECOMMEND USING: chmod og+wr filename I hope the library will be a comfortable place to browse and borrow. May it help solve your idl needs. BWBerger 3/6/99 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The basic current path structure is as follows: /data/davis/lib (you are here) general indiv wlef brad davis cal general hourly lag radar rot yearly Description of directories: /data/davis/lib/general This directory is for codes that are useful for many purposes (e.g. load.pro which loads files that are vectors or matricies (space delimited) and have no characters). Files here are commonly used in existing codes and may be helful for building new codes. PEOPLE SHOULD FEEL FREE TO USE THESE CODES AS WELL AS TO PUT NEW CODES IN THIS DIRECTORY. HOWEVER, if you put code into this directory, please try to comment the code well (i.e. tell people what the inputs/output are etc. AND INCLUDE YOUR NAME). PLEASE TRY TO ONLY SUPPLY TESTED CODE THAT WORKS. DO NOT USE EXISTING FILE NAMES. /data/davis/lib/indiv This directory is for codes that individuals want to make public, but are not general or may not be in perfect working order! If someone has some code they wish people to easily find, create a directory with your name and put it here. CAUTION: THE CODES IN THE DIRECTORIES BELOW 'INDIV' SHOULD BE GZIPPED! THIS WILL PREVENT CODE WITH THE SAME NAME BEING EXECUTED IF YOU HAVE SET YOUR IDL PATH TO THE LIBRARY AND ITS SUBDIRECTORIES - SEE PATH NOTE BELOW. /data/davis/lib/wlef This directory leads to codes that process WLEF data /data/davis/lib/wlef/cal Houses code to do calibrations of WLEF licors and leads to: /data/davis/lib/wlef/cal/table Houses code to make WLEF calibration tables /data/davis/lib/wlef/general Houses general code that is useful for various WLEF data processing needs /data/davis/lib/wlef/hourly Houses the original WLEF data processing code to get hourly flux values /data/davis/lib/wlef/lag Houses code to create WLEF lag tables /data/davis/lib/wlef/radar Houses code to create plots from WLEF radar data /data/davis/lib/wlef/rot Houses code to calculate WLEF rotation angles /data/davis/lib/wlef/yearly Houses code that combines hourly output into yearly files ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Note: There may be other subdirectories below the main ones listed above. Most prominent are the 'oldcode' subdirectories. This is where obsolete codes should be stored. CAUTION: OLD CODE SHOULD BE RENAMED WITH A SUFFIX OF .OLD SO THAT IT CANNOT INADVERTANTLY BE EXECUTED DURING AN IDL SESSION - SEE PATH NOTE BELOW. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% NOTE: IDL PATH INFORMATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% IMPORTANT.IMPORTANT.IMPORTANT.IMPORTANT.IMPORTANT.IMPORTANT.IMPORTANT !!!!!!!!!!!!!!!!!!IDL PATH INFORMATION!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! The directory structure above was created with the idea that individuals will set the idl path (!path) to tell idl where to look for .pro files. The basic story is as follows: IDL has a default value for the system variable called !path. The value of this system variable tells idl where to search for .pro files. The default directs idl to look in its own idl libraries (if it didn't do this it wouldn't even know where functions like 'cos' or 'fltarr' are!). If you want to know where idl is searching for code you can type: print,!path and you will see a string of directories. THE PRIORITY OF SEARCH IS AS SHOWN. Therefore, if the function or procedure you have called isn't in the first directory, it looks in the next one and so forth. THIS PATH CAN BE TOTALLY CHANGED (NOT RECOMMENDED!) OR IT CAN BE APPENDED (RECOMMENDED!) TO INCLUDE OTHER DIRECTORIES OF YOUR CHOOSING. I currently append !path to look in a directory called idl below my home directory and to look in the /data/davis/lib directory AND IN ALL DIRECTORIES BELOW THESE DIRECTORIES. >>>>THIS HAS THE ADVANTAGE THAT I DON'T HAVE TO ALWAYS RUN IDL FROM THE DIRECTORY WHERE THE CODE IS LOCATED (OR USE A COMPILE FILE LIKE /data/davis/lib/wlef/hourly/compileflux - although this is a good way to be sure idl is running exactly the codes you think it is). WHEN THE PATH IS SET YOU CAN RUN IDL CODE LOCATED IN THE PATH FROM ANY DIRECTORY. Another advantage is that since you don't have to run idl from the directory that the code is in, small codes that may be used in several main codes won't have to be duplicated in bunch of different directories thus eliminating the problem where one of the little codes is updated and every location of it doesn't have to be updated - the correct updated code will only live in one place. THE ONLY CAUTION is that unless you know the path priorty, you may not know which code is being run IF SEVERAL CODES HAVE THE SAME NAME. THEREFORE: AVOID NAMING DIFFERENT CODE WITH THE SAME NAME. ************************************************************** *********ALTERING YOUR .CSHRC FILE TO SET THE IDL PATH******** You can append !path each time you enter idl, but this is time consuming and cryptic. However, you can use your .cshrc file located in your home directory to do it automatically! DIRECTIONS FOR CHANGING YOUR .cshrc FILE: Pull your .cshrc file up in an editor. It may look like this: if (`uname -r` == 5.3) then source /usr/local/etc/Tcshrc.All else source /usr/oldlocal/etc/Tcshrc.All endif alias lo 'exit' alias up 'cd ..' alias dir 'pwd ; ls' THE LINES YOU NEED TO ADD TO YOUR .CSHRC FILE ARE: source /usr/apps/rsi/idl_5/bin/idl_setup setenv IDL_PATH +/usr/people/yourhomedirectory/idl:+/data/davis/lib:$IDL_PATH INSERT YOUR HOME DIRECTORY NAME WHERE SHOWN AND BE SURE IT IS AFTER THE 'ENDIF' LINE. Your .cshrc file might now look like this (only add the two lines - the rest of the lines are only an example for a typical .cshrc file): if (`uname -r` == 5.3) then source /usr/local/etc/Tcshrc.All else source /usr/oldlocal/etc/Tcshrc.All endif source /usr/apps/rsi/idl_5/bin/idl_setup setenv IDL_PATH +/usr/people/johndoe/idl:+/data/davis/lib:$IDL_PATH alias lo 'exit' alias up 'cd ..' alias dir 'pwd ; ls' Once you have saved your new .cshrc file type: source .cshrc from your home directory while in eddy or silty. IDL should now use the altered path next time you log into an idl session. YOU CAN TYPE print,!path WHEN YOU'RE IN IDL TO CHECK IT. A FINAL NOTE ABOUT IDL PATHS Notice the + signs in the 'setenv' line of your .cshrc file; this tells idl to look in the directory listed AND ALL SUBDIRECTORIES BELOW IT. If you exclude the + sign idl will only look in that directory. This brings up a VERY IMPORTANT POINT: If you use recursive directory search for your idl path you must be careful to AVOID NAMING DIFFERENT CODES WITH THE SAME NAME. IDL will search for a code using the string !path and it will use the first file it finds with the correct name. You can make the string of directories as long as you like, just separate the directories by colons similary to what is shown above. Also, notice that I have the home directory listed first, then /data/davis/lib. This makes idl look in your own idl directory BEFORE it looks in the /data/davis library or the idl library. If the order is changed, the priority is changed. Also, the idl code libraries are looked in last, so for example, if I were to create a function called cos.pro and put it in my own idl directory or in /data/davis/lib, the idl function 'cos' would never be used. It would use the one I created instead. I HOPE THIS INFORMATION IS USEFUL. PLEASE LET ME KNOW IF THERE ARE ANY QUESTIONS OR COMMENTS. THE LIBRARY WILL ALWAYS BE A CHANGING AND EXPANDING PLACE. GOOD CODE HUNTING! BWB