3个版本
0.6.1 | 2022年12月30日 |
---|---|
0.6.0 | 2022年11月30日 |
0.6.0-alpha.0 | 2022年11月29日 |
在可视化中排名176
59KB
1.5K SLoC
dm–dt地图绘图器
Rust库(light-curve-dmdt
)和可执行文件(light-curve-dmdt-exec
),用于将光曲线转换为dm–dt空间,实现基于以下论文:Mahabal等人2011年、Mahabal等人2017年、Soraisam等人2020年。
如果您在寻找此软件包的Python绑定,请参阅https://github.com/light-curve/light-curve-python
可执行文件
可以通过运行以下命令安装可执行文件cargo install light-curve-dmdt-exec
来安装dmdt
。您需要在系统中安装Rust工具链,可以考虑使用您的操作系统包管理器或rustup实用程序。
线性dm网格的条件下概率dm–dt地图绘图的示例,64个单元格,dt网格的对数形式[-1.5; 1.5)
,96个单元格
curl https://ztf.snad.space/dr4/csv/633207400004730 | # Get some ZTF data
tail +2 | # chomp CSV header
awk -F, '{print $3" "$4" "$5}' | # print needed columns and change separator to tab
dmdt \
--max-abs-dm=1.5 --height=64 \
--min-lgdt=0 --max-lgdt=2 --width=96 \
--smear --approx-smearing \
--norm=lgdt --norm=max \
--output=example.png
dmdt--帮助
展开
Program for dm-dt maps generator from light curves
Usage: dmdt [OPTIONS] --min-lgdt <FLOAT> --max-lgdt <FLOAT> --max-abs-dm <FLOAT>
Options:
-i, --input <FILE>
Path of the input file, should be built of space-separated columns of time, magnitude and
magnitude error (required for --smare only). If '-' is given (the default), then the input
is taken from the stdin
[default: -]
-o, --output <FILE>
Path of the output PNG file. If '-' is given (the default), then outputs to the stdout
[default: -]
-s, --smear
Produce dm-``smeared'' output using observation errors, which must be the third column of
the input. Instead of just adding some value to the lg(dt)-dm cell, the whole lg(dt) =
const row is filled by normally distributed dm-probabilities
--min-lgdt <FLOAT>
Left border of the lg(dt) grid, note that decimal logarithm is required, i.e. -1.0 input
means 0.1 time units
--max-lgdt <FLOAT>
Right border of the lg(dt) grid, note that decimal logarithm is required, i.e. 2.0 input
means 100.0 time units
--max-abs-dm <FLOAT>
Maximum dm value, the considered dm interval would be [-max-abs-dm, +max-abs-dm)
--width <INT>
number of lg(dt) cells, width of the output image
[default: 128]
--height <INT>
number of dm cells, height of the output image
[default: 128]
--approx-smearing
speed up smearing using approximate error function
-n, --norm <normalisation>
Normalisation to do after dmdt map building. The order of operations is:1) build dmdt map,
each dm-lgdt pair brings a unity value to dmdt space;2) if --norm=lgdt, then divide each
cell value by the total number of the corresponding lgdt pairs, i.e. divide each cell of
some column by the integral value in the column (including values out of the interval of
[-max_abs_dm; max_abs_dm)); 3) if --norm=max, then divide each cell by the overall maximum
value; 4) if any of --norm=lgdt or --norm=max is specified, then all values should be in
[0; 1] interval, so they are multiplied by 255 and casted to uint8 to make it possible to
save dmdt map as a PNG file.
[possible values: lgdt, max]
-h, --help
Print help information (use `-h` for a summary)
-V, --version
Print version information
Rust包
use light_curve_dmdt::{DmDt, Eps1Over1e3Erf};
use ndarray::Array1;
let dmdt = DmDt::from_lgdt_dm_limits(0.0, 2.0, 96, 1.5, 64);
let t = Array1::linspace(0.0, 100.0, 101);
let m = t.mapv(|x| 2.0 * f64::sin(x));
let err2 = Array1::ones(t.len()) * 0.01;
let prob = dmdt.cond_prob::<Eps1Over1e3Erf>(t.as_slice().unwrap(), m.as_slice().unwrap(), err2.as_slice().unwrap());
Cargo功能
doc-images
(非默认):将示例图像添加到HTML文档中,用于https://docs.rspng
(非默认):添加to_png
函数,将dm-dt地图保存为PNG文件serde
(默认):为DmDt
提供serde
实现default
:[]
- 无默认功能full
:启用所有功能
依赖项
~6–15MB
~206K SLoC