处理太空望远镜的科学仪器孔径文件(SIAF)。 SIAF文件包含科学工具的详细几何焦点描述和关系。它们保留在JWST/HST PRD(项目参考数据库)中。
Pysiaf是一个python软件包,可访问,解释,维护和生成SIAF,尤其是JWST。提供用于应用帧转换,绘图,比较和验证的工具。
检查使用哪种PRD版本:
print(pysiaf.JWST_PRD_VERSION)
帧转换( det , sci , idl , tel受支持):
import pysiaf
instrument = 'NIRISS'
# read SIAFXML
siaf = pysiaf.Siaf(instrument)
# select single aperture by name
nis_cen = siaf['NIS_CEN']
# access SIAF parameters
print('{} V2Ref = {}'.format(nis_cen.AperName, nis_cen.V2Ref))
print('{} V3Ref = {}'.format(nis_cen.AperName, nis_cen.V3Ref))
for attribute in ['InstrName', 'AperShape']:
print('{} {} = {}'.format(nis_cen.AperName, attribute, getattr(nis_cen, attribute)))
# coordinates in Science frame
sci_x = np.array([0, 2047, 2047, 0])
sci_y = np.array([0, 0, 2047, 2047])
# transform from Science frame to Ideal frame
idl_x, idl_y = nis_cen.sci_to_idl(sci_x, sci_y)
绘制(仅说明了一小部分选项):



import matplotlib.pyplot as plt
plt.figure(figsize=(4, 4), facecolor='w', edgecolor='k'); plt.clf()
# plot single aperture
nis_cen.plot()
# plot all apertures in SIAF
for aperture_name, aperture in siaf.apertures.items():
aperture.plot()
plt.show()
# plot 'master' apertures
from pysiaf.siaf import plot_master_apertures
plt.figure(figsize=(8, 8), facecolor='w', edgecolor='k'); plt.clf()
plot_master_apertures(mark_ref=True)
plt.show()
# plot HST apertures
siaf = pysiaf.Siaf('HST')
aperture_names = ['FGS1', 'FGS2', 'FGS3', 'IUVIS1FIX', 'IUVIS2FIX', 'JWFC1FIX', 'JWFC2FIX']
plt.figure(figsize=(4, 4), facecolor='w', edgecolor='k')
for aperture_name in aperture_names:
siaf[aperture_name].plot(color='r', fill_color='darksalmon', mark_ref=True)
ax = plt.gca()
ax.set_aspect('equal')
ax.invert_yaxis()
plt.show()
JWST SIAF描述的主要参考是Cox&Lallo,2017年,JWSTSCI-001550: JWST Science Instrument Instrument Aperture文件的说明和使用,可在https://jwst.stsci.edu/documentation/technical-dechnical-documents上获得。 。
Pysiaf在https://pysiaf.readthedocs.io/上进行了记录。
如果发现此软件包有用,请考虑使用上面的DOI徽章引用Zenodo记录。请在引用中找到其他引用说明。
PYSIAF中的所有参数值都可能发生变化。 JWST值是初步的,直到JWST天文台调试得出结论。
Pysiaf中的扭曲和其他转换对于操作的精度足够准确,但不一定具有科学级的质量。例如,每个孔径通常只携带一个滤波器解决方案。有关科学级转换,请咨询科学管道及其参考文件(请参阅https://jwst-docs.stsci.edu/jwst-data-reduction-pipeline)
对于科学观察计划,最新APT(http://www.stsci.edu/hst/proposing/apt)中实现的焦平面几何形状优先。
STSCI望远镜分支只为S&OC操作系统提供了PYSIAF的全部支持。
请打开您希望看到的错误,反馈或新功能的新期刊或新的拉动请求。如果您想解决问题,请发表评论,我们很乐意协助。新的贡献和贡献者非常欢迎!
您有反馈和功能请求吗?您想看一些东西吗?请打开问题或向维护者发送电子邮件。该软件包遵循《太空望远镜行为守则》努力为我们的所有用户和贡献者提供欢迎社区。
以下描述了为Pysiaf项目做出贡献的典型工作流(根据JWQL进行了改编):0。请勿提交任何敏感信息(例如STSCI内部路径结构,机器名称,用户名,密码等) 。 GIT历史无法删除。
spacetelescope pysiaf存储库中创建一个叉子。upstream指向https://github.com/spacetelescope/pysiafspacetelescope pysiaf上打开一个问题,该问题描述了您计划进行的更改的需求和性质。对于微小的更改和修复,这不是必需的。origin 。spacetelescope pysiaf存储库上,创建一个拉动请求,将分支合并为spacetelescope:master 。该软件包在Python 3.10+中支持
pip install pysiaf
克隆存储库:
git clone https://github.com/spacetelescope/pysiaf
安装pysiaf:
cd pysiaf
pip install .
在开发模式pip install -e .
如果您有错误import pysiaf
这追溯到import lxml.etree as ET
和国家ImportError [...] Library not loaded: libxml2.2.dylib Reason: Incompatible library version: etree.[...] requires version 12.0.0 or later, but libxml2.2.dylib provides version 10.0.0 ,
可以通过降级LXML的版本来解决这,例如pip uninstall lxml
pip install lxml==3.6.4
PYQT5安装问题:如果使用Macos Mojave,则会导致Matplotlib在没有PYQT5的情况下失败。请采取适当的措施,以确保安装了Pyqt5