-
Notifications
You must be signed in to change notification settings - Fork 2
Rewrite chandra_genspcreg.sh with python3 #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
liweitianux
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
另外,需要同步更新那个 HOWTO.txt
多谢!
bin/make_spcreg.py
Outdated
| parser.add_argument("-s", "--step", dest="step", type=int, default=5, | ||
| help="calculation step (default:5)") | ||
| parser.add_argument("-o", "--outfile", dest="outfile", | ||
| default="spc_reg.reg", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
之前的默认文件名是 rspec.reg,继续用原来的。
| parser.add_argument("-H", "--ehigh", dest="ehigh", type=int, default=7000, | ||
| help="upper energy limit [eV] (default: 7000 [eV])") | ||
| parser.add_argument("-s", "--step", dest="step", type=int, default=5, | ||
| help="calculation step (default:5)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
calculation step 没说清楚这个参数是用来做什么的。这个说明写长一点没关系。另外还要说明这个数的单位是什么。
|
|
||
|
|
||
| def genspecreg(evtfile, bkg_spec, outfile, reg_centroid, | ||
| step=5, cnts_min=2500): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 函数名称改为
gen_regions() - 这个函数太长了,处理的事情太多。我觉得应当拆分成大概 3 个函数。
比如,reg_centroid 应为 center,直接提供中心坐标,而不要在这个函数里去解析区域文件。
| parser.add_argument("-L", "--elow", dest="elow", type=int, default=700, | ||
| help="lower energy limit [eV] (default: 700 [eV])") | ||
| parser.add_argument("-H", "--ehigh", dest="ehigh", type=int, default=7000, | ||
| help="upper energy limit [eV] (default: 7000 [eV])") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
增加一个参数 --min-counts 表示每个分区里(扣除背景后)的最少光子数,默认为 2500
No description provided.