Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

Dimple anode viewer does not focus on blobs

Ouverte
#392 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
65/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
python

Piste de recherche

Look for the dimple anode viewer code, likely in a file related to dimple or viewer. The provided helper function shows how to focus on an isosurface. Find where the viewer currently focuses on the nearest atom and modify it to use the isosurface focus method. Test by running the viewer with anomalous density blobs to ensure the view centers on the blob.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

The dimpe anode viewer focusses on the nearest atom to the blob. In cases of unmodelled anomalous density, the blob can be outside of the focussed view as it picks the nearest atom.

Encountered a similar problem when making the metal_iid viewer and solved it with this helper function, which focusses on the isosurface itself rather than the nearest atom:

def generate_isosurfaces_and_focus_on_current_peak(
    builder: mvs.Builder,
    peaks: list[Peak],
    focus_peak_num: int,
    isovalue=5,
):
    for peak_num, _ in enumerate(peaks, start=1):
        # Add anomalous double difference map for the current peak
        ccp4 = builder.download(url=f"map{peak_num}").parse(format="map")
        isosurface_peak = (
            ccp4.volume()
            .representation(
                type="isosurface",
                relative_isovalue=isovalue,
                show_wireframe=True,
                show_faces=False,
            )
            .color(color="#da21fa")
            .opacity(opacity=0.25)
        )
        if peak_num == focus_peak_num:
            isosurface_peak.focus()  # focus on the current peak site

        # Add 2FO-FC map for the current peak
        ccp4_2fo_fc = builder.download(url=f"fmap{peak_num}").parse(format="map")
        ccp4_2fo_fc.volume().representation(
            type="isosurface",
            relative_isovalue=1.5,
            show_wireframe=True,
            show_faces=False,
        ).color(color="#2f78d7").opacity(opacity=0.25)
def generate_isosurfaces_and_focus_on_current_peak(
    builder: mvs.Builder,
    peaks: list[Peak],
    focus_peak_num: int,
    isovalue=5,
):
    for peak_num, _ in enumerate(peaks, start=1):
        # Add anomalous double difference map for the current peak
        ccp4 = builder.download(url=f"map{peak_num}").parse(format="map")
        isosurface_peak = (
            ccp4.volume()
            .representation(
                type="isosurface",
                relative_isovalue=isovalue,
                show_wireframe=True,
                show_faces=False,
            )
            .color(color="#da21fa")
            .opacity(opacity=0.25)
        )
        if peak_num == focus_peak_num:
            isosurface_peak.focus()  # focus on the current peak site

        # Add 2FO-FC map for the current peak
        ccp4_2fo_fc = builder.download(url=f"fmap{peak_num}").parse(format="map")
        ccp4_2fo_fc.volume().representation(
            type="isosurface",
            relative_isovalue=1.5,
            show_wireframe=True,
            show_faces=False,
        ).color(color="#2f78d7").opacity(opacity=0.25)
Langage dominant
Python
Étoiles
2
Forks
3
Merge moyen
1 j 14 h
PR mergées (30 j)
5

Préparer son environnement

  • Fournit un Dockerfile ou un fichier Docker Compose
  • Aucun modèle de pull request
  • Aucun guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de DiamondLightSource/python-dlstbx

Toutes les issues de DiamondLightSource/python-dlstbx

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.