HDF_NEPutils : Algorithms used for X-ray events NEP computation

tesfdmtools.methods.HDF_NEPutils.NEP(xrays=None, noise=None, fpath='/stage/ltsboldat5/LC_XFDM', xexclude=0.1, xlexclude=0.2, ninclude=0.2, cutfreq=30000.0, diag=True, pdf=None, channel=None, freq=None, logfreq=False, pulsepos=True, rot=False, ascii=False, dtype=False, prlen=None, prclip='end')[source]

Compute NEP for xray-data file and noise file combination.

Kwargs:

  • xrays = HDF file object with xrays. If not provided will be asked for.

  • noise = HDF file object with noise data. If not provided, accompanying noise file with xray file will be used.

  • fpath = path for files

  • xexclude = fraction highest intensity of xray records to exclude. Should be tuned to exclude doubel and triple events in record.

  • xlexclude = fraction lowest intensity of xray records to exclude. Should be tuned to exclude low events in record.

  • ninclude = fraction of lowest noise records to use.

  • cutfreq = frequency cutoff (Hz) for NEP computation

  • diag = print and plot diagnostics information

  • pdf = if not ‘None’, make pdf files, otherwise, show plots interactively

  • channel = channel to use. If not provided, use first available channel

  • freq = frequency to use. If not provided, use first avialable frequency

  • logfreq = not used

  • pulsepos = if True, only use events at proper trigger position, otherwise use all events

  • rot = rotate record in I/Q plane for minimum Q signal

  • ascii = if True, write ascii files of averaged pulse and pulse/noise spectra and NEP

  • dtype = if True, convert data to I-Q when file dtype is “ampl-phase”

  • prlen = if not ‘None’, processing record length

  • prclip = set to clip record at start or end, when prlen is set

Returns:
  • FWHM = the computed NEP (eV)

  • freq = the configured frequency (kHz) of pixel

  • amplt = the configured amplitude of the pixel

  • NEP = the NEP (power) as function of frequency

  • freq = the frequency axis for the NEP

  • gbwp = the configured gbwp for the pixel

  • risetime = the average pulse rise time

  • falltime = the average pulse fall time

tesfdmtools.methods.HDF_NEPutils.NEPfiles(xfile=None, nfile=None, fpath='/stage/ltsboldat5/LC_XFDM', diag=False, names=False)[source]

Get xray and noise files

Kwargs:
  • xfile = filename of xrays. If not provided will be asked for.

  • nfile = filename of noise data. If not provided, accompanying noise file with xray file will be used.

  • fpath = path for files

  • diag = if True, print some diagnostics info

  • names = if True, return filenames instead of file objects

Returns:
  • xrays = HDF file object with x-ray data

  • noise = HDF file object with noise data

tesfdmtools.methods.HDF_NEPutils.NEPs(xrays=None, noise=None, fpath='/stage/ltsboldat5/LC_XFDM', xexclude=0.3, xlexclude=0.2, ninclude=0.2, cutfreq=30000.0, diag=True, pdf=None, channel=None, freqs=None, logfreq=False, summary=False, pulsepos=True, sumret=False, rot=False, ascii=False, dtype=False, prlen=None, prclip='end')[source]

Get NEP for all frequencies (pixels)

Kwargs:
  • xrays = HDF file object with xrays. If not provided will be asked for.

  • noise = HDF file object with noise data. If not provided, accompanying noise file with xray file will be used.

  • fpath = path for files

  • xexclude = fraction highest intensity of xray records to exclude. Should be tuned to exclude doubel and triple events in record.

  • xlexclude = fraction lowest intensity of xray records to exclude. Should be tuned to exclude low events in record.

  • ninclude = fraction of lowest noise records to use.

  • cutfreq = frequency cutoff (Hz) for NEP computation

  • diag = print and plot diagnostics information

  • pdf = if not ‘None’, make pdf files, otherwise, show plots interactively

  • channel = channel to use. If not provided, use first available channel

  • freqs = frequencies to use. If not provided, process all frequencies

  • logfreq = not used

  • summary = if True, provide summary of results in text file

  • pulsepos = if True, only use events at proper trigger position, otherwise use all events

  • sumret = if True, return summary as additional output of routine; do not write to file

    (only applicable if freqs contains only one frequency)

  • rot = if True, rotate I/Q records for minimum Q signal, based on average phase of 100 records

  • ascii = if True, write ascii files of averaged pulse and pulse/noise spectra and NEP

  • dtype = if True, convert records to I-Q when the file dtype is “ampl-phase”

  • prlen = if not ‘None’, processing record length

  • prclip = set to clip record at start or end, when prlen is set

Returns:

  • NEPdata = list of the computed NEP (eV) for the given frequencies (pixels)

class tesfdmtools.methods.HDF_NEPutils.ShowPlots(logfreq=False, title=None)[source]

Make combined plot of the NEP data

Kwargs:
  • logfreq = not used

  • title = subtitle for plot

addplot(num, y, x=None, title='', xlabel='Sample # (/1000)', ylabel='Y')[source]

Add a plot to the combined plot

Args:
  • num = index number within the plot (1-5)

  • y = array of Y-values

Kwargs:
  • x = array of X-values. If not specified ‘x’ will be the index number

  • title = plot title

  • xlabel = label for the X-axis

  • ylabel = label for the Y-axis

annotate(num, text)[source]

Annotate plot with text

Args:
  • num = index number within the plot (1-5)

  • text = text string (can be multiline)

show(psfile=None)[source]

Show the plot, or make pdf file

Kwargs:
  • psfile = Name of pdf output file. If ‘None’, output to screen

tesfdmtools.methods.HDF_NEPutils.ap2iq(record, scale)[source]

Convert amplitude-phase data record to I-Q record

Args:

  • record = FDM HDF data record

  • scale = scale factor for phase