天文学 RA 和 DEC 到笛卡尔坐标,然后在 2D 图像 FOV 中绘制

Astronomy RA and DEC to cartesian coordinates then plot in a 2D image FOV

我想创建一个模拟相机拍摄的人造图像 https://www.theimagingsource.com/products/industrial-cameras/usb-2.0-monochrome/dmk41bu02h/ and the lens https://en.ids-imaging.com/store/lens-ricoh-fl-hc1214-2m-12-mm-1-2.html

所以我的问题是:从 Hipparcos 星表 (https://cdsarc.u-strasbg.fr/viz-bin/ReadMe/I/239?format=html&tex=true) 获得星数据,我可以在其中获得 RA 和 DEC,我想计算其对应的笛卡尔坐标,然后以某种方式转换此 [x, y,z] 坐标到 [x,y] 所以我可以在图像中绘制它。

当然,观察者的位置应该在地球上,就像我用相机拍照一样。

我使用 python 作为编码语言并使用 opencv 创建图像,但任何其他语言 and/or 库都有效。

谢谢。

我能够像这样将 hip_main.dat 目录加载到 Table 中:

>>> from astropy.table import Table
>>> t = Table.read('hip_main.dat', format='cds', readme='http://cdsarc.u-strasbg.fr/ftp/cats/aliases/H/Hipparcos/ReadMe')

(您应该也可以将 URL 作为文件名,但出于某种原因,这对我不起作用,但如果我手动将文件下载到我的本地目录,它确实有效首先——问题似乎是服务器上的原始文件被 gzip 压缩,并且 CDS reader 被文件名中的 .gz 弄糊涂了。这将是一件很好且容易修复的事情天体。)

它有 hms/dms 坐标和度数。学位的解析速度更快,所以我从中制作了 SkyCoord。它会自动检测格式以度为单位:

>>> coords = SkyCoord(ra=t['RAdeg'], dec=t['DEdeg'])                                                                                                                               
>>> coords                                                                                                                                                                         
<SkyCoord (ICRS): (ra, dec) in deg
    [(9.11850000e-04,   1.08901332), (3.79737000e-03, -19.49883745),
     (5.00795000e-03,  38.85928608), ..., (3.59976057e+02,   5.95663786),
     (3.59978239e+02, -64.3725722 ), (3.59978792e+02, -65.57707774)]>

它还能从自述文件中正确检测到 ICRS J1991.25。

你可以获得一个 Earth-bound 观察者位置,例如:

>>> from astropy.coordinates import EarthLocation                                                                                                                                  
>>> location = EarthLocation.of_site('greenwich')                                                                                                                                  
>>> location                                                                                                                                                                       
<EarthLocation (3980608.90246817, -102.47522911, 4966861.27310068) m>

(我只是在这里使用已知位置,但您可以将坐标放在地球上的任何地方)。

然后,如果您愿意,可以创建一个本地 alt/az 框架,例如:

>>> from astropy.time import Time
>>> from astropy.coordinates import AltAz                                                                                                                                          
>>> local_frame = AltAz(location=location, obstime=Time.now())                                                                                                                     
>>> local_frame                                                                                                                                                                    
<AltAz Frame (obstime=2020-08-14 12:39:58.682416, location=(3980608.90246817, -102.47522911, 4966861.27310068) m, pressure=0.0 hPa, temperature=0.0 deg_C, relative_humidity=0.0, obswl=1.0 micron)>

Then transform your original ICRS coordinates to this new frame:

```python
>>> local_coords = coords.transform_to(local_frame)                                                                                                                                
>>> local_coords                                                                                                                                                                   
<SkyCoord (AltAz: obstime=2020-08-14 12:39:58.682416, location=(3980608.90246817, -102.47522911, 4966861.27310068) m, pressure=0.0 hPa, temperature=0.0 deg_C, relative_humidity=0.0, obswl=1.0 micron): (az, alt) in deg
    [(327.54653574, -32.6138386 ), (316.63406529, -51.59917121),
     (339.37842396,   3.4498418 ), ..., (329.41414414, -28.02088907),
     (217.27653631, -71.09315213), (214.14690597, -70.46865069)]>

您也可以使用 local_coords.cartesian 将其转换为笛卡尔坐标。

不幸的是,为了图像模拟的目的,将这些投影到天空的某些 FoV 上,这有点超出我的能力范围。我可能会弄明白,但可能其他人会更容易知道如何做到这一点。但至少现在你已经掌握了等式的一部分(如果我正确理解你的问题)。