コード例 #1
0
ファイル: night.py プロジェクト: neXyon/pynephoscope
		self.alt = alt[0]

		return self.alt
		
	def isNight(self):
		return self.alt < Configuration.night_angle

	def isDay(self):
		return self.alt > Configuration.day_angle

	def __str__(self):
		if self.isNight():
			return "Night"
		elif self.isDay():
			return "Day"
		else:
			return "Twilight"

if __name__ == '__main__':
	checker = NightChecker()

	if len(sys.argv) > 1:
		files = SkyCameraFile.glob(sys.argv[1])

		for f in files:
			time = SkyCameraFile.parseTime(f)
			checker.setTime(time)
			print(f, checker)
	else:
		print(checker)
コード例 #2
0
ファイル: sky.py プロジェクト: wanghai1988/pynephoscope
        cv2.circle(image, pos, radius, color)


if __name__ == '__main__':
    import sys
    window = 'Stars'
    size = 1024

    location = EarthLocation(lat=Configuration.latitude,
                             lon=Configuration.longitude,
                             height=Configuration.elevation)
    time = Time.now()

    if len(sys.argv) >= 2:
        try:
            time = SkyCameraFile.parseTime(sys.argv[1])
        except:
            pass

    catalog = SkyCatalog()
    catalog.setLocation(location)
    catalog.setTime(time)
    catalog.calculate()

    renderer = SkyRenderer(size)
    image = renderer.renderCatalog(catalog, 5)

    cv2.namedWindow(window, cv2.WINDOW_AUTOSIZE)
    cv2.imshow(window, image)
    cv2.waitKey(0)
    cv2.destroyAllWindows()
コード例 #3
0
ファイル: sky.py プロジェクト: wschoenell/pynephoscope
		
		pos = (int(pos[0]), int(pos[1]))
		
		cv2.circle(image, pos, radius, color)

if __name__ == '__main__':
	import sys
	window = 'Stars'
	size = 768

	location = EarthLocation(lat=Configuration.latitude, lon=Configuration.longitude, height=Configuration.elevation)
	time = Time.now()

	if len(sys.argv) >= 2:
		try:
			time = SkyCameraFile.parseTime(sys.argv[1])
		except:
			pass

	catalog = SkyCatalog()
	catalog.setLocation(location)
	catalog.setTime(time)
	catalog.calculate()

	renderer = SkyRenderer(size)
	image = renderer.renderCatalog(catalog, 5)

	cv2.namedWindow(window, cv2.WINDOW_AUTOSIZE)
	cv2.imshow(window, image)
	cv2.waitKey(0)
	cv2.destroyAllWindows()
コード例 #4
0
ファイル: moon.py プロジェクト: wanghai1988/pynephoscope
    def setTime(self, time):
        self.catalog.setTime(time)
        _, _, alt, _ = self.catalog.calculate()

        self.alt = alt[0]

        return self.alt

    def isUp(self):
        return self.alt > Configuration.moon_up_angle

    def __str__(self):
        if self.isUp():
            return "Up"
        else:
            return "Down"


if __name__ == '__main__':
    checker = MoonChecker()

    if len(sys.argv) > 1:
        files = SkyCameraFile.glob(sys.argv[1])

        for f in files:
            time = SkyCameraFile.parseTime(f)
            checker.setTime(time)
            print(f, checker)
    else:
        print(checker)
コード例 #5
0
	def selectImage(self, filename):
		time = SkyCameraFile.parseTime(filename)
		self.catalog.setTime(time)
		self.catalog.calculate()
コード例 #6
0
 def selectImage(self, filename):
     time = SkyCameraFile.parseTime(filename)
     self.catalog.setTime(time)
     self.catalog.calculate()