Exemple #1
0
def cleanup():
   global retain
   ParSys.cleanup()
   if retain:
      msg_out( "Retaining temporary files in {0}".format(NDG.tempdir))
   else:
      NDG.cleanup()
Exemple #2
0
def cleanup():
    global retain
    ParSys.cleanup()
    if retain:
        msg_out("Retaining temporary files in {0}".format(NDG.tempdir))
    else:
        NDG.cleanup()
Exemple #3
0
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
Exemple #4
0
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
Exemple #5
0
def cleanup():
   global retain, new_ext_ndfs
   try:
      starutil.ParSys.cleanup()
      if retain:
         msg_out( "Retaining EXT 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 )
   except:
      pass
Exemple #6
0
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 )
   except:
      pass
Exemple #7
0
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
Exemple #8
0
#  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 )