Exemplo n.º 1
0
def parse_central_point(cpoint):
    """
    parses central point latitude, longitude and height
    in degrees and meters
    numbers are separated by commas

    cpoint: string: latitude,longitude,height (height is optional)
    return: CoordSystemLocal instance 
    """

    cpoint = cpoint.split(",")

    if len(cpoint) < 2:
        raise ParseCentralPointError, "latitude and longitude not set: %s"%\
                cpoint

    if len(cpoint) > 3:
        raise ParseCentralPointError, "too namy numbers set: %s" % cpoint


    from gizela.util.Converter import Converter
    lat = Converter.deg2rad_(float(cpoint[0]))
    lon = Converter.deg2rad_(float(cpoint[1]))

    if len(cpoint) is 3:
        height = float(cpoint[2])
    else:
        height = 0.0

    #csl = CoordSystemLocal(
    return lat, lon, height
Exemplo n.º 2
0
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.util.Converter import Converter
    lat = Converter.deg2rad_(float(cpoint[0]))
    lon = Converter.deg2rad_(float(cpoint[1]))

    obs1.centralPointGeo.lat=lat 
    obs1.centralPointGeo.lon=lon 
    obs2.centralPointGeo.lat=lat 
    obs2.centralPointGeo.lon=lon 

# transform vector to local system
if options.vecl and options.central_point:
    obs1.tran_vec_local_ne()
    obs1.set_axes_ori("ne")
    #print obs1.make_gama_xml()
    
    obs2.tran_vec_local_ne()
    obs2.set_axes_ori("ne")