Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Dimple anode viewer does not focus on blobs

未关闭
#392 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
65/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
python

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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)
主要语言
Python
星标
2
派生
3
平均合并
1 天 14 小时
30 天内合并 PR
5

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

DiamondLightSource/python-dlstbx 的其他 Issue

查看 DiamondLightSource/python-dlstbx 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。