灭绝定律、地图和修正

extinctions的Python项目详细描述


Documentation StatusCode HealthTravis CI build status (Linux)https://codecov.io/gh/nicolaschotard/extinctions/branch/master/graph/badge.svg

灭绝

python包包括不同的灭绝定律和尘埃图。对

安装

要安装:

git clone https://github.com/nicolaschotard/extinctions.git
pip install extinctions/

要在本地目录mypath中安装,请使用:

pip install --prefix='mypath' extinctions/

别忘了把它加到你的Python身上。

要升级到新版本(在git pull或本地修改之后),请使用:

pip install --upgrade (--prefix='mypath') extinctions/

要安装发行版(尚未提供发行版):

pip install http://github.com/nicolaschotard/extinctions/archive/v0.1.tar.gz

也适用于主机:

pip install (--upgrade) https://github.com/nicolaschotard/extinctions/archive/master.zip

将来,发布版本将列在此location中。

依赖关系

extinctionsrequirements文件中列出了一些python依赖项。要全部安装,请使用:

pip install -r requirements.txt

要求如下:

  • numpy==1.11.2
  • scipy==0.17.1
  • matplotlib==1.5.1
  • Seaborn==0.7.0
  • pyyaml==3.11
  • 星形度==1.2.1
  • 请求数=2.10.0
  • astroquery==0.3.1
  • Wget==2.2
  • 健康=1.9.1

尘埃图设置

您可以使用脚本get_maps.py自动下载maps.yaml文件中列出的尘埃映射。它 默认情况下,会将它们放入$home/.extinction/maps中,但其他 位置当然是可能的(选项--outdir)。如果你选择 将它们存储在其他目录中,必须设置$mapsdir环境 指向它的变量。已在输出目录中存在的映射 将不再下载。

可用的尘埃图是:

下载地图

要下载上面列出的绝灭图,请使用脚本 get_maps.py。提供以下选项:

get_maps.py -h
usage: get_maps.py [-h] [--outdir OUTDIR] [--update] [--list]
                 [--select SELECT] [--exclude EXCLUDE]

optional arguments:
   -h, --help         show this help message and exit
   --outdir OUTDIR    Output directory in where to put the dust maps
   --update           Update the maps directory in case of changes of maps.yaml
   --list             List of available maps and exit
   --select SELECT    Select maps to download (coma separated)
   --exclude EXCLUDE  Exclude map(s) (coma separated).If the select option is
                      used, the exclude option will be ignored.

用法

得到e(b-v)

下面是一个如何获取一组 坐标(Ra,Dec):

In[1]:ra,dec=340.83,-9.59# could also be arrays or list of ra/decIn[2]:fromextinctionsimportreddeningIn[3]:red=reddening.Reddening(ra,dec)# ra dec can also be lists of coordinatesINFO:Loadingthemapsfromlocaldirectory/home/chotard/.extinction/maps/-greenisloaded-schlaflyisloaded-sfdisloaded-planckisloaded

然后您可以从不同的来源获得e(b-v):

# from the local mapsIn[4]:red.query_local_map(dustmap='sfd')Out[4]:0.047723956233310674In[5]:red.query_local_map(dustmap='schlafly')Out[5]:0.062566755984547445In[6]:red.query_local_map(dustmap='planck')Out[6]:0.052058338535565914In[7]:red.query_local_map(dustmap='green')Out[7]:0.035786284169101318# from the SFD98 north/south maps using `sncosmo`In[8]:red.from_sncosmo()Out[8]:array([0.0473752])# Using astroqueryIn[9]:red.from_astroquery()Downloadinghttp://irsa.ipac.caltech.edu//workspace/TMP_XG1Joz_30445/DUST/340.8300_-9.5900.v0001/extinction.tbl|==============================================================================================|4.3k/4.3k(100.00%)0sOut[9]:[0.047377326565143825]

绘制一些图形

要了解不同的灭绝规律和尘埃分布图,你可以 使用脚本extinction_plots.py

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
JavaPax考试:从非标准Maven存储库解析Karaf特性存储库(XML文件)   java Spring启动Bean创建异常   java中将ArrayList转换为数组的方法   Android Studio的java Unity插件。   java在CheckStyle中从方法计数中排除getter和setter   HibernateJava。sql。SQLSyntaxErrorException:表/视图“序列”不存在   与命令行程序Java vs C通信   java WebView膨胀异常   java在O(n)java8流中寻找两个列表的交集   java使用Gradle运行单元测试时,最大堆大小在哪里设置?   ssl加载java应用程序(CXF)内的jks文件   CI:Jenkins Git:Simple Java项目:希望在特定时间在脚本上发送消息   java根据位置更改数字   java按数值排序字符串数组   macos java版本“1.6.0_65”是否与java 6模棱两可?   Cassandra中的java时间戳