def parseKMLfiles(indir, outputKMLdir, kmlName): parser_logger.info("KML navigator") outKMLnav = outputKMLdir + "navigator.kml" # Only parse data, if a KML does not exist. if ( os.path.exists(outKMLnav) == False): parseKMLnav = navigator(indir, 1); parseKMLnav.parseKML(); parseKMLnav.saveKML(outKMLnav, kmlName); del(parseKMLnav) return;
def parseMATfiles(indir, outdir): try: parser_logger.info("aanderaaoxygen") outaanderaaoxygen = outdir + "aanderaaoxygen.mat" parseaanderaaoxygen = aanderaaoxygen(indir, 1); if ( os.path.exists(outaanderaaoxygen) == False): parseaanderaaoxygen.parse(); parseaanderaaoxygen.saveMAT(outaanderaaoxygen) del(parseaanderaaoxygen) parser_logger.info("adcp") outadcp = outdir + "adcp.mat" parseadcp = adcp(indir, 1); if ( os.path.exists(outadcp) == False): parseadcp.parse(); parseadcp.saveMAT(outadcp) del(parseadcp) parser_logger.info("autopilot") outautopilot = outdir + "autopilot.mat" parseautopilot = autopilot(indir, 1); if ( os.path.exists(outautopilot) == False): parseautopilot.parse(); parseautopilot.saveMAT(outautopilot) del(parseautopilot) parser_logger.info("mag") outmag = outdir + "mag.mat" parsemag = mag(indir, 1); if ( os.path.exists(outmag) == False): parsemag.parse(); parsemag.saveMAT(outmag) del(parsemag) parser_logger.info("magfg") outmagfg = outdir + "magfg.mat" parsemagfg = magfg(indir, 1); if ( os.path.exists(outmagfg) == False): parsemagfg.parse(); parsemagfg.saveMAT(outmagfg) del(parsemagfg) parser_logger.info("collision") outcollision = outdir + "col.mat" parsecollision = collision(indir, 1); if ( os.path.exists(outcollision) == False): parsecollision.parse(); parsecollision.saveMAT(outcollision) del(parsecollision) parser_logger.info("depth") outdepth = outdir + "depth.mat" parsedepth = depth(indir, 1); if ( os.path.exists(outdepth) == False): parsedepth.parse(); parsedepth.saveMAT(outdepth) del(parsedepth) # parser_logger.info("engineer") # outengineer = outdir + "engineer.mat" # Problem with the binary type data. # parseeng = engineer(indir, 1); # if ( os.path.exists(outengineer) == False): # parseeng.parse(); # parseeng.saveMAT(outengineer) # del(parseeng) parser_logger.info("flntu") outflntu = outdir + "flntu.mat" parseflntu = flntu(indir, 1); if ( os.path.exists(outflntu) == False): parseflntu.parse(); parseflntu.saveMAT(outflntu) del(parseflntu) parser_logger.info("gps") outgps = outdir + "gps.mat" parsegps = gps(indir, 1); if ( os.path.exists(outgps) == False): parsegps.parse(); parsegps.saveMAT(outgps) del(parsegps) parser_logger.info("gyro") outgyro = outdir + "gyro.mat" parsegyro = gyro(indir, 1); if ( os.path.exists(outgyro) == False): parsegyro.parse(); parsegyro.saveMAT(outgyro) del(parsegyro) parser_logger.info("navigator") outnav = outdir + "nav.mat" parsenav = navigator(indir, 1); if ( os.path.exists(outnav) == False): parsenav.parse(); parsenav.saveMAT(outnav) del(parsenav) parser_logger.info("imagemetadata") outimagemetadata = outdir + "imagemetadata.mat" parseimagemetadata = navigator(indir, 1); if ( os.path.exists(outimagemetadata) == False): parseimagemetadata.parse(); parseimagemetadata.saveMAT(outimagemetadata) del(parseimagemetadata) parser_logger.info("seanav") outsea = outdir + "sea.mat" parsesea = seanav(indir, 1); if ( os.path.exists(outsea) == False): parsesea.parse(); parsesea.saveMAT(outsea) del(parsesea) except CSHELParseError as cshel: errormessage = "ERROR : " + cshel.__str__() parser_logger.error(errormessage) return;