print "try to run make in ../../example/xml-epoch/ directory" import sys sys.exit() from gizela.data.GamaLocalDataAdj import GamaLocalDataAdj adj = GamaLocalDataAdj() adj.parse_file(file) print adj print adj.pointListAdjCovMat.covmat.make_gama_xml() print adj.stdev from gizela.data.Network import Network from gizela.util.CoordSystemLocal3D import CoordSystemLocal3D c3d = CoordSystemLocal3D() net = Network(c3d, adj, useApriori=True) fig = FigureLayoutErrEll(figScale=0.0001, errScale=2e3) net.plot_point(fig) fig.show_() # graph # test orientation of axes for ori in ("ne", "en", "se", "es", "sw", "ws", "nw", "wn"): fig = FigureLayoutErrEll(errScale=2e3) from matplotlib import pyplot as pl pl.figtext(0.5, 0.5, ori, fontsize=20) net.set_axes_ori(ori) net.plot_point(fig) #fig.set_scale_ratio(1.0/4000) #print fig.get_scale_ratio_string_min()
file = open(name) except IOError, e: print >>sys.stderr, "Cannot open file '%s'" % name print e sys.exit(1) data = GamaLocalDataAdj() try: data.parse_file(file) except Exception, e: print >>sys.stderr, "Cannot parse file '%s'" % name print e sys.exit(1) net = Network(coordSystemLocal=localSystem, data=data) if opt.tranPoint2D is not None: #print net.pointListAdj #print net.pointListAdjCovMat #print net.pointListAdjCovMat.covmat net.tran_point(tran) #print net.pointListAdj #print net.pointListAdjCovMat #print net.pointListAdjCovMat.covmat if opt.joined is None: epochList.append(net) else: epochList.append_joined(net,
#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) # #print adj # if obsList.numEpoch > 0: # obsList[-1].add_adj(adj)
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: file = open("../../example/xml-corr/xml-corr2.corrected.xml","wt") except Exception, e: import sys print >>sys.stderr, "Unable to open file" print >>sys.stderr, e sys.exit(1) print >>file, net.make_gama_xml(corrected=True)