PRO Exp_Plot

;+
; NAME
; 	 Exp_Plot
; PURPOSE
;	Computes operations from the type
;		y = a Exp( b* y + c ) + d
;	The user introduces on the keyboard
; 	the constants a, b, c and d. This procedure
;	is a part of the mdisp analyser.
;	The operation is performed only on selected plots
; CATEGORY:
;	1D
; CALLING SEQUENCE:
;	Exp_Plot
; COMMON BLOCK:
;	ExpRetrieval: for intern use only
; SIDE EFFECTS:
;	The Selectioner of mdisp is used, and a new plot is
;	created.
;	The terminal window is used.
; RESTRICTION:
;	To use ONLY together with the mdisp selectioner
;	procedures.
; -
; MODIFICATION HISTORY
;	Created: June 91, A.Csillaghy


COMMON ExpRetrieval, expNr

IF N_Elements(expNr) EQ 0 THEN expNr= 0
nbSel = N_Selected()

val = ''

Clear_Screen
PTo, 5,5,'Exponentiation: x = a*exp(bx+c) + d'
Print,' '
Read_Test,'Please enter the factor a : ',1.0, a
Read_Test, 'Please enter the factor b: ',1.0,b
Read_Test,'Please enter the factor c: ',0.0,c
Read_Test,'Please enter the factor d: ',0.0,d

FOR i=1,nbSel DO BEGIN
  name = Selection(i)
  Load_Plot, name, x,y

  newY = a*Exp(b*y+c) + d
  newName = name + '_li'+StrTrim(expNr,2)
  expNr = expNr +1 

  Store_Plot, newName, x,newY
  Remove_Sel, name
  Insert_Sel, newName
ENDFOR

END