Skip to content

Commit

Permalink
mdfinfo4: solved for attachment, SR and event blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
aymeric.rateau@gmail.com committed Sep 18, 2014
1 parent a725a27 commit 3ee62ce
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions mdfinfo4.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,11 +625,11 @@ def readinfo(self, fid):
# reads Event Block
if self['HDBlock']['hd_ev_first']:
ev=0
self['EVBlock'][ev] = {}
self['EVBlock'][ev] .update(EVBlock(fid, self['HDBlock']['hd_ev_first']))
self['EVBlock']={}
self['EVBlock'][ev]=EVBlock(fid, self['HDBlock']['hd_ev_first'])
while self['EVBlock'][ev]['ev_ev_next']:
self['EVBlock'][ev] .update(EVBlock(fid, self['EVBlock'][ev]['ev_ev_next']))
ev+=1
self['EVBlock'][ev]=EVBlock(fid, self['EVBlock'][ev-1]['ev_ev_next'])

# reads Data Group Blocks and recursively the other related blocks
self.readDGBlock(fid)
Expand Down Expand Up @@ -761,22 +761,22 @@ def readSRBlock(self, fid, pointer):
# reads Sample Reduction Blocks
if pointer>0:
sr=0
srBlocks=[]
srBlocks.append(SRBlock(fid, pointer))
srBlocks={}
srBlocks[0]=SRBlock(fid, pointer)
while srBlocks[sr]['sr_sr_next']>0:
srBlocks[sr].update(SRBlock(fid, srBlocks[sr]['sr_sr_next']))
sr+=1
srBlocks[sr]=SRBlock(fid, srBlocks[sr-1]['sr_sr_next'])
return srBlocks

def readATBlock(selfself, fid, pointer):
# reads Attachment blocks
if pointer >0:
at=0
atBlocks=[]
atBlocks.append(ATBlock(fid, pointer))
atBlocks={}
atBlocks[0]=ATBlock(fid, pointer)
while atBlocks[at]['at_at_next']>0:
atBlocks[at].update(ATBlock(fid, atBlocks[at]['at_at_next']))
at+=1
atBlocks[at]=(ATBlock(fid, atBlocks[at-1]['at_at_next']))
return atBlocks

def listChannels4( self, fileName = None ):
Expand Down

0 comments on commit 3ee62ce

Please sign in to comment.