Giter VIP home page Giter VIP logo

Comments (5)

JBGreisman avatar JBGreisman commented on June 27, 2024 1

I think that's reasonable. That latter case can still be implemented easily in gemmi for first thresholding at the given dmin prior to the to_gemmi() call.

Just to summarize the proposed API change, there will be two mutually exclusive sets of options:

  1. DataSet.to_reciprocalgrid(grid_size=(int, int, int))
  2. DataSet.to_reciprocalgrid(sample_rate=float) or DataSet.to_reciprocalgrid(dmin=float) or DataSet.to_reciprocalgrid(sample_rate=float, dmin=float)

from reciprocalspaceship.

dennisbrookner avatar dennisbrookner commented on June 27, 2024

As it happens, I had just written this little helper function as a workaround:

def spacing_to_gridsize(spacing, cell):
    """
    Compute the optimal gridsize based on unit cell size and desired spacing

    spacing : float
        Desired (approximate) grid spacing in Angstroms
    cell : gemmi.UnitCell
        Or anything similar with attributes a, b, and c

    NOTE: does not support different spacing in each direction, but in theory could
    """
    gridsize = []
    for dim in [cell.a, cell.b, cell.c]:

        gridsize.append(int(dim // spacing))

    return gridsize

from reciprocalspaceship.

JBGreisman avatar JBGreisman commented on June 27, 2024

I think the most reliable implementations would use gemmi for this:

resolution cutoff:

In [1]: ds.cell.get_hkl_limits(0.95) # Grid size should be this *2 to handle negative values
Out[1]: [28, 33, 36]

sampling rate:

In [2]: ds.to_gemmi().get_size_for_hkl(sample_rate=3)
Out[2]: [80, 96, 108]

from reciprocalspaceship.

kmdalton avatar kmdalton commented on June 27, 2024

Just a note. sample_rate and resolution_cutoff / dmin both influence grid size but are not mutually exclusive concepts. I think we should support both simultaneously so that

ds.to_reciprocalgrid("F", sample_rate=3., dmin=5.)

produces a 3x oversampled grid from the reflections out to 5A.

Does that make sense? Am I talking crazy?

from reciprocalspaceship.

kmdalton avatar kmdalton commented on June 27, 2024

i think we can default sample_rate to 3. and dmin to the resolution of the mtz.

from reciprocalspaceship.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.