Skip to main content

    OpXRD inputs and parameters

    Search filters, similarity queries, and operation configuration for OpXRD.

    opxrdinputs

    You provide an operation plus its inputs — search filters, a query pattern, or a pattern ID. The operation choice is what most shapes the result, since it determines which filters and data each request needs.

    OpXRD inputs and parameters

    Operation selection

    The operation parameter determines which OpXRD function to execute:

    OperationDescriptionRequired Inputs
    search_patternsFilter database by element, formula, or space groupAt least one filter
    similarity_searchFind similar patterns using CrystalNN fingerprintstwo_theta_values + intensities
    compute_fingerprintGenerate a fingerprint from a crystal structurecif_content or structure_dict
    get_patternRetrieve a specific pattern by IDPattern ID
    list_institutionsBrowse contributing institutionsNone
    compute_statisticsGet aggregate database statisticsNone

    search_patterns parameters

    ParameterTypeRequiredDefaultDescription
    elementsstring[]No[]Filter by element symbols (e.g., ["Fe", "O"]). Auto-extracted from chemical_formula if omitted.
    elements_exclusivebooleanNofalseIf true, a pattern must contain ONLY the listed elements (exact composition, not a superset)
    spacegroupintegerNonullFilter by spacegroup number (1-230) — not a Hermann-Mauguin symbol
    spacegroup_range[integer, integer]NonullFilter by an inclusive spacegroup-number range [min, max]
    chemical_formulastringNonullChemical formula (e.g., "Fe2O3")
    min_atoms / max_atomsintegerNonullFilter by unit-cell atom count
    volume_min / volume_maxnumberNonullFilter by unit cell volume (ų)
    label_typestringNonullfully_labeled, lattice_labeled, partially_labeled, unlabeled, or any
    institutionstringNonullFilter by contributing institution
    max_resultsintegerNo100Maximum patterns to return

    Element filter examples

    Filterelements_exclusiveMatches
    ["Fe", "O"], falseIron oxides, iron oxyhydroxides, etc.
    ["Fe", "O"], trueOnly pure iron-oxygen compounds
    ["Ti"], falseAny titanium-containing compound

    similarity_search parameters

    ParameterTypeRequiredDefaultDescription
    two_theta_valuesnumber[]Yes--2-theta values (degrees) of the query pattern
    intensitiesnumber[]Yes--Intensity values of the query pattern, same length and order as two_theta_values
    similarity_thresholdnumberNo0.8Minimum similarity score (0.0-1.0)
    similarity_metricstringNo"cosine"cosine, pearson, or euclidean
    max_resultsintegerNo100Maximum similar patterns to return

    There is no separate pattern_data/wavelength field for this operation — provide the two arrays directly:

    {
      "operation": "similarity_search",
      "two_theta_values": [10.0, 20.5, 25.3, 30.1],
      "intensities": [100, 350, 800, 450]
    }

    compute_fingerprint parameters

    ParameterTypeRequiredDescription
    cif_contentstringOne of the twoCIF file content for the structure to fingerprint
    structure_dictobjectOne of the twoPymatgen structure dict, as an alternative to cif_content

    This operation takes a crystal structure, not a raw diffraction pattern — it is not the same input shape as similarity_search. The platform's tool schema does not currently expose a cif_content/structure_dict field for OpXRD, so this operation may not be reachable from chat; see PyWPEM if you need a fingerprint or comparison derived directly from a raw pattern.

    get_pattern parameters

    ParameterTypeRequiredDescription
    pattern_idstringYesOpXRD database pattern identifier

    Shared output options

    ParameterTypeDefaultDescription
    offsetinteger0Pagination offset
    include_pattern_databooleantrueInclude full 2-theta/intensity data in results
    include_structurebooleantrueInclude crystal structure details in results
    include_fingerprintbooleanfalseCompute and include CrystalNN fingerprints (slower)

    Input validation rules

    • Elements: Must be valid element symbols from the periodic table
    • Spacegroup: A numeric spacegroup (1-230), not a Hermann-Mauguin symbol — use chemical_formula or elements if you only know the symbol
    • Similarity search: two_theta_values and intensities must both be present, with matching lengths
    • Similarity threshold: Must be between 0.0 and 1.0. Values below 0.5 may return many low-quality matches
    • At least one criterion: search_patterns needs at least one of elements, chemical_formula, pattern_id, spacegroup/spacegroup_range, or a similarity-search pair — otherwise the tool returns an error rather than the whole database

    Was this page helpful?

    On this page

    On this page

    Loading...