pwem.utils module

pwem.utils.cleanFileName(fn, warn=True)[source]

Cleans any character that later on might cause shell parsing errors like “(“, “)”, ” ” and warns about it if warn is true.

Parameters:
  • fn – file to be cleaned
  • warn – Optional (True). Logs
pwem.utils.convertPixToLength(samplingRate, length)[source]
pwem.utils.getCmdPath(*paths)[source]
pwem.utils.getPWEMPath(*paths)[source]
pwem.utils.getTemplatePath(*paths)[source]
pwem.utils.loadSetFromDb(dbName, dbPrefix='')[source]
pwem.utils.runProgram(program, params)[source]

Runs a em program setting its environment matching a prefix

pwem.utils.splitRange(minValue, maxValue, splitNum=10, roundTo=2)[source]

returns a list of “splitNum” items with values ranging from minValue to maxValue, equally divided :param minValue: value to start from :param maxValue: value to stop :param splitNum: number of splits, limits included :param roundTo: default to 2, rounding decimal value :return: list with the split