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


Python Position.altAzToRaDec方法代码示例

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


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

示例1: _moveScope

# 需要导入模块: from chimera.util.position import Position [as 别名]
# 或者: from chimera.util.position.Position import altAzToRaDec [as 别名]
    def _moveScope(self, tracking=False, pierSide=None):
        """
        Moves the scope, usually to zenith
        """
        tel = self._getTel()
        site = self._getSite()
        self.log.debug('Moving scope to alt %s az %s.' % (self["flat_alt"], self["flat_az"]))
        if tel.getPositionAltAz().angsep(
                Position.fromAltAz(Coord.fromD(self["flat_alt"]), Coord.fromD(self["flat_az"]))).D < self[
            "flat_position_max"]:

            self.log.debug(
                'Telescope is less than {} degrees from flat position. Not moving!'.format(self["flat_position_max"]))
            if tracking and not tel.isTracking():
                tel.startTracking()
            elif not tracking and tel.isTracking():
                tel.stopTracking()
            if pierSide is not None and tel.features(TelescopePier):
                self.log.debug("Setting telescope pier side to %s." % tel.getPierSide().__str__().lower())
                tel.setSideOfPier(self['pier_side'])

            return

        try:
            self.log.debug("Skyflat Slewing scope to alt {} az {}".format(self["flat_alt"], self["flat_az"]))
            tel.slewToRaDec(Position.altAzToRaDec(Position.fromAltAz(Coord.fromD(self["flat_alt"]),
                                                                     Coord.fromD(self["flat_az"])),
                                                  site['latitude'], site.LST()))
            if tracking:
                self._startTracking()
            else:
                self._stopTracking()
        except:
            self.log.debug("Error moving the telescope")
开发者ID:astroufsc,项目名称:chimera-skyflat,代码行数:36,代码来源:autoskyflat.py

示例2: test_altAzRaDec

# 需要导入模块: from chimera.util.position import Position [as 别名]
# 或者: from chimera.util.position.Position import altAzToRaDec [as 别名]
 def test_altAzRaDec(self):
     
     altAz = Position.fromAltAz('20:30:40', '222:11:00')
     lat = Coord.fromD(0)
     o = ephem.Observer()
     o.lat = '0:0:0'
     o.long = '0:0:0'
     o.date = dt.now(tz.tzutc())
     lst = float(o.sidereal_time())
     raDec = Position.altAzToRaDec(altAz, lat, lst)
     
     altAz2 = Position.raDecToAltAz(raDec, lat, lst)
     assert equal(altAz.alt.toR(),altAz2.alt.toR()) & equal(altAz.az.toR(),altAz2.az.toR())
开发者ID:agati,项目名称:chimera,代码行数:15,代码来源:test_position.py

示例3: altAzToRaDec

# 需要导入模块: from chimera.util.position import Position [as 别名]
# 或者: from chimera.util.position.Position import altAzToRaDec [as 别名]
    def altAzToRaDec(self, altAz,lst_inRads=None):
        if not lst_inRads:
			lst_inRads = self.LST_inRads()

        return Position.altAzToRaDec(altAz, self['latitude'], lst_inRads)
开发者ID:agati,项目名称:chimera,代码行数:7,代码来源:site.py

示例4: altAzToRaDec

# 需要导入模块: from chimera.util.position import Position [as 别名]
# 或者: from chimera.util.position.Position import altAzToRaDec [as 别名]
 def altAzToRaDec(self, altAz):
     return Position.altAzToRaDec(altAz, self['latitude'], self.LST_inRads())    
开发者ID:hungrh,项目名称:chimera,代码行数:4,代码来源:site.py

示例5: N

# 需要导入模块: from chimera.util.position import Position [as 别名]
# 或者: from chimera.util.position.Position import altAzToRaDec [as 别名]
        # Azimuth is N (0), E (90), S (180), W (270) in both hemispheres
        # However x and y are different in the hemispheres so we fix that here

        zeta = atan2(x, y)
        if (zeta > - 2. * pi) and (zeta < 2. * pi):
            if self.site_latitude.R <= 0.:
                zeta += pi
        else:
            zeta = telaz

        if zeta < 0:
            zeta = zeta + 2 * pi
        elif zeta > 2 * pi:
            zeta - 2 * pi

        return zeta * 180 / pi


if __name__ == '__main__':
    import numpy as np

    dome_radius, mount_dec_height, mount_dec_length, mount_dec_offset = 147, 0, 49.2, 0
    site = Site()
    Model = AzimuthModel(site['latitude'], dome_radius, mount_dec_height, mount_dec_length, mount_dec_offset)
    # for dra in np.arange(10, 200, 36):
    #     for ddec in np.arange(1, 360, 10):
    for az, alt in [(ii, jj) for ii in np.arange(5, 360, 10) for jj in np.arange(25, 90, 20)]:
        tel_pos = Position.altAzToRaDec(Position.fromAltAz(Coord.fromD(alt), Coord.fromD(az)), site['latitude'], site.LST())
        model = Model.solve_dome_azimuth(tel_pos, site.LST_inRads())
        print 'here', alt, az, model, model - az
开发者ID:astroufsc,项目名称:chimera-domesync,代码行数:32,代码来源:dome_track.py

示例6: slewToAltAz

# 需要导入模块: from chimera.util.position import Position [as 别名]
# 或者: from chimera.util.position.Position import altAzToRaDec [as 别名]
 def slewToAltAz(self, position):
     site = self._getSite()
     if self.slewToRaDec(Position.altAzToRaDec(position, site['latitude'], site.LST()).toEpoch(Epoch.NOW)):
         self.stopTracking()
         return True
     return False
开发者ID:astroufsc,项目名称:chimera-bisque,代码行数:8,代码来源:theskytelescope.py


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