How to use the pyxem.signals.pdf_profile.PDFProfile function in pyxem

To help you get started, we’ve selected a few pyxem examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pyxem / pyxem / tests / test_signals / test_pdf_profile.py View on Github external
def test_generate_signal():
    data = np.ones((1, 10)) * np.arange(4).reshape(4, 1)
    data = data.reshape(2, 2, 10)
    pdf = PDFProfile(data)
    assert isinstance(pdf, PDFProfile)
github pyxem / pyxem / tests / test_generators / test_pdf_generator.py View on Github external
def test_get_pdf(reduced_intensity_profile):
    pdfgen = PDFGenerator(reduced_intensity_profile)
    pdf = pdfgen.get_pdf(s_cutoff=[0, 9])
    assert isinstance(pdf, PDFProfile)
github pyxem / pyxem / tests / test_signals / test_pdf_profile.py View on Github external
def test_generate_signal():
    data = np.ones((1, 10)) * np.arange(4).reshape(4, 1)
    data = data.reshape(2, 2, 10)
    pdf = PDFProfile(data)
    assert isinstance(pdf, PDFProfile)
github pyxem / pyxem / tests / test_signals / test_pdf_profile.py View on Github external
def test_generate_signal():
    data = np.ones((1, 10)) * np.arange(4).reshape(4, 1)
    data = data.reshape(2, 2, 10)
    pdf = PDFProfile(data)
    pdf.normalise_signal()
    assert np.equal(pdf, np.ones((2, 2, 10)))
github pyxem / pyxem / tests / test_generators / test_pdf_generator.py View on Github external
def test_signal_size():
    spectrum = np.array([5., 4., 3., 2., 2., 1., 1., 1., 0., 0.])
    ri = ReducedIntensityProfile(spectrum)
    pdfgen = PDFGenerator(ri)
    pdf = pdfgen.get_pdf(s_cutoff=[0, 10])
    assert isinstance(pdf, PDFProfile)

    ri = ReducedIntensityProfile([spectrum])
    pdfgen = PDFGenerator(ri)
    pdf = pdfgen.get_pdf(s_cutoff=[0, 10])
    assert isinstance(pdf, PDFProfile)

    ri = ReducedIntensityProfile([[spectrum]])
    pdfgen = PDFGenerator(ri)
    pdf = pdfgen.get_pdf(s_cutoff=[0, 10])
    assert isinstance(pdf, PDFProfile)

    ri = ReducedIntensityProfile([[[spectrum]]])
    pdfgen = PDFGenerator(ri)
    pdf = pdfgen.get_pdf(s_cutoff=[0, 10])
    assert pdf is None