dataset :
photos with timestamps
UBX from M2 and from base station
Processing:
1- Post-Process base station and get corrected coordinates
2- with Emlid Studio (or RTKLib) calculate events (triggers) positions from UBX
as output one gets an …._events.pos file that gives corrected coordinates for each event together with a timestamp
3- extract timestamps from exif of pictures
use exiftool with this command
exiftool -n -csv -filemodifydate -api TimeZone=UTC *.JPG > metadata.csv
the output file “metadata.csv” gives the name of the picture and the timestamp in UTC format
4- Merge …_events.pos and pictures events
For now I’ve got this ugly Python script:
#! /usr/bin/env python
"""
Update Emlid Reach Survey points with PPK position output from RTKLIB
David Shean
dshean@gmail.com
Edited to fix Pandas datetime/Timestamp tz issues, and a few key changes likely based on Emlid updates
"""
import os
import argparse
import numpy as np
import pandas as pd
def getparser():
parser = argparse.ArgumentParser(description='Update Emlid Reach Survey points with \
PPK positions from RTKLIB')
parser.add_argument('survey_pts_csv_fn', type=str, help='Survey point csv filename')
parser.add_argument('ppk_pos_fn', type=str, help='PPK pos filename')
return parser
def main():
parser = getparser()
args = parser.parse_args()
survey_pts_csv_fn = args.survey_pts_csv_fn
ppk_pos_fn = args.ppk_pos_fn
print('Loading: %s' % survey_pts_csv_fn)
survey_pts = pd.read_csv(survey_pts_csv_fn, parse_dates=[1], header=0)
survey_pts['date']=pd.to_datetime(survey_pts['FileModifyDate'],format="%Y:%m:%d %H:%M:%S+00:00")
survey_pts.sort_values('date', inplace=True)
survey_pts.index=survey_pts['date']
print(survey_pts.dtypes)
print(survey_pts)
header = 'Date UTC latitude(deg) longitude(deg) height(m) Q ns sdn(m) sde(m) sdu(m) sdne(m) sdeu(m) sdun(m) age(s) ratio'
print('Loading: %s' % ppk_pos_fn)
ppk_pos = pd.read_csv(ppk_pos_fn, comment='%', delim_whitespace=True, names=header.split(), parse_dates=[[0,1]])
ppk_pos['date']=pd.to_datetime(ppk_pos['Date_UTC'])
ppk_pos.index=ppk_pos['Date_UTC']
print(ppk_pos.dtypes)
print(ppk_pos)
# Applying merge_asof on data and store it
# in a variable
merged_dataframe = pd.merge_asof(ppk_pos, survey_pts, right_index=True,left_index=True,direction='nearest',tolerance=pd.Timedelta("1s"))
print(merged_dataframe)
#Write out new file
out_fn = os.path.splitext(survey_pts_csv_fn)[0]+'_merged.csv'
print("Writing out: %s" % out_fn)
merged_dataframe.to_csv(out_fn)
if __name__ == "__main__":
main()
5- In Metashape, import the coordinates of the cameras from the new file