This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a funny prompt that would display the zodiac sign corresponding to the date of creation (date when the file is sourced) | |
# computes the right UTF-8 zodiac sign from today's date | |
function __today_zodiac | |
{ | |
local today=$(date +%m%d) | |
if [ $today -le 0120 ] | |
then | |
sign=$'\u2651' # "capricorn" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(fortMyrmidon) | |
e <- fmExperimentOpen("filename.myrmidon") | |
ts <- fmQueryComputeTagStatistics(e) | |
for ( i in seq(1,length(ts))) { | |
a <- e$createAnt() | |
e$addIdentification(a$antID(),ts[i]$TagID,fmTimeInf(),fmTimeInf()) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e <- fmExperimentOpenReadOnly("file.myrmidon") | |
nbFrames <- e$getDataInformations()$frames | |
ts <- fmQueryComputeTagStatistics(e) | |
ts$CountRate <- ts$Count / nbFrames |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# One can use fmExperimentOpenReadOnly too if no modification are needed. | |
e<-fmExperimentOpen("myfile.myrmidon") | |
# start or end can be POSIXct, fmTime or fmTimeCptr object. But they cannot just be character vector. | |
interactions <- fmQueryComputeAntInteractions(e, | |
start = fmTimeParse("2020-02-11T11:53:26.790610Z"), | |
end = fmTimeParse("2020-02-11T12:53:52.685287Z"), | |
maximumGap = fmMillisecond(800), # 800ms gap in interaction are allowed | |
reportTrajectories = FALSE, # you may set true but it will be slower | |
singleThreaded = FALSE) # you can try true to check performances | |
# Please check d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(fortMyrmidon) | |
# load an experiment file, the one with the Bees | |
e <- fmExperimentOpenReadOnly("myfile.myrmidon") | |
# queries all positions of bees between that two times, and do not ask for their zones (they are none defined) | |
positions <- fmQueryIdentifyFrames(e, | |
start = fmTimeParse('2020-05-14T08:00:00.000Z'), | |
end = fmTimeParse('2020-05-14T09:00:00.000Z'), | |
reportZone = FALSE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e <- fmExperimentOpen("file.myrmidon") | |
ts <- fmQueryComputeTagStatistics() | |
for ( i in seq(1,length(ts))) { | |
# optionnaly maybe skip the tag with some criterion | |
if ( ts[i]$Count < 42 ) { | |
next; | |
} | |
a <- e$createAnt(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(FortMyrmidon) | |
#find a given fmCAnt in an experiment given its ID | |
findCAnt <- function(e,antID) { | |
ants <- e$cAnts(); | |
ants$objects[[which(ants$summary$antID == antID)]] | |
} | |
# clone the ant shape types from one experiment to another | |
cloneShapeTypes <- function(from,to) { |