FUNCTION mvn_sta_get,apid,tt=tt
if not keyword_set(apid) then begin
print,' ERROR - mvn_sta_get requires a string input of the apid, i.e. c0,c2,...'
dat = {project_name:'MAVEN',valid:0}
return,dat
endif else if size(/type,apid) ne 7 then begin
print,' ERROR - mvn_sta_get requires a string input of the apid, i.e. c0,c2,...'
dat = {project_name:'MAVEN',valid:0}
return,dat
endif else routine = 'mvn_sta_get_'+apid
if not keyword_set(tt) then ctime,tt,npoints=2
if tt[0] gt tt[1] then tt=reverse(tt)
dat = call_function(routine,tt[0])
if dat.time gt tt[1] or dat.end_time lt tt[0] then return,dat
nnn=0l
nnn_max = round((tt[1]-tt[0])/4.+4) < 300000
while dat.end_time lt tt[1] and dat.end_time gt tt[0] and nnn lt nnn_max do begin
dat=sum4d(dat,call_function(routine,/ad))
nnn=nnn+1l
endwhile
return,dat
end