Skip to content

Commit

Permalink
Merge pull request #96 from compSPI/luis_master
Browse files Browse the repository at this point in the history
Luis master
  • Loading branch information
fredericpoitevin authored Apr 6, 2022
2 parents dcd6f71 + bd48fd5 commit e97e909
Show file tree
Hide file tree
Showing 14 changed files with 239,660 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Building simSPI Container"

on:
push:
branches: [master, github-actions-test, refactoring]
branches: [master, github-actions-test, update-container]
paths:
- 'docker/Dockerfile'
- 'docker/entrypoint.sh'
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:
- --maxkb=2048
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 22.1.0
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/pycqa/isort
Expand Down
11 changes: 11 additions & 0 deletions docker/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.github
.pytest_cache
data
simSPI.egg-info
.deepsource.toml
.gitignore
.pre-commit-config.yaml
dev-requirements.txt
environment-mac.yml
path-config.yaml
sim-config.yaml
21 changes: 11 additions & 10 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,18 @@ RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh &
rm /work/Miniconda3-latest-Linux-x86_64.sh

# Copy the code and generate the environment
COPY . /work/
# Remains to be done: COPY all and remove the fat later, instead-of multiplying layers:
COPY environment.yml /work/environment.yml
COPY README.md /work/README.md
COPY setup.py /work/setup.py
COPY pytest.ini /work/pytest.ini
COPY .codecov.yml /work/.codecov.yml
COPY .coveragerc /work/.coveragerc
COPY .flake8 /work/.flake8
COPY simSPI /work/simSPI
COPY notebooks /work/notebooks
COPY tests /work/tests
#COPY environment.yml /work/environment.yml
#COPY README.md /work/README.md
#COPY setup.py /work/setup.py
#COPY pytest.ini /work/pytest.ini
#COPY .codecov.yml /work/.codecov.yml
#COPY .coveragerc /work/.coveragerc
#COPY .flake8 /work/.flake8
#COPY simSPI /work/simSPI
#COPY notebooks /work/notebooks
#COPY tests /work/tests
RUN . /opt/anaconda/etc/profile.d/conda.sh && conda update -c conda-forge conda
RUN . /opt/anaconda/etc/profile.d/conda.sh && \
conda env update --name base --file environment.yml && \
Expand Down
2 changes: 2 additions & 0 deletions environment-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ dependencies:
- geomstats
- git+https://github.com/compSPI/compSPI.git
- git+https://github.com/compSPI/ioSPI.git
- jupyterlab
- papermill
- pytorch3d
- raster_geometry
- starfile
238,555 changes: 238,555 additions & 0 deletions notebooks/4v6x.pdb

Large diffs are not rendered by default.

Binary file added notebooks/4v6x_map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions notebooks/metadata_fields.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
seed: "seed"
log_file: "log_file"
signal_to_noise: "signal_to_noise"
diameter: "hole_diameter_nm"
thickness_center: "hole_thickness_center_nm"
thickness_edge: "hole_thickness_edge_nm"
name: "particle_name"
voxel_size: "voxel_size_nm"
pdb_file: "pdb_file"
map_file_re_out: "map_file_re_out"
map_file_im_out: "map_file_im_out"
crd_file: "crd_file"
voltage: "voltage_kv"
spread: "energy_spread_v"
dose_per_im: "electron_dose_e_per_nm2"
dose_sd: "electron_dose_std_e_per_nm2"
magnification: "magnification"
cs: "spherical_aberration_mm"
cc: "chromatic_aberration_mm"
aperture: "aperture_diameter_um"
focal_length: "focal_length_mm"
cond_ap_angle: "aperture_angle_mrad"
defocus_nominal: "defocus_um"
defocus_syst_error: "defocus_syst_error_um"
defocus_nonsyst_error: "defocus_nonsyst_error_um"
defocus_file_out: "optics_defocusout"
det_pix_x: "detector_nx_px"
det_pix_y: "detector_ny_px"
pixel_size: "detector_pixel_size_um"
gain: "average_gain_count_per_electron"
use_quantization: "noise"
dqe: "detector_q_efficiency"
image_file_out: "image_file_out"
7 changes: 7 additions & 0 deletions notebooks/path_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#
pdb_file: './notebooks/4v6x.pdb'
metadata_params_file: './notebooks/metadata_fields.yaml'
mrc_keyword: '_randomrot'
output_dir: './notebooks/'
local_sim_dir: '/work/TEM-simulator_1.3/src/TEM-simulator'

48 changes: 48 additions & 0 deletions notebooks/sim_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# References:
# TEM-simulator version 1.3 user manual
# http://tem-simulator.sourceforge.net/

molecular_model:
voxel_size_nm: 0.1 # the size of voxels in the particle map in nm. Range : [0.1,100].
particle_name: 'toto' # name of the particle.
particle_mrcout: None # volume map of sample is written.

specimen_grid_params:
hole_diameter_nm: 1200 # the diameter of the sample in nm.
hole_thickness_center_nm: 100 # the thickness of the sample at the center in nm.
hole_thickness_edge_nm: 100 # The thickness of the sample at the edge and the surrounding support in nm.
particle_slice_pad: 5 # padding around each projected particle in px.

beam_parameters:
voltage_kv: 300 # the acceleration voltage of the microscope in kV. Range : [1,10^4].
energy_spread_v: 1.3 # the energy spread of the electron beam in V.
electron_dose_e_per_nm2: 100 # dose per image in e/nm**2
electron_dose_std_e_per_nm2: 0 # standard deviation of dose per image. Range : [0,1]. Default : 0.

optics_parameters:
magnification: 81000 # the magnification of the simulated microscope. Range : > 1.
spherical_aberration_mm: 0.0 # the spherical aberration of the optical system in mm.
chromatic_aberration_mm: 0.0 # the chromatic aberration of the optical system in mm.
aperture_diameter_um: 50 # diameter of aperture in back focal plane in μm.
focal_length_mm: 3.5 # the focal length of primary lens in mm.
aperture_angle_mrad: 0.1 # the aperture angle of beam furnished by condenser lens in mrad.
defocus_um: 0.0 # [μm]
defocus_syst_error_um: 0.0 # [μm]
defocus_nonsyst_error_um: 0.0 # [μm]
optics_defocusout: None # file to write defocus values

detector_parameters:
detector_nx_px: 5760 # number of pixels along X axis.Range : [1,10^4].
detector_ny_px: 4092 # number of pixels along Y axis.Range : [1,10^4].
detector_pixel_size_um: 5 # The physical size of the detector pixels in μm. Range : [10^-2,10^3].
average_gain_count_per_electron: 2 # average number of counts produced per electron.
noise: 'no' # quantise electron wave as discrete electrons (produces detector noise). Range : [yes,no].
detector_q_efficiency: 0.5 # detector quantum efficiency. Range : [10^-2,1]. Only used if noise is 'yes'.
mtf_params: [0,0,1,0,0] # parameters [mtf_a,mtf_b,mtf_c,mtf_alpha,mtf_beta] specifying the shape of the Modular
# Transfer Function. [0,0,1,0,0] is perfect detector.

geometry_parameters:
n_samples: 1 # number of samples to be generated.

miscellaneous:
seed : 1234 # seed for simulator.
Loading

0 comments on commit e97e909

Please sign in to comment.