PRO Arithm_Ops

;+
; NAME
; 	 Arithm_Ops
; PURPOSE
;	Arithmetic operations from the type
;		y = a y^b + c
;	are performed. The user introduces on the keyboard
; 	the constants a, b and c. This procedure
;	is a part of the mdisp analyser.
; CATEGORY:
;	1D
; CALLING SEQUENCE:
;	Arithm_Ops
; COMMON BLOCK:
;	AddRetr: for intern use only
; SIDE EFFECTS:
;	The Selectioner from mdisp is used, and a new plot is
;	created.
; RESTRICTION:
;	To use ONLY together with the mdisp selectioner.
; -
; MODIFICATION HISTORY
;	Created: June 91, A.Csillaghy


COMMON AddRetr, addNr

IF N_Elements(addNr) EQ 0 THEN addNr= 0B
nbSel = N_Selected()

Clear_Screen
Print,'Arithmetic Operations: y = a*(y^b)+c'
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 ',1.0, c

FOR i=1,nbSel DO BEGIN
  name = Selection(i)
  Load_Plot, name, x,y, d1, d2, d3, d4.d5

  newY = a*(y^b)+c
  newName = name + '_ar'+StrTrim(addNr,2)
  addNr = addNr +1 

  Store_Plot, newName, x,newY, d1, d2, d3, d4, d5
  Remove_Sel, name
  Insert_Sel, newName
ENDFOR

END