; $Id: davedat1d__restore.pro,v 1.5 2005/02/08 17:17:34 azuah Exp $
;###############################################################################
;
; CLASS NAME:
;   DaveDat1D
;
; PURPOSE:
;   This class encapsulates a DAVE formated dataset containing 1D
;   data.
;
; CATEGORY:
;   Data Browser
;
; SUPERCLASSES:
;   DaveDat
;
; PUBLIC METHODS:
;   Clone
;   Get
;   Print
;   Rebin
;   ResetData
;   Restore
;   Set
;
; AUTHOR:
;   Richard Tumanjong Azuah
;   NIST Center for Neutron Research
;   100 Bureau Drive, Gaithersburg, MD 20899
;   United States
;   azuah@nist.gov; (301) 9755604
;   Oct, 2002
;
; LICENSE:
;  The software in this file is written by an employee of 
;  National Institute of Standards and Technology 
;  as part of the DAVE software project.
;
;  The DAVE software package is not subject to copyright protection
;  and is in the public domain. It should be considered as an
;  experimental neutron scattering data reduction, visualization, and
;  analysis system. As such, the authors assume no responsibility
;  whatsoever for its use, and make no guarantees, expressed or
;  implied, about its quality, reliability, or any other
;  characteristic. The use of certain trade names or commercial
;  products does not imply any endorsement of a particular product,
;  nor does it imply that the named product is necessarily the best
;  product for the stated purpose. We would appreciate acknowledgment
;  if the DAVE software is used or if the code in this file is
;  included in another product.
;
;###############################################################################



;===============================================================================
; DaveDat1D::restore
;
; PURPOSE:
;   This method restore all class variables derived from the davePtr
;   back to their initial values. The davePtr class variables always
;   contains the original data.
;
; PARAMETERS:
;
; KEYWORDS:
;
; RETURN VALUE:
;   0 => failure
;   1 => success
;
function DaveDat1D::restore

retVal = self->resetData()

if (retVal eq 0) then return, retVal

; ensure data is 1D and not 2D
if (ptr_valid(self.zvPtr)) then begin
    if ((size(*(self.zvPtr)))[0] gt 1) then begin
        *(self.zvPtr) = (*(self.zvPtr))[*,1]
    endif
endif
if (ptr_valid(self.zePtr)) then begin
    if ((size(*(self.zePtr)))[0] gt 1) then begin
        *(self.zePtr) = (*(self.zePtr))[*,1]
    endif
endif

return, retVal

end
