Skip to content

Commit

Permalink
analysis correction (thanks to the reading of Egon)
Browse files Browse the repository at this point in the history
  • Loading branch information
fdechaumont committed Sep 8, 2022
1 parent 0d3c1f0 commit 98c3171
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion LMT/lmtanalysis/Animal.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,9 @@ def getMeanBodyLength (self, tmin=0, tmax=None):
continue

a = self.detectionDictionnary.get( key )
bodySizeList.append(a.getBodySize())

if (a.isHeadAndTailDetected()):
bodySizeList.append(a.getBodySize())

mean = np.nanmean(bodySizeList)
print( "mean animal bodysize: " , mean )
Expand Down
4 changes: 3 additions & 1 deletion LMT/lmtanalysis/BuildEventFollowZone.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def reBuildEvent( connection, file, tmin=None, tmax=None, pool = None ):

for idAnimalB in pool.animalDictionnary.keys():
print(pool.animalDictionnary[idAnimalB])
meanSizeB = pool.animalDictionnary[idAnimalB].getMeanBodyLength( tmax = tmax )
#meanSizeB = pool.animalDictionnary[idAnimalB].getMeanBodyLength( tmax = tmax )

for animal in pool.animalDictionnary.keys():
if( idAnimalB == animal ):
Expand All @@ -94,6 +94,8 @@ def reBuildEvent( connection, file, tmin=None, tmax=None, pool = None ):

for idAnimalB in pool.animalDictionnary.keys():

meanSizeB = pool.animalDictionnary[idAnimalB].getMeanBodyLength( tmax = tmax )

for animal in pool.animalDictionnary.keys():
if( animal == idAnimalB ):
continue
Expand Down
2 changes: 1 addition & 1 deletion LMT/lmtanalysis/BuildEventNest4.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def reBuildEvent( connection, file, tmin=None, tmax=None , pool = None ):
if isinstance( animal , Animal ):
if not ( t in stopDictionnary[animal.baseId] ):
allStoppedInBiggestGroup = False
break
break

if allStoppedInBiggestGroup:
isNest= True
Expand Down
4 changes: 2 additions & 2 deletions LMT/lmtanalysis/BuildEventWallJump.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ def reBuildEvent( connection, file, tmin=None, tmax=None, pool = None, showGraph

if ( tt in dicA ):

directionAnimalA = dicA[t].getDirection()
directionCenterAnimal = math.atan2( centerY - dicA[t].massY, centerX - dicA[t].massX )
directionAnimalA = dicA[tt].getDirection()
directionCenterAnimal = math.atan2( centerY - dicA[tt].massY, centerX - dicA[tt].massX )

#same direction
angleDif1 = math.atan2( math.sin(directionCenterAnimal-directionAnimalA), math.cos(directionCenterAnimal-directionAnimalA) )
Expand Down

0 comments on commit 98c3171

Please sign in to comment.