本文整理汇总了Python中starutil.NDG.cleanup方法的典型用法代码示例。如果您正苦于以下问题:Python NDG.cleanup方法的具体用法?Python NDG.cleanup怎么用?Python NDG.cleanup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类starutil.NDG
的用法示例。
在下文中一共展示了NDG.cleanup方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: cleanup
# 需要导入模块: from starutil import NDG [as 别名]
# 或者: from starutil.NDG import cleanup [as 别名]
def cleanup():
global retain
ParSys.cleanup()
if retain:
msg_out( "Retaining temporary files in {0}".format(NDG.tempdir))
else:
NDG.cleanup()
示例2: cleanup
# 需要导入模块: from starutil import NDG [as 别名]
# 或者: from starutil.NDG import cleanup [as 别名]
def cleanup():
global retain
try:
starutil.ParSys.cleanup()
if retain:
msg_out( "Retaining temporary files in {0}".format(NDG.tempdir))
else:
NDG.cleanup()
except:
pass
示例3: cleanup
# 需要导入模块: from starutil import NDG [as 别名]
# 或者: from starutil.NDG import cleanup [as 别名]
def cleanup():
global retain, new_ext_ndfs, new_lut_ndfs, new_noi_ndfs
try:
starutil.ParSys.cleanup()
if retain:
msg_out( "Retaining EXT, LUT and NOI models in {0} and temporary files in {1}".format(os.getcwd(),NDG.tempdir))
else:
NDG.cleanup()
for ext in new_ext_ndfs:
os.remove( ext )
for lut in new_lut_ndfs:
os.remove( lut )
for noi in new_noi_ndfs:
os.remove( noi )
for res in qua:
os.remove( res )
except:
pass
示例4: invoke
# 需要导入模块: from starutil import NDG [as 别名]
# 或者: from starutil.NDG import cleanup [as 别名]
# temporary directory.
exp = "pi>{0}*dpi".format(snr)
if maxlen != None:
exp += "&{0}<{1}".format(plot,maxlen)
selcat = "{0}/selcat".format(NDG.tempdir)
invoke( "$CURSA_DIR/catselect catin={0} catout={1} norejcat seltyp=e expr='{2}'".format(outcat,selcat,exp))
# If a total intensity reference was supplied, display it as a background
# image, and plot the vectors over the top.
if iref:
invoke( "$KAPPA_DIR/lutable mapping=linear coltab=grey device={0}".format(device))
invoke( "$KAPPA_DIR/display {0}'(,,3)' mode=perc percentiles=\[1,99\] badcol=black device={1}".format(cube,device))
invoke( "$POLPACK_DIR/polplot {0} clear=no axes=no colmag={1} key=yes style='colour=red' device={2}".format(selcat,plot,device))
# Otherwise, just plot the vectors.
else:
invoke( "$POLPACK_DIR/polplot {0} colmag={1} key=yes style=def device={2}".format(selcat,plot,device))
# Delete all temporary NDFs etc
if retain:
msg_out( "Retaining temporary files in {0}".format(NDG.tempdir))
else:
NDG.cleanup()
# If an StarUtilError of any kind occurred, display the message but hide the
# python traceback. To see the trace back, uncomment "raise()" instead.
except starutil.StarUtilError as err:
# raise()
print( err )