软件
zsh下的homebrew安装与使用
安装
用中科大的镜像:
/usr/bin/ruby -e "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install)"
如果出现下面问题:
==> Tapping homebrew/core
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
用control+c中断并执行以下命令:
cd "$(brew --repo)/Library/Taps/"
mkdir homebrew && cd homebrew
git clone git://mirrors.ustc.edu.cn/homebrew-core.git
安装成功,会有提示。
安装教程参见:https://blog.csdn.net/Alphoseven/article/details/104373758
使用
用brew --help查看可用命令,brew可用命令如下:
Example usage:
brew search TEXT|/REGEX/
brew info [FORMULA|CASK...]
brew install FORMULA|CASK...
brew update
brew upgrade [FORMULA|CASK...]
brew uninstall FORMULA|CASK...
brew list [FORMULA|CASK...]
Troubleshooting:
brew config
brew doctor
brew install --verbose --debug FORMULA|CASK
Contributing:
brew create URL [--no-fetch]
brew edit [FORMULA|CASK...]
Further help:
brew commands
brew help [COMMAND]
man brew
https://docs.brew.sh
MACBOOK如何编辑pdf文件
macbook自带的preview功能很强大,可以插入文字,签名,还能插入图片。
插入文字,签名:tools -> annotate
或者直接点工具栏的铅笔外面有圆圈的图标就好了。
插入图片,原文在这里url:先用preview打开你要插入的图片。command+A 选中图片,command+C 复制图片,command+V 粘贴图片成物体(object),注意这个时候你粘贴的图片会覆盖原来的图片,所以最好把原图copy一个再操作。然后再command+C 复制这个object,现在可以打开pdf文件,粘贴了。
SExtractor使用
格式:
sex xxx.fits -c xxx.sex
关于sextractor中的模型拟合:
如果需要sextractor去拟合sersic模型等,需要提供psf文件。这个psf官方是用psfex来生成的,当然可以自己叠加恒星生成psf图像。
但是通过自己叠加恒星生成的图像需要修改才能被sextractor用。
具体改以下几项,下面是生成108x108的psf,x都是根据数据来改的,其他的都固定,除了3个PSFAXIS:
LOADED=X
ACCEPTED=X
CHI2=X
POLNAXIS=0
POLNGRP=0
PSF_FWHM=X
PSF_SAMP=X
PSFNAXIS=3
PSFAXIS1=108
PSFAXIS2=108
PSFAXIS3=1
WebbPSF
webbpsf的网址在这里
安装之前要卸载系统里已经有的webbpsf和poppy!
可以直接
$ pip install webbpsf
但是这种方法没办法及时获取更新,比如会使用jwst还没上天的psf模型等,这个没上天之前的psf的大小比上天之后在轨测试的psf小。
使用官网的github安装方式:
$ pip install -e git+https://github.com/spacetelescope/poppy.git#egg=poppy
$ pip install -e git+https://github.com/spacetelescope/webbpsf.git#egg=webbpsf
有时候会报错:
error: subprocess-exited-with-error
note: This error originates from a subprocess, and is likely not a problem with pip.
这是因为你系统中安装的setuptools版本太低了,这种错通常还伴随提示:
/private/var/folders/ml/2xwf3qp50n90n4n64349v4gr0000gn/T/pip-build-env-5j_uea_y/overlay/lib/python3.8/site-packages/setuptools_scm/integration.py:27: RuntimeWarning:
ERROR: setuptools==41.2.0 is used in combination with setuptools_scm>=6.x
Your build configuration is incomplete and previously worked by accident!
setuptools_scm requires setuptools>=45
This happens as setuptools is unable to replace itself when a activated build dependency
requires a more recent setuptools version
(it does not respect "setuptools>X" in setup_requires).
setuptools>=31 is required for setup.cfg metadata support
setuptools>=42 is required for pyproject.toml configuration support
Suggested workarounds if applicable:
- preinstalling build dependencies like setuptools_scm before running setup.py
- installing setuptools_scm using the system package manager to ensure consistency
- migrating from the deprecated setup_requires mechanism to pep517/518
and using a pyproject.toml to declare build dependencies
which are reliably pre-installed before running the build tools
解决方法就是,先卸载系统里的低版本setuptools,然后再安装高版本setuptools:
$ sudo pip uninstall setuptools
$ pip install setuptools
然后再从github上安装webbpsf和poppy。或者从github上clone下来,然后直接进到文件夹里pip安装。
$ git clone https://github.com/spacetelescope/poppy.git#egg=poppy
$ git clone https://github.com/spacetelescope/webbpsf.git#egg=webbpsf
$ pip install -e webbpsf
$ pip install -e poppy
参考这个网址
DS9
哈佛网站,之前更新过一次,后来的新下载地址在这里
FAST code
Mariska Kriek (University of California, Berkeley)
网址,现在这个网址进不去了。。。可能开始使用FASTpp了,不推FAST了
找到download,选择最新的版本下载
下载好解压以后,运行execution,然后报错,说是idl版本太低。
然后查上面的网址的FAQ,说是可以通过从新制作execution解决,解决方法如下:
在下载fast的根目录里还有一个文件是mkexe.idl,也一并下载下来
然后把这个文件拷到刚刚下载的fast包中的idl文件夹,然后从这个idl文件夹下进入终端,输入下列命令:
idl mkexe.idl -arg fast
然后就会在当前目录生成一个新的fast的execution,替换原来fast文件夹下的execution就可以了。
起初我以为是把mkexe.idl拷到当时安装idl语言的文件夹下,然后就出错了。
- 使用
运行FAST就是在配置文件的上一层,比如/users/mm/fast/test中存储着配置文件,fast的exe在/users/mm/fast中,然后运行就输入…/fast xxx.param就可以了。
best fit的图纵坐标有问题
运行fast后会给出一个best_fits文件夹,里面有所有的输入和拟合的最好的sed模版,然后可以把测光点在sed template上,发现纵坐标是有问题的。然后师兄说,是因为零点的问题,就是(25-23.93)/2.5,差这么一个系数。
FASTpp code
Mariska Kriek (University of California, Berkeley)
github网址
升级版的FAST,速度快了
TexShop
TexShop 使用 .bib 文件来引用参考文献:
在同一目录下放 .bib 文件,然后在编辑页面,typeset 的顺序如下:
LaTex
BibTex
LaTex
LaTex
然后就可以识别 .bib 文件中的参考文献了。
解决方法来源stackexchange这里
Photutils, GALFIT, Source Extractor 坐标问题
Photutils 关于坐标转换的问题(网址链接),提到几个常用的软件在处理图像的坐标时是不同的。主要还是python的起始坐标是0导致的。
- Photutils:起始(0,0)且image[y,x]才是坐标(x,y)处的像素值
- GALFIT、Source Extractor、DS9、IRAF等:起始(1,1)