Giter Club home page Giter Club logo

easyscan_hep's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

easyscan_hep's Issues

运行位置问题

我不确定目前的版本运行时必须在bin下还是在任意目录都可以。需要改为在任意目录下运行都可以

constraint中的模式

目前constraint中只能接受高斯,按照说明书,也应该可以接受其他形式。至少要能接受像higgssignal这样的输出,既输出直接就是chi^2 或者likelihood

模块缺失提醒

如果用户提供的ini文件中缺少一些块,比如[scan], 报错并提示

Duplicate naming in scan parameter

This is a demonstration block of demostrate.ini used for executing ./bin/easyscan demonstrate.ini.

[scan parameter]
lambda, ...
Alambda, ...

[program]
Input parameters:
lambda,
Alambda,

If lambda is 2.0, it will lead to A2.0.
Therefore, this indicates a bug in Easyscan_HEP. But the solution now is that you could try,
[scan parameter]
lambda, ...
ALambda, ...

非物理点的判断

在每一个程序后面加一个可选的功能,比如起名叫"Limit"

[program2]
Program name: micromegas_4.3.5
Execute command: rm result.txt
./main data.par >log.txt
Command path: ../Externals/micromegas_4.3.5/spinX/
Input file: 1, ../Externals/micromegas_4.3.5/spinX/data.par
Input variable: ma, 1, Replace, ESma
lamda, 1, Replace, ESlamda
kappa, 1, Replace, ESkappa
Output file: 1, ../Externals/micromegas_4.3.5/spinX/result.txt
Output variable: omg, 1, Position, 1,1
Limit: Par['omg']<0.1199+0.012*2

Limit后面是一个可以运行的表达式,返回的值是true或者false。 如果是false的话就不往下运行了,这样可以节省运行时间。

比如现在在做的这个工作,这里的判断就可以写成 Par['mn1‘]<Par['stau1'] & Par['mn1']<Par['snu_tau']

运行外部软件前删除输出文件

运行外部软件时,删除对应的输出文件。原因是如果不删除,有可能该软件没有正确输出,也就是非物理点,但输出文件存在,就会被错误读取。
之前这个功能缺失,但是通过下面方法避免了
[program1]

Program name: susyhit-1.6

Execute command: rm susyhit_slha.out

              ./run

Command path: ../Externals/susyhit/

也就是当中的 rm susyhit_slha.out

输出文件保存

保存的输出文件与输出变量可能不一致。有些参数点不能通过所有实验限制,不会保存到输出文件中,但已经运行过的程序产生的文件已经保存下来了,这就导致了最后不一致。

随机数种子

(不确定,需要check)目前只有在multinest模式下随机数种子有用其他模式没有用

记录每一项的chi2

需要在结果文件中记录了每一项的chi2,以便查看各自贡献的大小。

输入模式

目前输入模式中的line、position,是按照空格或者\t划分的。有些软件的输出中可能没有空格,而是用逗号划分的,所以要改为
如果有逗号按照逗号划分,没有逗号按照空格或者\t划分

非物理的参数点

目前,如果其中一个程序无法正确运行,或者没有产生正确的输出文件,那么判定该点为非物理的点。
出现这种点时要在屏幕上提醒用户。
将来可以添加一个功能,让用户选择是该点为非物理的点,还是正常的点。这个可以放到V2中完成

程序运行的方式

目前用python调用其他程序有两种方式,subprocess和os
有些程序不用通过subprocess或者os调用。所以两种方式都要提供,默认使用subprocess(或os),然后在[scan]中添加一个选择。

添加 fix

参数的先验概率可以设置为fixed,即固定为一个数或者一组数,比如
mu, fixed, 1000

mu, fixed, [100, 150, 1000]

注释

目前程序基本没有注射,需要添加注释

报错信息

有些地方应该判断是否出错,然后提醒用户。这个需要完善
比如 程序使用未定义量时要 报错

math 方法的简化

programX中的input参数,默认前面都有一个math,这样就不用特别说明了

constraint 必须提供的问题

目前constraint必须提供。但是对于一些扫描,constraint没有必要,要求用户随便设置一个不太好,还是改程序,把constraint改为可选的比较好

屏幕输出

目前MCMC算法的屏幕输出比较好看,其他模式下的屏幕输出不好认,要改为和MCMC一样的屏幕输出。

输出变量

目前输出变量里包含文件目录
既:如果保存文件,变量里就会有路径,这个是没有用的,要删掉

range 提示

mcmc算法中,如果有大量的测试样本点超出参数范围,提醒用户参数范围可能设定不合理

unphysical points

关于扫描时得到的非物理点(不论何种扫描方式都有可能遇到)
处理方式:

  1. 保留
  2. 不保留
    如果保留:
    单独输出一个文件,只保留输入参数。(相应的ScanInf.txt也需要产生?)

另外,
对于我们加入Bound,例如Bound: mh > 123 and mh < 125。
不满足Bound的点,计入“unboundphysical points”(另外一个输入文件)

在ini中实现简单计算

添加一种Input variable功能:

Input variable: mu, 1, Replace, ES_mu
m1, 1, Replace, ES_m1
c, 1, Calculate, "par['m1']^2"

实现方法:
ss="par['mh1']^2"
cc="c"
eval("par["+cc+"]="+ss)

不确定是不是”par“

画图程序

在图中直接反映出限制先后的样本点
在画图之前,判断要画图的数据是否是常数或者非数字,如果是,就跳过该图片并提醒用户

不同输入方式的实现

目前版本中只有Replace可以用,其他的处在问题。

主要是目前版本会把table改为空格,导致有些软件无法读取输入文件。

依赖库的安装

因为ES不需要安装,但依赖一些库,所以在程序运行前,可以让ES先判断一下是否缺少库。这个可以放到V2中完成

[program]里面Bound:好像有点问题。

对参数x y 进行扫描,在program里面什么都不干,只是复制文件,保证输出文件都一样。
[program1]
Bound: x, y, lower, utils/bound_wk.in
相当于是在x y平面上加了一条排除线。可是通过画图x y 感觉不是很对。
需要修改program.py 程序891 /893两行
par[ii[0]] 改为 par[ii[1]]

感觉是将y值跟y的限制值做比较
print('"%s=%f" v.s. "%s=%f" compare to the %s limit "%s=%f" by interplotion in "Bound" for program %s'%(ii[0], par[ii[0]], ii[1], par[ii[1]], ii[2].lower(), ii[1], yinter, self._ProgName))
输出
"x=103.714929" v.s. "y=9952.170002" compare to the lower limit "y=103.714929" by interplotion in "Bound" for program test

所以感觉是【par[ii[1]]】跟【par[jj[4]] = yinter】 进行比较

改之前和之后的图片
Scatter_x_y-old
Scatter_x_y-new

test.ini文件:
[scan]
Result file name: first-scan
Scan method: random
Points number: 1000
Input parameters: y, Flat, -10000, 10000
x, log, 1, 10000

Random seed: 2
Interval of print: 100

[program1]
Program name: test
Execute command: cp out.wk out

Command path: utils/
Input file:
Input variable:
Output file: 1, utils/out
Output variable: mh1, 1 , SLHA, BLOCK, MASS, 25

Bound: x, y, lower, utils/bound_wk.in

[constraint]
Gaussian: mh1, 125.0, 2.0

[plot]
scatter: x, y

out.wk文件
BLOCK MASS
25 123

bound_wk.in文件
-100 -100
10000 10000

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.