Jetdsp
JETDSP Homepage
Manual Homepage
Signal Processing Homepage
 
Signal processing
Basic guide
Advanced guide
IBM NEWDSP-syntax
Use your code
Signal slicing
Simple expressions
 
Tutorial
Introduction
Internals
IDL commands
Interpolation
Writing your own code
Adding functions to the Simple dialogue
 
How to...
Read data
Define structure
 
Functions
jetSmooth
jetint
jetsubset
jetmerge
fixgrid
jetwindowpoints
 
Making your own IDL code available to JETDSP

Using your code to process JETDSP signals

The JETDSP signal processing window is not limited to using raw IDL functions.  It can also accept expressions using IDL functions that you have written yourself.

Making IDL procedures available to JETDSP

JETDSP signal processing functions can use IDL code that you have written. 

There are two ways to do this:

  • If you start JETDSP by double-clicking the JETDSP icon (PC) or by typing 'jetdsp' at the command prompt (UNIX), you will need to save the compiled version of the code to the AddIns directory or another directory on the IDL search path.
  • If you start JETDSP from within an IDL session, and your IDL code is on the IDL search path, then you will be able to include the name of the IDL function or procedure in an IDL expression.
    A convenient place for extra code is the AddIns directory - JETDSP always makes sure that this is on the IDL search path.

Example

The following IDL code program defines an IDL function that has two arguments.  If the first one exists, the function returns that value, otherwise the function returns the value of the second argument.  It is useful for signal processing expressions for which a substitute default value may be used if the actual required signal was not present:

function dVal, value, defaultValue
; returns value if it's defined, defaultValue otherwise

useDefault = isdefined(defaultValue) ? defaultValue : 0.

return, isdefined(value) ? value : useDefault

end

With JETDSP it is necessary to save a compiled version of your source code. This normally has the extension '.sav'. To do this:

  1. Open up an IDL session (idlde on UNIX)

  2. Create the above file and compile it

  3. Type 'resolve_all' at the IDL> prompt

  4. Type the following at the IDL> prompt:
    SAVE, 'DVAL', /routines, filename='dval.sav'

  5. Outside of IDL, copy the new file dval.sav to your AddIns directory

This has the advantage of other users not being able to see the source code.

Making Fortran and C code available to JETDSP

If you have written C or Fortran code that you would like to call from JETDSP, it must be installed so that it is available to a normal IDL session.  Details of how to do this are given in IDL's External Development Guide - for example using CALL_EXTERNAL or dynamic loading to call a DLL (or a shared object on UNIX).

The best way to call this code from JETDSP is to then write an IDL function that calls the externally linked function and passes the results back - and to compile and save this in the same way as the IDL function above.


Top  JETDSP Home Page  Manual  FAQ 
Please send comments to: data-and-coding-support@ccfe.ac.uk