[enh] update trapping generation for 2024_11 (10-19 keV)

This commit is contained in:
2025-03-11 12:01:08 +03:00
parent 8062d8de2a
commit 777705d5d2
8 changed files with 2258 additions and 12 deletions

320
.gitignore vendored
View File

@@ -1,4 +1,4 @@
batch*
/batch*
/.gradle/
/.idea/
@@ -6,3 +6,321 @@ batch*
/output/
/notebooks2/.ipynb_checkpoints
!gradle-wrapper.jar
# Created by https://www.toptal.com/developers/gitignore/api/kotlin,intellij+all,julia,python
# Edit at https://www.toptal.com/developers/gitignore?templates=kotlin,intellij+all,julia,python
### Intellij+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# AWS User-specific
.idea/**/aws.xml
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# SonarLint plugin
.idea/sonarlint/
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
### Intellij+all Patch ###
# Ignore everything but code style settings and run configurations
# that are supposed to be shared within teams.
.idea/*
!.idea/codeStyles
!.idea/runConfigurations
### Julia ###
# Files generated by invoking Julia with --code-coverage
*.jl.cov
*.jl.*.cov
# Files generated by invoking Julia with --track-allocation
*.jl.mem
# System-specific files and directories generated by the BinaryProvider and BinDeps packages
# They contain absolute paths specific to the host computer, and so should not be committed
deps/deps.jl
deps/build.log
deps/downloads/
deps/usr/
deps/src/
# Build artifacts for creating documentation generated by the Documenter package
docs/build/
docs/site/
# File generated by Pkg, the package manager, based on a corresponding Project.toml
# It records a fixed state of all packages used by the project. As such, it should not be
# committed for packages, but should be committed for applications that require a static
# environment.
Manifest.toml
/notebooks/Manifest.toml
### Kotlin ###
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*
### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
# Translations
*.mo
*.pot
# Django stuff:
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
.pybuilder/
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock
# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/
# Cython debug symbols
cython_debug/
# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
### Python Patch ###
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
poetry.toml
# ruff
.ruff_cache/
# LSP config files
pyrightconfig.json
# End of https://www.toptal.com/developers/gitignore/api/kotlin,intellij+all,julia,python
/notebooks/grid.kt

View File

@@ -18,5 +18,14 @@
Нозик передает в качестве агрументов ei, ef. В интерполятор идет
f(ei, ei - ef)
## Инструкция
1. Задать в [Main.kt](./src/main/kotlin/ru/inr/mass/trapping/Main.kt)
- нужные поля `setFields(0.2, 1.2, 7.2)`
- Диапазон (18000 - минимальное HV)
2. [gather.sh](./gather.sh) выставить шаги по HV и запустить симуляцию
3. прогнать [trap-spectrum-2024-11.jl](notebooks/trap-spectrum-2024-11.jl),
- задать диапазоны для сеток (0:100, 100:19000 - минимальное HV)
получить grid.kt и сохранить его в [scripts](http://dacha:3020/chernov/numass/src/branch/feature/fit-analysis/numass-workspace/src/main/kotlin/ru/inr/mass/scripts)
4. Проверить визуально через [plot-trap.kt](http://dacha:3020/chernov/numass/src/branch/feature/fit-analysis/numass-workspace/src/main/kotlin/ru/inr/mass/scripts/trap-plot.kt)

View File

@@ -1,7 +1,7 @@
#!/bin/bash
# Script parameters
BATCH_DIRECTORY="batch-02"
VOLTAGES=("8000.0")
BATCH_DIRECTORY="batch_25-03-10_10-19_keV"
VOLTAGES=("19000.0" "18000.0" "16000.0" "14000.0" "12000.0" "10000.0")
mkdir -p $BATCH_DIRECTORY

View File

@@ -1,5 +1,5 @@
### A Pluto.jl notebook ###
# v0.20.3
# v0.20.4
using Markdown
using InteractiveUtils
@@ -93,7 +93,7 @@ StatsPlots = "~0.15.7"
PLUTO_MANIFEST_TOML_CONTENTS = """
# This file is machine-generated - editing it directly is not advised
julia_version = "1.11.1"
julia_version = "1.11.3"
manifest_format = "2.0"
project_hash = "208c4d144a021d9188060647251adaeb78e91154"

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
### A Pluto.jl notebook ###
# v0.20.3
# v0.20.4
using Markdown
using InteractiveUtils
@@ -33,8 +33,8 @@ plotly();
# ╔═╡ 10631e71-39b5-4c26-b452-ba9305def4c9
begin
BASE = "../batch-02"
# BASE = "../batch-03-06-24"
# BASE = "../batch-02"
BASE = "../batch-03-06-24"
BINS_RANGE = range(0, 7500, step=100)
# BINS_RANGE = range(0, 50, step=1)
end
@@ -141,7 +141,11 @@ filter(row -> row.state == "ACCEPTED", trap18)
# ╔═╡ d78313fe-f943-43f0-9a7d-0f4533b05b5d
begin
p = stephist(trap18.L, label="18 keV", size=(1200, 600))
p = stephist(
trap18.L,
label="18 keV",
# size=(1200, 600)
)
stephist!(trap16.L, label="16 keV")
stephist!(trap14.L, label="14 keV")
stephist!(trap12.L, label="12 keV")
@@ -177,7 +181,7 @@ StatsPlots = "~0.15.7"
PLUTO_MANIFEST_TOML_CONTENTS = """
# This file is machine-generated - editing it directly is not advised
julia_version = "1.11.1"
julia_version = "1.11.3"
manifest_format = "2.0"
project_hash = "208c4d144a021d9188060647251adaeb78e91154"

View File

@@ -0,0 +1,48 @@
// Code generated by trap-spectrum-2024-11.jl Julia notebook {{generated_dt}}
package ru.inr.mass.scripts
import org.apache.commons.math3.analysis.interpolation.PiecewiseBicubicSplineInterpolator
class TrapInterpolator {
private val x = arrayOf({{#hvs}}{{.}}, {{/hvs}}).toDoubleArray()
private val yCoarse = arrayOf(
{{#coarse_y}}{{.}}, {{/coarse_y}}
).toDoubleArray()
private val gridCoarse = arrayOf(
{{#coarse_grid}}
arrayOf(
{{#grid}}{{.}}, {{/grid}}
).toDoubleArray(),
{{/coarse_grid}}
)
private val coarseInterpolator = PiecewiseBicubicSplineInterpolator().interpolate(x, yCoarse, gridCoarse)
private val yFine = arrayOf(
{{#fine_y}}{{.}}, {{/fine_y}}
).toDoubleArray()
private val gridFine = arrayOf(
{{#fine_grid}}
arrayOf(
{{#grid}}{{.}}, {{/grid}}
).toDoubleArray(),
{{/fine_grid}}
)
private val fineInterpolator = PiecewiseBicubicSplineInterpolator().interpolate(x, yFine, gridFine)
fun value(ei: Double, delta: Double): Double {
if (ei < x.first() || ei > x.last())
error("trap: ei ($ei) not in [${x.first()}..${x.last()}]")
if (delta < yFine.first())
error("trap: delta < ${yFine.first()}")
if (delta > yCoarse.last())
error("trap: delta > ${yCoarse.last()}")
return if (delta < yFine.last()) {
fineInterpolator.value(ei, delta)
} else {
coarseInterpolator.value(ei, delta)
}
}
}

View File

@@ -33,6 +33,6 @@ fun calculate(e: Double, dir: String) {
setFields(0.2, 1.2, 7.2)
gasDensity = 1e19
initialE = e
range = 7500.0
range = 9000.0
}.simulateAll(1_000_000)
}