View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

Cursor file problem

Sidh wrote on Jun 15, 2015


Hi everyone,

I am a new IRAF user, and I have some problem with the splot command.

I try to use it to save some informations in a .log file but there is no .log file registered at the end of the operation.

Here is the line I use ;

splot(nb,cursor=data_dir+'/txt/curBFp.txt', save_file=data_dir+'/log/splotb.log')


After some research and test, I think that the cursor file is the problem (someone made it for me).

0 0 1 t

0 0 1 -

6448 0 1 s

6528 0 1 s

6603 0 1 s

6683 0 1 s

0 0 1 f

0 0 1 q

0 0 1 w

6463 -5e-16 1 e

6663 5e-16 1 e

I saw that, by deleting the line : ' 0 0 1 w ', the code seems to work, but I would like to know how it works.

Can anyone link me a tutorial on cursor files or help me fix this one ?

Thank you !

Mike Fitzpatrick wrote on Jun 15, 2015


To answer your first question, see "help cursors" and "help gtools" for more information about cursor files and the special windowing commands.

From your cursor file it was clear whether you intended the last two 'e' keystrokes to be the positions used to mark the new window started by the 'w' command, or if these were the endpoints for the SPLOT 'e' command to measure the eq. width. Did you think the 'w' did something else?

Sidh wrote on Jun 15, 2015


I am discovering the cursor files, so I did not know what the 'w' do.

And yes, the 'e' command purpose is to measure the width.

But my major problem is that : when I run the script, this part should output a splotb.log document that I can use afterward. But here, if I let the ' 0 0 1 w' ligne, this .log file is not created.

And, I don't really understand why ..


Mike Fitzpatrick wrote on Jun 15, 2015


The 'w' keystroke is a "window" command and expects to be followed by two 'e' keystrokes to set the corners. Try using "0 0 1 :write" to instead use the ":write" command to write the logfile.

Sidh wrote on Jun 16, 2015


As I told you, I don't use the command but I am running a python script.

So I can't use the ' 0 0 1 :write ' command ..

I have one more question as I now have a better understanding of the file :

There are 4 lines with the 's' command. I know that they are used to set a range for the substraction, but as they work 2 by 2, do I need to make a 'f' command after the two first ?

Or do the 'f' command understand that there are 2 operations to do ?

Thank you again for your help


Mike Fitzpatrick wrote on Jun 16, 2015




As I told you, I don't use the command but I am running a python script.

So I can't use the ' 0 0 1 :write ' command ..


Just replace the "0 0 1 w" in the cursor file with "0 0 1 :write" to do this.



I have one more question as I now have a better understanding of the file :

There are 4 lines with the 's' command. I know that they are used to set a range for the substraction, but as they work 2 by 2, do I need to make a 'f' command after the two first ?


The 's' keystroke commands do a smoothing by some specified value (see the help page). So your cursor command file first subtracts a fit to the spectrum (the 't' and '-' on first two lines), does 4 's' commands to smooth (presumably you would interactively respond to the prompt for the boxcar size), then enters function mode (the 'f') and immediately quits (the 'q'). Lastly it does a 'w' to window using the positions specified by the two 'e' keystrokes.


Sidh wrote on Jun 19, 2015


Thank you for your help Fitz.

The person that made the cursor for me finally contacted me back, telling me that it was the wrong cursor, so it couldn't be working really well ...

Anyways, I now understand what I am working on, thank you again !

Last post on Jun 19, 2015