;+ ; Clear the given accum_struct, free's the pointer, zeros' values. ; ; @param accumbuf {in}{out}{required}{type=accum_struct structure} the ; structure to clear. ; ; @version $Id: accumclear.pro,v 1.1 2005/05/19 20:19:46 bgarwood Exp $ ;- PRO accumclear, accumbuf compile_opt idl2 on_error, 2 if n_params() ne 1 then begin message,'Usage: accumclear, accumbuf',/info return endif ; verify argument if (size(accumbuf,/type) ne 8 or tag_names(accumbuf,/structure_name) ne "ACCUM_STRUCT") then begin message,"accumbuf is not an accum_struct structure",/info return endif if (ptr_valid(accumbuf.data_ptr)) then ptr_free, accumbuf.data_ptr accumbuf.wt = 0.0 accumbuf.teff = 0.0 accumbuf.tint = 0.0 accumbuf.tsys_sq = 0.0 accumbuf.f_delt = 0.0D accumbuf.n = 0 if data_valid(accumbuf.template) gt 0 then data_free, accumbuf.template END