Aez*_*zys 3 python coordinates
我有一些来自 ISS(国际空间站)的坐标,我想知道记录坐标时 ISS 是在陆地还是海洋上空,我应该离线执行此操作,但我不确定使用什么方法。来自 python 标准库的一部分,我仅限于使用这些库:
numpy
scipy
tensorflow
pandas
opencv-python
opencv-contrib-python
evdev
matplotlib
logzero
pyephem
scikit-image
scikit-learn
reverse-geocoder
Run Code Online (Sandbox Code Playgroud)
如果您知道如何使用其他一些库来做到这一点,那么无论如何都会很好。
使用此代码,我获取坐标并将其写入文件:
import logging
import logzero
from logzero import logger
import os
import ephem
import time
dir_path = os.path.dirname(os.path.realpath(__file__))
logzero.logfile(dir_path+"/coordinates.csv")
# Set a custom formatter
formatter = logging.Formatter('%(name)s - %(asctime)-15s - %(levelname)s: %(message)s');
logzero.formatter(formatter)
name = "ISS (ZARYA)"
line1 = "1 25544U 98067A 18282.18499736 .00001222 00000-0 25998-4 0 9992"
line2 = "2 25544 51.6418 170.6260 0003545 261.4423 234.4561 15.53790940136242"
iss = ephem.readtle(name, line1, line2)
iss.compute()
latitude = iss.sublat
longitude = iss.sublong
# Save the data to the file
logger.info("%s,%s", latitude, longitude )
Run Code Online (Sandbox Code Playgroud)
你们有什么想法吗?提前致谢。
Xav*_*tte 11
global-land-mask来自 Karin Todd 的方法非常易于使用且高效:
from global_land_mask import globe\nprint(globe.is_land(49.22, -2.23))\n# \xe2\x86\x92 True\nprint(globe.is_land(49.22, -2.25))\n# \xe2\x86\x92 False\nRun Code Online (Sandbox Code Playgroud)\n它可以通过 获得pip,并且它唯一的依赖项是numpy.