0

我有一个从 .tsv 文件中获取数据而不是转换为列表的代码。在 for 循环中,使用 astroquery 从该数据中查询这些值并显示为表格。所以我想把输出放在一个新的列表中。

这是我的代码:

from astroquery.simbad import Simbad
import astropy.coordinates as coord
from astropy import units as u
from astropy.coordinates import SkyCoord
import pandas as pd
import astropy.units as u
from astropy import coordinates

column_names = ["#paper", "Object", "RA","Ra2","DEC","Dec2"]
data=pd.read_csv("jwebb.tsv", sep = '\t', names=column_names)

STARS=data.Object.to_list()
RA=data.RA.to_list()
DEC=data.DEC.to_list()
"""RA2=
DEC2="""
POS = [i+' '+k for i, k in zip(RA,DEC)]



customSimbad = Simbad()
customSimbad.add_votable_fields('flux(V)','flux(U)','flux(B)','flux(R)','flux(I)','flux(J)','flux(H)','flux(K)','flux(u)','flux(g)','flux(r)','flux(i)','flux(z)')
customSimbad.get_votable_fields()

for i in range(len(RA)):
    for i in range(len(DEC)):
        result_table = customSimbad.query_region(coord.SkyCoord(ra=RA[i], dec=DEC[i], unit=(u.hourangle, u.deg)), radius='0.001s')
        print(result_table)
```

I want to create a new list and add the specific values at the table. Like, names=(result_table[0][i])
4

0 回答 0