Closed jbrzusto closed 6 years ago
We'll do this on sgdata.
refreshMotusMetaDBCache()
:
updateMetadataForTags(t, meta, fixBI)
with:
t
: tag data.frame in the format returned by motusSearchTags()
meta
: safeSQL object to meta database where tables will residep
: data.frame of motus projects, as returned by motusListProjects()
; default: meta("select * from projs")
fixBI
: logical; if TRUE, fix burst intervals, otherwise, don't. This should only be set TRUE
when updating all tags, because it uses a majoritarian rule to select "accurate" BIs from those in t
.
(refreshMotusMetaDBCache()
is currently calling cleanTagRegistrations() with the default cleanBI=FALSE anyway, so this parameter is only included in case of future changes)
metadata-history
git repo into new function commitMetadataHistory(meta)
with:
meta
: safeSQL object to meta database with meta
table where metadata hash will be storedhandleRegisterTags()
:
motusSearchTags(projectID)
then subset only these tags updateMetadataForTags()
with these tags and fixBI=FALSE
commitMetadataHistory()
cleanTagRegistrations()
:
motusQuickTagReg()
:
updateMetadataForTags()
with the new tagcommitMetadataHistory()
testing:
tags:
31811,"Lotek","NTQB-3-2","Lotek4",166.38,"332",44.6974983215332
31812,"Lotek","NTQB-3-2","Lotek4",166.38,"334",44.6972999572754
tag_deployments:
31811,1,1538352000,1566128693.30461,1,3
31812,1,1538352000,1566128667.32612,1,3
and updated in metadata cache and metadata history.
tags:
31813,"Lotek","NTQB-3-2","Lotek4",166.38,"337",44.6973991394043
tag_deployments:
31813,1,1538352000,1566128680.31539,1,3
Currently, we cache metadata such as tag registrations, and update them once per day from motus.org for these reasons:
The downside is a delay of up to 24 hours between the time a tag is registered and the time it is available for the tag-finder to detect in new runs of data on the sgdata server. This fails for users who want to register tags and then detect them in uploaded test data the same day. (However, those users can see live detections of newly-registered on a sensorgnome's web interface if they download and install the tag database which is generated on sgdata.motus.org when users register tags.)
Options for Improvement
or