Skip to content

Fix tutorial bug - sampling interval of the input PDF (0.1047...) is larger than the Nyquist interval (0.10471975...) #147

Open
@bobleesj

Description

@bobleesj

Problem

The following tutorial example

srmise data/Ag_nyquist_qmax30.gr --plot --range 2 3.5
    --baseline "Polynomial(degree=1)"
Screenshot 2024-10-24 at 11 02 27 PM

gives the following error message:

(diffpy.srmise_env) macbook@Macbook-Air-327 examples % srmise data/Ag_nyquist_qmax30.gr --plot --range 2 3.5
    --baseline "Polynomial(degree=1)"
The input PDF appears to be missing information: The sampling interval of the input PDF (0.10471976036036036) is larger than the Nyquist interval (0.10471975511965977) defined by qmax=30.0.  This information is irretrievable.
Traceback (most recent call last):
  File "/Users/macbook/miniconda3/envs/diffpy.srmise_env/bin/srmise", line 10, in <module>
    sys.exit(main())
             ~~~~^^
  File "/Users/macbook/miniconda3/envs/diffpy.srmise_env/lib/python3.13/site-packages/diffpy/srmise/applications/extract.py", line 537, in main
    cov = ext.extract()
  File "/Users/macbook/miniconda3/envs/diffpy.srmise_env/lib/python3.13/site-packages/diffpy/srmise/pdfpeakextraction.py", line 417, in extract
    pe.extract_single()
    ~~~~~~~~~~~~~~~~~^^
  File "/Users/macbook/miniconda3/envs/diffpy.srmise_env/lib/python3.13/site-packages/diffpy/srmise/peakextraction.py", line 853, in extract_single
    for step in dclusters:
                ^^^^^^^^^
  File "/Users/macbook/miniconda3/envs/diffpy.srmise_env/lib/python3.13/site-packages/diffpy/srmise/dataclusters.py", line 208, in __next__
    if test_idx < self.clusters[nearest_cluster[0], 0]:
                  ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
zsh: command not found: --baseline

Proposed solution

It could be based on comparing two numbers that are meant to be identical but slightly different in values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions