GithubHelp home page GithubHelp logo

allenerocha / pysky Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 2.0 1.56 GB

Python application to retrieve the information of celestial objects in a given date-time range

License: GNU Affero General Public License v3.0

Python 100.00%
astronomy astropy astroplan python3 python3-6 agplv3 agpl-v3 command-line python

pysky's Introduction

Pysky

AstroPy Travis (.org) Code style: black Codecov https://img.shields.io/badge/license-AGPLv3-green:alt:License:AGPLv3 GitHub last commit

Download & Installation

Initial setup

Download and install latest version of Python here.

Follow these instructions to get the latest version of pip.

~$ git clone https://github.com/allenerocha/pysky.git && cd pysky/
pysky/$ pip install .

Uninstalling

~$ pip uninstall pysky -y

Usage

~$ pysky -sd [start date] -st [start time] -ed [end date] -et [end time] -t [thread count] -v [verbosity level]

Command line options

Options (Dates and times are in ISO 8601 format)

-sd/--startdate Starting date. [1]
-st/--starttime Starting time. [1]
-ed/--enddate Ending date. [2]
-et/--endtime Ending time. [2]
-t/--threads Number of threads to use. [2]
-v/--verbosity Verbosity level. [2]
-h/--help Display help for the CL options.
[1](1, 2) Required.
[2](1, 2, 3, 4) Optional.

Date format (YEAR-MONTH-DAY)

YEAR 4 digit format
MONTH 2 digit format
DAY 2 digit format

Time format (HOUR:MINUTE)

HOUR 24 hour format (0-23)
MINUTE Minute in regular format (0-59)

Specifying no end date and time defaults the search to only go for one hour long.

Help

~$ pysky -h
~$ pysky --help

Images

Default

By default images of valid objects will be saved in the filename format:

$HOME/PySkySlideshow/object-width-height-resolution-scaling.png

User Defined

To change the location of the saved images, you can add the following line to the user_prefs.cfg file:

slideshow_dir=

Followed by the directory to save in. The folder PySkySlideshow will be created in the specified directory.

Examples

slideshow_dir=/home/allen

This will set the directory to save the images as:

slideshow_dir=/home/allen/PySkySlideshow/

Usage

Start July 10th, 2012 17:00 End July 10th, 2012 23:00

$ pysky -sd 2012-07-10 -st 17:00 -ed 2012-07-10 -et 23:00

Start December 31st, 2015 08:00 End January 1st, 2016 02:00 with high verbosity

$ pysky -sd 2015-12-31 -st 08:00 -ed 2016-01-01 -et 02:00 -v 5

Start September 1st, 2019 19:00 for one hour with 2 threads and medium verbosity

$ pysky -sd 2019-09-01 -st 17:00 -t 2 -v 3

Supported Python Versions

Python 3.6+

pysky's People

Contributors

allenerocha avatar dependabot[bot] avatar gendine avatar williamdparker avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

kreipe mconsidine

pysky's Issues

Identify error produced by test case in revision ee93f030:

2020-11-30 20:36:22,113 [INFO] Retrieving data for tonight's moon...
Traceback (most recent call last):
File "C:\Users\William\PycharmProjects\pysky\venv\Scripts\pysky-script.py", line 33, in
sys.exit(load_entry_point('pysky==0.9.9', 'console_scripts', 'pysky')())
File "c:\users\william\pycharmprojects\pysky\venv\lib\site-packages\pysky_main_.py", line 13, in main
invoke()
File "c:\users\william\pycharmprojects\pysky\venv\lib\site-packages\pysky\core.py", line 47, in invoke
gen_moon_data()
File "c:\users\william\pycharmprojects\pysky\venv\lib\site-packages\pysky\core.py", line 477, in gen_moon_data
illumination, phase = query()
File "c:\users\william\pycharmprojects\pysky\venv\lib\site-packages\pysky\moonquery.py", line 28, in query
for item in data["2"]:
TypeError: list indices must be integers or slices, not str

Lunar Horizontal Coordinates Incorrect

Describe the bug
Lunar horizontal coordinates (alt., az.) are incorrect in the output table

To Reproduce
user_prefs.cfg
latitude=-87.8791
longitude= 42.6499
elevation=0.204

pysky -sd 2020-12-21 -st 22:00 -ed 2020-12-21 -et 23:00
open ~/PySkySlideshow/pysky-report-2020-12-21.html

Expected behavior
Moon altitude is 35° - 40° and azimuth 144 - 160° during this time from this location

Screenshots
Screen Shot 2020-12-17 at 2 40 30 PM

Desktop (please complete the following information):
macOS 10.13.6

Windows OS file paths raise OSError

Describe the bug
The file paths in the application must be updated to use Python 3’s pathlib module to support Linux, MacOS, and Windows

To Reproduce
Steps to reproduce the behavior:

  1. pysky -sd 2020-01-01 -st 21:00 -t 4 -v 5
  2. log.txt

Expected behavior
Should read any project files without raising an OSError

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 10
  • Version 0.9.9

TypeError in image_manipulation for Moon

Describe the bug
Code exits with the following traceback:
File "C:\Users\William\PycharmProjects\pysky\venv\Scripts\pysky-script.py", line 11, in
load_entry_point('pysky==0.9.9', 'console_scripts', 'pysky')()
File "c:\users\william\pycharmprojects\pysky\venv\lib\site-packages\pysky_main_.py", line 14, in main
invoke()
File "c:\users\william\pycharmprojects\pysky\venv\lib\site-packages\pysky\core.py", line 422, in invoke
overlay_text("Moon", v_obj)
File "c:\users\william\pycharmprojects\pysky\venv\lib\site-packages\pysky\image_manipulation.py", line 120, in overlay_text
img = add_text(img, overlay_txt)
File "c:\users\william\pycharmprojects\pysky\venv\lib\site-packages\pysky\image_manipulation.py", line 225, in add_text
text="\n".join(overlay_text), # concats all strings in the list
TypeError: can only join an iterable

To Reproduce
Steps to reproduce the behavior:
pysky -sd 2020-12-21 -st 22:00 -ed 2020-12-22 -et 00:00 -t 1

Expected behavior
Code completes without error. Moon image overlaid produced.

Screenshots
N/A

Desktop (please complete the following information):

  • OS: Windows 10 Pro
  • Version 19041.804
  • Python 3.8.5

Additional context
N/A

When parsing webpages for celestial objects, it returns 'NoneType'

Errors:

Object: capella

2020-04-19 15:40:59,433 [CRITICAL] Error trying to parse the web page of capella!

'NoneType' object has no attribute 'find'

2020-04-19 15:40:59,433 [CRITICAL] Error trying to parse the web page of capella! Removing from queue...

Object: sirius

2020-04-19 15:40:58,113 [CRITICAL] Error trying to parse the web page of sirius!

'NoneType' object has no attribute 'find'

2020-04-19 15:40:58,114 [CRITICAL] Error trying to parse the web page of sirius! Removing from queue...

Example of user_prefs.cfg format?

Hi,
I'd like to run this for a specific lat/lon combination. Could you provide an example of a user_prefs.cfg file that shows how different fields could be provided? I have tried to do this with lat= , lon= and ele= but it seems that's the wrong format.
Thank you!
mconsidine

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.