以下示例代码:
#!/usr/bin/python3
from astropy.time import Time
from astropy.coordinates import solar_system_ephemeris, EarthLocation, get_body
print('Content-Type:text/html;charset=utf-8\n')
t = Time("2014-09-22 23:22")
loc = EarthLocation.of_site('greenwich')
with solar_system_ephemeris.set('builtin'):
jup = get_body('jupiter', t, loc)
print('<h2>',jup.ra.deg,'</h2>')
当脚本在本地运行时工作正常(=136.9111620895066)。但是如果我尝试从服务器执行它,就会出现“504网关超时”Nginx错误。你知道吗
也许astropy保存星历表数据的文件有问题?其他astropy、matplotlib等脚本可以在服务器上正常工作。每次脚本需要星历表flles(jpl,esa…)时都会出现错误。你知道吗
确保您有最新的astropy错误修复版本(v3.2.3,http://docs.astropy.org/en/latest/changelog.html#id153),因为它修复了IERS URL的一个问题,我很可能是您“504网关超时”错误的原因。你知道吗
相关问题 更多 >
编程相关推荐