isoclassify:使用等时线网格执行恒星分类

  • S2_595136
    了解作者
  • 1.1MB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-15 03:39
    上传日期
等时线恒星分类代码 给定任何输入可观察值集合,Python代码即可执行恒星分类。 细节在描述 和 -请在使用代码时引用这些文件。 安装 下载mwdust (请参阅 )。 克隆和cd的回购, git clone https://github.com/danxhuber/isoclassify cd isoclassify 安装isoclassify (如果对代码进行更改,请在可编辑模式下使用-e选项) pip install . 如果安装成功, isoclassify -h 应该输出 usage: isoclassify [-h] {run,batch,multiproc,scrape-output} ... optional arguments: -h, --help show this help message and exit subcomm
isoclassify-master.zip
  • isoclassify-master
  • setup.py
    1.4KB
  • .gitignore
    1.2KB
  • isoclassify
  • pipeline.py
    11.9KB
  • data
  • extinction-vector-green19-iso.txt
    304B
  • extinction-vector-schlafly16-iso.txt
    290B
  • distance-samples-green19.txt
    1.7KB
  • extinction-vector-cardelli-iso.txt
    295B
  • extinction-vector-schlafly11-iso.txt
    267B
  • __init__.py
    612B
  • direct
  • bprp-solar-mist.txt
    461.7KB
  • __init__.py
    0B
  • asfgrid.py
    18.9KB
  • getmesabc.py
    1.1KB
  • classify.py
    32KB
  • jk-solar-mist.txt
    421.5KB
  • extinction.py
    2.8KB
  • grid
  • plot.py
    7.7KB
  • temp
    0B
  • __init__.py
    0B
  • match.py
    366B
  • priors.py
    1.9KB
  • example-bc.ipynb
    86.7KB
  • pdf.py
    3.1KB
  • classify.py
    41.1KB
  • isoclassify.py
    6.9KB
  • requirements.txt
    46B
  • bin
  • isoclassify
    7.1KB
  • MANIFEST.in
    68B
  • LICENSE
    1.1KB
  • examples
  • direct.ipynb
    27.8KB
  • grid.ipynb
    673.7KB
  • example.csv
    935B
  • scripts
  • huber17
  • ini
    1B
  • apokasc_direct.py
    5.5KB
  • apokasc_grid.py
    5.5KB
  • tgas_combined_obs.txt
    733.9KB
  • singlestar
  • makeinput.py
    2.6KB
  • out-direct.py
    529B
  • out-grid.py
    234B
  • isoclassify-script
    1.1KB
  • README.md
    6KB
内容介绍
# Isochrone Stellar Classification Codes [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.573372.svg)](https://doi.org/10.5281/zenodo.573372) Python codes to perform stellar classifications given any set of input observables. Details are described in [Huber et al. 2017](http://adsabs.harvard.edu/abs/2017ApJ...844..102H) and [Berger et al. 2020](https://ui.adsabs.harvard.edu/abs/2020arXiv200107737B/abstract) - please cite these papers when using the code. ## Installation 1. Download `mwdust` (see https://github.com/jobovy/mwdust). 2. Clone and `cd` to the repo, ```bash git clone https://github.com/danxhuber/isoclassify cd isoclassify ``` 3. Install `isoclassify` (use the `-e` option for editable mode if making changes to the code) ```bash pip install . ``` 4. If the install succeeded, ```bash isoclassify -h ``` should output ```none usage: isoclassify [-h] {run,batch,multiproc,scrape-output} ... optional arguments: -h, --help show this help message and exit subcommands: {run,batch,multiproc,scrape-output} run run isoclassify ``` 5. **Optional:** Set an environment variable for a path to store the MESA models downloaded in step 6. Otherwise, skip this step and use the default location. ```bash export ISOCLASSIFY=/path/to/data/dir ``` 6. Download MESA models into the `isoclassify` data directory created upon installation or specified in step 5. For Gaia DR2 use: ```bash https://drive.google.com/drive/folders/1zjI8c-2FHpf_HiB5Rl6QDvcccKhw1-Z_?usp=sharing ``` Models updated for Gaia EDR3: ```bash https://drive.google.com/drive/folders/1GC81YxBvMF2wu4TdL0vItvdYv-zsaLI1?usp=sharing ``` ## Grid Modeling: Derives posterior distributions for stellar parameters (teff, logg, feh, rad, mass, rho, lum, age, distance, av) through direct intregration of isochrones, given any set of observables (photometry, spectroscopy, parallax, asteroseismology) and priors. Can fit for extinction or use reddening map, includes (optionally) a correction to the Dnu scaling relation corrections by Sharma et al. (2016). <br /> See example/grid.ipynb for an application. ## Direct Method: Uses bolometric corrections and extinction maps to derive stellar parameters using direct physical relations. Masses and densities are only calculated for cool stars within the empirical relations by [Mann et al. 2019](https://ui.adsabs.harvard.edu/abs/2019ApJ...871...63M/abstract) (to derive masses for any star, use grid modeling mode described above). Options are: <br /> 1. RA/DEC + Photometry + (Spectroscopy) + Parallax -> Teff, R, L, distance, Av (+ M & rho for cool stars). Uses Monte-Carlo method to implement exponentially decreasing volume density prior with a length scale of 1.35 kpc (Astraatmadja & Bailer-Jones 2016) 1. RA/DEC + Asteroseismology + Spectroscopy -> logg, rho, rad, mass, lum, distance, Av. Uses Dnu scaling relation corrections by Sharma et al. (2016) [not yet implemented] Bolometric corrections are interpolated in (Teff, logg, FeH, Av) from the MIST grid (http://waps.cfa.harvard.edu/MIST/model_grids.html) ## Command line interface isoclassify includes a command line interface (CLI) for convenient single star processing, as well as batch processing of many stars. ```bash isoclassify run <mode> <star name> --csv <csv file> --outdir <output directory> --plot <plotmode> ``` 1. `<mode>` direct or grid 1. `<star name>` tells isoclassify which row of <csv file> to pull the input parameters 1. `<output directory>` will contain the isoclassify output files 1. `<csv file>` contains as columns parameters that are passed to isoclassify 1. `<plotmode>` tells isoclassify whether pop interactive plots `show`, save to a png `save-png`, or to not plot at all `none`. We've included `examples/example.csv` with a few stars as an example ```bash mkdir -p output/sol # make sure output directory exists isoclassify run direct sol --csv examples/example.csv --outdir output/sol --plot show ``` The CLI also makes parallel processing easy. ```bash # generate batch scripts isoclassify batch direct examples/example.csv -o output > isoclassify.tot # Run with GNU parallel parallel :::: isoclassify.tot # Combine outputs into one CSV file bin/isoclassify scrape-output 'output/*/output.csv' output.csv ``` You can also run python-based multiprocessing through joblib and memory-mapping to reduce RAM overhead. ```bash isoclassify multiproc <mode> <num processes> <input csv> <output csv> --baseoutdir <base output directory> --plot <plot mode> ``` 1. `<mode>` direct or grid 1. `<num processes>` number of processes to run at a time. -1 uses all processors, including hyperthreading for machines that have it (num cores * 2). -1 should be used with caution depending upon the # of processors and RAM in your machine, as a single process can easily consume ~4GB of RAM by itself 1. `<input csv>` location and name of csv file containing all stars you want to run 1. `<output csv>` location and name of csv file, scraping all results from folders in <base output directory> 1. `<base output directory>` location of individual stellar output folders (default = ./) 1. `<plot mode>` tells isoclassify whether to save to a png `save-png` (default), save to a pdf `save-pdf`, or to not plot at all `none`. Does not use `show` as above due to issues with multiprocessing functionality. This will run all stars within the designated csv file and produce an output csv file, so there no need to use the scrape-output function detailed above in combination with this script. ## Testing the codebase When making changes, if you haven't changed the core algorithm then run the following command ``` isoclassify batch direct examples/example.csv -o output/direct > isoclassify-test-direct.tot isoclassify batch grid examples/example.csv -o output/grid > isoclassify-test-grid.tot cat isoclassify-test-direct.tot isoclassify-test-grid.tot > isoclassify-test.tot parallel :::: isoclassify-test.tot ``` and compare the output with a previous version.
评论
    相关推荐
    • introduction-to-git:https
      谨慎使用 Git 丸山新平 介绍 本文档旨在以通俗易懂的方式解释 Git 的基本概念和用法。通过阅读本书 易于使用的 Git 你可以使用一个分支 多人可以一起工作 如果你有任何问题,你可以用谷歌找出“我应该查什么词” ...
    • git 教材 progit
      git资源,不错的git入门教程.适合初学者使用
    • git-kurs:na podstawie https
      git-kurs:na podstawie https
    • TVDbLib:httpsGit 克隆
      电视数据库 Git 克隆
    • git-mdp:mdp (https
      git-mdp 用于介绍 git 的甲板
    • Git环境搭建
      NULL 博文链接:https://fangguanhong.iteye.com/blog/2193321
    • Git学习笔记
      NULL 博文链接:https://shadowred.iteye.com/blog/2275226
    • git GUI使用
      NULL 博文链接:https://weiliuhong1.iteye.com/blog/2033484
    • git学习
      NULL 博文链接:https://yinmaolin1.iteye.com/blog/2198059
    • Git 中文教程
      NULL 博文链接:https://lfcaolibin.iteye.com/blog/1111704