当前位置: 首页>>代码示例>>Python>>正文


Python EarthLocation.get_site_names方法代码示例

本文整理汇总了Python中astropy.coordinates.EarthLocation.get_site_names方法的典型用法代码示例。如果您正苦于以下问题:Python EarthLocation.get_site_names方法的具体用法?Python EarthLocation.get_site_names怎么用?Python EarthLocation.get_site_names使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在astropy.coordinates.EarthLocation的用法示例。


在下文中一共展示了EarthLocation.get_site_names方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: init_units

# 需要导入模块: from astropy.coordinates import EarthLocation [as 别名]
# 或者: from astropy.coordinates.EarthLocation import get_site_names [as 别名]
 def init_units(self, num_units):
     """Initialize a network of new units and their cameras, assigning unique IDs."""
     units = []
     for i in range(num_units):
         unit = "PAN{:03d}".format(i)
         site = random.choice(EarthLocation.get_site_names())
         self.unit_dict[unit] = site
         self.init_cameras(unit)
         units.append(unit)
     return units
开发者ID:joshwalawender,项目名称:PIAA,代码行数:12,代码来源:generate_data_network.py

示例2: test_EarthLocation_basic

# 需要导入模块: from astropy.coordinates import EarthLocation [as 别名]
# 或者: from astropy.coordinates.EarthLocation import get_site_names [as 别名]
def test_EarthLocation_basic():
    greenwichel = EarthLocation.of_site('greenwich')
    lon, lat, el = greenwichel.to_geodetic()
    assert_quantity_allclose(lon, Longitude('0:0:0', unit=u.deg),
                             atol=10*u.arcsec)
    assert_quantity_allclose(lat, Latitude('51:28:40', unit=u.deg),
                             atol=1*u.arcsec)
    assert_quantity_allclose(el, 46*u.m, atol=1*u.m)

    names = EarthLocation.get_site_names()
    assert 'greenwich' in names
    assert 'example_site' in names

    with pytest.raises(KeyError) as exc:
        EarthLocation.of_site('nonexistent site')
    assert exc.value.args[0] == "Site 'nonexistent site' not in database. Use EarthLocation.get_site_names to see available sites."
开发者ID:Cadair,项目名称:astropy,代码行数:18,代码来源:test_sites.py

示例3: get_current_network

# 需要导入模块: from astropy.coordinates import EarthLocation [as 别名]
# 或者: from astropy.coordinates.EarthLocation import get_site_names [as 别名]
 def get_current_network(self):
     """Get the units and their cameras that currently have simulated data on the cloud."""
     units = []
     files = self.storage.list_remote(prefix='LC')
     for fl in files:
         dirs = fl.split('/')
         for i in range(len(dirs)):
             dir = dirs[i]
             if dir.startswith('PAN'):
                 unit = dir
                 if unit not in units:
                     units.append(unit)
                     site = random.choice(EarthLocation.get_site_names())
                     self.unit_dict[unit] = site
                 cam = dirs[i + 1]
                 if cam not in self.cameras[unit]:
                     self.cameras[unit].append(cam)
                 break
     return units
开发者ID:joshwalawender,项目名称:PIAA,代码行数:21,代码来源:generate_data_network.py

示例4: demo_site_chooser

# 需要导入模块: from astropy.coordinates import EarthLocation [as 别名]
# 或者: from astropy.coordinates.EarthLocation import get_site_names [as 别名]
def demo_site_chooser() :
    EarthLocation.get_site_names()  # Print names of all sites astropy knows about. May need internet connection
    keck = EarthLocation.of_site('keck')  
    lco  = EarthLocation.of_site('Las Campanas Observatory') 
    return(0)
开发者ID:janerigby,项目名称:jrr,代码行数:7,代码来源:barycen.py


注:本文中的astropy.coordinates.EarthLocation.get_site_names方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。