Skip to content

Commit

Permalink
swap NaNs
Browse files Browse the repository at this point in the history
  • Loading branch information
smathermather committed Aug 16, 2024
1 parent 719734f commit 90e7b5c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion opendm/gcp.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import glob
import os
import numpy as np
from opendm import log
from opendm import location
from pyproj import CRS
Expand All @@ -19,6 +20,7 @@ def read(self):

# Strip eventual BOM characters
contents = contents.replace('\ufeff', '')
contents = contents.replace('NaN', '0')

lines = list(map(str.strip, contents.split('\n')))
if lines:
Expand Down Expand Up @@ -71,6 +73,7 @@ def parse_entry(self, entry):
parts = entry.split()
x, y, z, px, py, filename = parts[:6]
extras = " ".join(parts[6:])

return GCPEntry(float(x), float(y), float(z), float(px), float(py), filename, extras)

def get_entry(self, n):
Expand Down Expand Up @@ -241,4 +244,4 @@ def __str__(self):
return "{} {} {} {} {} {} {}".format(self.x, self.y, self.z,
self.px, self.py,
self.filename,
self.extras).rstrip()
self.extras).rstrip()

0 comments on commit 90e7b5c

Please sign in to comment.