program DSH_
  !! Linearized image perturbation
  !! based on angle-dependend shifts
  !! Paul Sava (paul@sep.stanford.edu)
  !! 3/31/04

  !! real input/output
  !! input  is  z- ax- mx ( image)
  !! output is  z- ax- mx (dimage)

  use sep
  use utilities

  implicit none
  logical :: verb
  type(paxis) :: az,aax,amx
  integer     :: iz,iax,imx

  !! z-ax-mx
  real, dimension(:,:,:), pointer :: din, dou

  call sep_init()
  call from_param("verb",verb,.false.)

  if(verb) then

  end if

  call hinaxis(az ,1);  az%l ="z"; call houaxis(az ,1)
  call hinaxis(aax,2); aax%l="hx"; call houaxis(aax,2)
  call hinaxis(amx,3); amx%l="mx"; call houaxis(amx,3)

  call sep_close()

  allocate(din(az%n,aax%n,amx%n))
  allocate(dou(az%n,aax%n,amx%n))

  call sep_read(din)

  do iz=1,az%n
     dou(iz,:,:) = din(iz+1,:,:)-din(iz,:,:)
  end do
  dou = dou / az%d

  dou = dou * 0.01

  call sep_write(dou)

  call exit(0)
end program DSH_










