Beispiel #1
0
def main():
    print "Entering Main loop [ArmInstLoc]"

    try:
        os.environ['R2LIB']
    except KeyError as e:
        print "%s is not set, run select" % (e)
        raise SystemExit

    usage = "%(prog)s <FILENAME>"
    parser = argparse.ArgumentParser(
        usage=usage, formatter_class=argparse.ArgumentDefaultsHelpFormatter)
    parser.add_argument("filen", metavar="filen", help="OBSERVATION FILENAME")
    args = parser.parse_args()

    venue = 'ops'  #temporary override

    filen = args.filen

    site = parseVicarLabel.getSite(filen)
    drive = parseVicarLabel.getDrive(filen)

    pos = InstPos(filen, site, drive, oLBL, oDAT)
    parseXyz(out_file)
    if dem_type == 'site':
        x, y, z = places.getLocoSiteTranslation(venue, pos, site, drive)
    elif dem_type == 'global':
        x, y, z = pos[0], pos[1], pos[2]
    print "Leaving Main loop [ArmInstLoc] and returing x,y,z: ", x, y, z
    return x, y, z
Beispiel #2
0
def allLoc(filen):
    print "Entering " + __name__ + ".MastInstLoc.py"
    print "Running allLoc"
    print "filen: ", filen
    loco = 'rover2orbital'
    print "loco: ", loco
    site = parseVicarLabel.getSite(filen)
    print "Site Index: ", site
    drive = parseVicarLabel.getDrive(filen)
    print "Drive Index: ", drive
    venue = "ops"
    print "PLACES Venue: ", venue
    inst = parseVicarLabel.getInstrumentId(filen)
    print "Instrument: ", inst
    pos = InstPos(filen)
    if pos == '':
        sid = 'Cpoint'
        pos = str(parseVicarLabel.getCameraCPoint(filen))
    else:
        sid = instruments.InstDic[inst][4]
        pos = pos.tolist()
        pos = pos.replace("]", ")")
    pos = pos.replace(" ", "")

    x, y, z = places.getLocoSiteTranslation(venue, pos, site, drive, loco)

    p2xyz_status = 0
    print "Leaving " + __name__ + ".MastInstLoc.py and returing  x,y,z: ", x, y, z
    return x, y, z, sid, p2xyz_status
Beispiel #3
0
def main():

    try:
        os.environ['R2LIB']
    except KeyError as e:
        print "%s is not set, run select" % (e)
        raise SystemExit

    usage = "%(prog)s <FILENAME>"
    parser = argparse.ArgumentParser(
        usage=usage, formatter_class=argparse.ArgumentDefaultsHelpFormatter)
    parser.add_argument("filen", metavar="filen", help="OBSERVATION FILENAME")
    args = parser.parse_args()

    venue = 'ops'
    filen = os.path.basename(args.filen)
    inst = parseVicarLabel.getInstrumentId(filen)
    site = parseVicarLabel.getSite(args.filen)
    drive = parseVicarLabel.getDrive(args.filen)
    loco = 'rover2orbital'
    pos = instruments.InstDic[inst][1]  #position of instrument in rover frame
    x, y, z = places.getLocoSiteTranslation(
        venue, pos, site, drive, loco)  #xyz translated to global frame
    print x, y, z
    return x, y, z
Beispiel #4
0
def allLoc(filen, loco):
    print "Entering allLoc.ArmInstLoc.py"
    site = parseVicarLabel.getSite(filen)
    drive = parseVicarLabel.getDrive(filen)
    pos, sid, dem_status = str(InstPos(filen, site, drive))
    x, y, z = places.getLocoSiteTranslation("ops", pos, site, drive, loco)
    print "Leaving allLoc.ArmInstLoc.py and returning x,y,z,sid,dem_status: ", x, y, z, sid, dem_status
    return x, y, z, sid, dem_status
Beispiel #5
0
def allLoc(filen):
   print "Running allLoc"
   print "filen: ",filen
   loco = 'rover2orbital'
   print "loco: ",loco
   site = parseVicarLabel.getSite(filen)
   print "Site: ",site
   drive = parseVicarLabel.getDrive(filen)
   print "Drive: ",drive
   
   venue = "ops"
   inst = parseVicarLabel.getInstrumentId(filen)
   pos = instruments.InstDic[inst][1] 
   print "Pos: ",pos
   sid = "NA"
   p2xyz_status = "0"
   x,y,z = places.getLocoSiteTranslation(venue,pos,site,drive,loco)
   #print str(len(xyz))
   #print xyz
   return x,y,z,sid,p2xyz_status
Beispiel #6
0
def ArmInstLoc(pds, oLBL, oDAT):
    print "Entering ArmInstLoc.ArmInstLoc.py"

    venue = 'ops'
    #print "PDS: ", pds
    base = os.path.basename(pds)
    #print "Base: ", base
    core = os.path.splitext(base)[0]
    #print "Core: ",core
    filen = core + '.VIC'
    #print "filename:", filen
    print "inputs", pds, oLBL, oDAT

    ext = os.path.splitext(base)[1]
    if ext == '.VIC':
        filen = core + '.VIC'
    if ext == '.IMG':
        filen = pds
    print "[ArmInstLoc.ArmInstLoc] filen before the rest: ", filen

    site = parseVicarLabel.getSite(filen)
    print "[ArmInstLoc.ArmInstLoc] Site from filen: ", site
    drive = parseVicarLabel.getDrive(filen)
    print "[ArmInstLoc.ArmInstLoc] Drive from filen: ", drive

    pos, dem_type, InFile, OutFile, sid, dem_status = InstPos(
        filen, site, drive, oLBL, oDAT)

    #print pos
    pos = str(pos)
    pos = pos.replace("'", "")
    pos = pos.replace(" ", "")
    #print venue,pos,site,drive,'rover2orbital'
    x, y, z = places.getLocoSiteTranslation(venue, pos, site, drive,
                                            'rover2orbital')

    print "[ArmInstLoc.ArmInstLoc] Leaving function and returning x,y,z,sid,dem_status : ", x, y, z, sid, dem_status
    return x, y, z, sid, dem_status