def str_compared(self): str = ["\nObservations compared:", "======================"] str.append(self.compObsClList.__str__()) return "\n".join(str) def __str__(self): return self.str_compared() if __name__ == "__main__": from gizela.data.GamaLocalDataObs import GamaLocalDataObs data1 = GamaLocalDataObs() data2 = GamaLocalDataObs() try: file1 = open("../../example/vec/vec2008j.gkf") file2 = open("../../example/vec/vec2008p.gkf") except Exception, e: print "Cannot open files" print e import sys sys.exit(1) data1.parse_file(file1) data2.parse_file(file2) cmp = CompareObs(data1, data2)
# open files try: file1 = open(args[0]) except Exception, e: print >>sys.stderr, e sys.exit(1) try: file2 = open(args[1]) except Exception, e: print >>sys.stderr, e sys.exit(1) # read data from gizela.data.GamaLocalDataObs import GamaLocalDataObs obs1 = GamaLocalDataObs() obs2 = GamaLocalDataObs() obs1.parse_file(file1) obs2.parse_file(file2) # set central point if options.central_point is not None: cpoint = options.central_point.split(",") if len(cpoint) is not 2: print >>sys.stderr, "Cannot read central point: %s" % \ options.central_point sys.exit(1) print >>sys.stderr, "Local system: Central point: lat=%s, lon=%s deg" %\ (cpoint[0], cpoint[1])
from gizela.data.Network import Network obsList = NetworkObsList(coordSystemLocal=localSystem) #fileNameList = [] for fn in arg: try: print >>sys.stderr, "Reading gama-local observations: ", fn file = open(fn) except Exception, e: print >>sys.stderr, e sys.exit("Cannot open file '%s'" % fn) try: #print fn obs = GamaLocalDataObs() obs.parse_file(file) #fileNameList.append(fn) net = Network(coordSystemLocal=localSystem, data=obs) #print >>sys.stderr, net.make_gama_xml() net.set_file_name(fn) obsList.append(net) except Exception, e: print >>sys.stderr, e sys.exit("Cannot parse file '%s'" % fn) #try: # #print "*", fn # adj = GamaLocalDataAdj() # file.seek(0) # adj.parse_file(file)
#from gizela.stat.CompareObs import CompareObs # nacteni vstupnich parametru from optparse import OptionParser usage = "usage: %prog [options] < file1" version = "%prog $Revision: 76 $" parser = OptionParser(usage=usage, version=version) parser.add_option("", "--cpoint", action="store", type="string", dest="central_point", help="Set central point latitude and longitude in degrees --cpoint=50.01,14.2") (options, args) = parser.parse_args(); # read data from gizela.data.GamaLocalDataObs import GamaLocalDataObs obs1 = GamaLocalDataObs() obs1.parse_file(sys.stdin) #print >>sys.stderr, obs1.stdev # set central point if options.central_point is None: print >>sys.stderr, "No central point set." sys.exit(1) cpoint = options.central_point.split(",") if len(cpoint) != 2: print >>sys.stderr, "Cannot read central point: %s" % options.central_point sys.exit(1) print >>sys.stderr, "Local system: Central point: lat=%s, lon=%s deg" %\
# # $Id: Ellipsoid.py 67 2010-08-03 16:10:35Z michal $ """ Module of Gama-local Correction Tests """ from gizela.data.GamaLocalDataObs import GamaLocalDataObs if __name__ == "__main__": """ Main module doc """ dataObs = GamaLocalDataObs() #file = open("../../example/xml-corr/xml-corr.xml") file = open("../../example/xml-corr/xml-corr2.xml") dataObs.parse_file(file) # print dataObs from gizela.data.Network import Network from gizela.util.CoordSystemLocal3D import CoordSystemLocal3D net = Network(coordSystemLocal=CoordSystemLocal3D(), data=dataObs) #import sys #print >>sys.stderr, net.make_gama_xml() net.compute_corr() try: