def addCoords(self, gpsfile): self.info("Adding GPS coordinates from file: %s ..." % gpsfile) gps = GPS(projection='UTM', utmzone='33') if os.path.splitext(gpsfile)[1] == '.mat': gps.readMAT(gpsfile) else: gps.readGPS(gpsfile) gps.interpolateProj(self.traces * self.nstacks) if self.nstacks > 1: gps.stackCoords(self.traces) self.coords = gps self.hascoords = True self.done()
def addCoords(self, projection="PS71", utmzone=None, gpsfile=None): '''Convenient function: Reads GPS coordinates from file and interpolates x,y,z coordinates in the specified projection to each trace. ''' if gpsfile == None: gpsfile = self.filename + '.cor' cor = GPS(projection, utmzone=utmzone) cor.readCOR(gpsfile, correction='HUBRA') cor.interpolateProj(self.traces * self.nstacks) if self.nstacks > 1: cor.stackCoords(self.traces) self.coords = cor # if projection == "PS71": # proj_describe = 'Polar Stereographic Coordinates (lat_ts=-71)' # elif projection == "UTM": # proj_describe = "Universal Trans-Mercator, Zone %s" % utmzone # else: # proj_describe = "Lat/Long Degrees" self.hascoords = True