next up previous 78
Next: Going smoothly to zero at the ends
Up: FFT
Previous: Complex data structures


Creating a complex data structure

In most cases, one starts with an `ordinary' (i.e. non-complex) file and wants to produce a complex structure in which this is the real part of the complex data and the imaginary part is zero. This is what the command `r2cmplx' does. For example,

   ICL> r2cmplx myspect cmplxspect

will generate a complex structure with the real part taken from `myspect', and the imaginary part will be set to zero.

In some cases, you may want to set the imaginary part of a complex structure as well as the real part. In this case, you can use `i2cmplx', which takes the data from a non-complex structure and uses it to set the imaginary part of an existing complex structure. This means that the complex structure has to be created initially by `r2cmplx', and then the imaginary part can be set by `i2cmplx'. So, if you have two spectra called `rspect' and `ispect' which you want to be the real and imaginary parts of a complex spectrum, the sequence is

   ICL> r2cmplx rspect cmplxspect
   ICL> i2cmplx ispect cmplxspect

and the order of operations is important; doing the `i2cmplx' step first will produce a quite different result: the `i2cmplx' will fail, unless it so happens that `cmplxspect' already exists, and even if it succeeds the `r2cmplx' will just produce a new version with a zero imaginary array.

There is no procedure supplied to create a complex structure with the imaginary data taken from a specified file, say `ispect', but with the real part set to zero. It was thought that this would be an unusual requirement. If needed, the following sequence may be used:

   ICL> icmult  ispect 0 scrap
   ICL> r2cmplx scrap cmplxspect
   ICL> i2cmplx ispect cmplxspect



next up previous 78
Next: Going smoothly to zero at the ends
Up: FFT
Previous: Complex data structures

FIGARO A general data reduction system
Starlink User Note 86
Keith Shortridge, Horst Meyerdierks,
Malcolm Currie, Martin Clayton, Jon Lockley,
Anne Charles, Clive Davenhall,
Mark Taylor, Tim Ash, Tim Wilkins, Dave Axon,
John Palmer, Anthony Holloway and
Vito Graffagnino
2004 February 17
E-mail:ussc@star.rl.ac.uk

Copyright © 2008 Science and Technology Facilities Council