Example #1
0
def TTextract(det,refmon=None,refthreshold=True,lmon=None,lmonthreshold=True,filter='standard',saveoffs=False):
  ixppy.getProfileLimits(det)
  profiles = ixppy.TTextractProfiles(det,refmon=refmon,refthreshold=refthreshold,lmon=lmon,lmonthreshold=lmonthreshold,Nmax=30,calibcycles=0,append_to_det=False,saveoffs=saveoffs)
  if filter=='create':
    filter = ixppy.TTteachFilter(profiles[0])
  elif filter=='standard':
    filter = TTstandardfilter()
  det._add_saved_datafield('TTfiltsettings',filter)

  ixppy.TTextractProfiles(det,refmon=refmon,refthreshold=refthreshold,lmon=lmon,lmonthreshold=lmonthreshold,saveoffs=saveoffs)
  ixppy.TTextractFilterPositions(det)
Example #2
0
def extractProfiles(Areadet, xrayoff=None, laseroff=None,
    profileLimits=None, transpose=False, saveoffs=False,dataset_name_traces='TTtraces'):
  """
    Areadet is the dataset with the camera images
    'refmon' is the incoming intensity monitor (to check for x-ray off)
    'refthreshold' threshold to find x-ray off
    'Nxoff' number of x-ray off images to average around the image to analyze
    'profileLimits' ROI {'limits': np.array([ 146.,  198.]), 'projection': 'vertical range'} os the kind
    'profileLimitsRef' same as above for the reference trace
    'Nmax' limits to Nmax images per calibcycle
    'steps' analyze only every steps images
    'calibcycles' which ones to do, if None do all
  """
  if not laseroff is None:
    dat = Areadet.data * laseroff.filter(False).ones()
  else:
    dat = Areadet.data
  #dat = dat - 32
  
  proflimits,profile = ixppy.getProfileLimits(dat,lims=profileLimits,transpose=transpose)
  
  datpump  = profile * xrayoff.filter(False).ones()
  datref   = profile * xrayoff.filter(True).ones()
  datrefIP = datref.interpolate(xrayoff.filter(False).time)
  
  Areadet[dataset_name_traces] = (datpump-datrefIP)/datrefIP