Skip to content

Commit

Permalink
Merge pull request #27 from stleary/visible-planets
Browse files Browse the repository at this point in the history
Visible planets
  • Loading branch information
stleary authored Jan 22, 2017
2 parents 3ff6184 + c53fad8 commit e8f8b27
Show file tree
Hide file tree
Showing 41 changed files with 620 additions and 82 deletions.
Binary file added assets/screenshot-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/screenshot-1.png
Binary file not shown.
Binary file added assets/screenshot-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/screenshot-3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/screenshot-4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions css/stars-at-night.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ table.ngc2244_stars_at_night_standardTable {
text-align:center;
}

/* keep images aligned with however many rows are displayed */
.ngc2244_stars_at_night_standardTable tbody td {
vertical-align:middle;
}

/* table row alternating background colors */
.ngc2244_stars_at_night_standardTable tbody tr:nth-child(odd) {color: black; background-color: white;}
Expand Down
Binary file added images/Moon-1-large.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Moon-10-large.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Moon-11-large.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Moon-12-large.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Moon-13-large.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Moon-14-large.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Moon-15-large.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Moon-16-large.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Moon-17-large.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Moon-18-large.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Moon-19-large.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Moon-2-large.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Moon-20-large.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Moon-21-large.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Moon-22-large.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Moon-23-large.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Moon-24-large.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Moon-25-large.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Moon-26-large.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Moon-3-large.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Moon-4-large.jpg
Binary file added images/Moon-5-large.jpg
Binary file added images/Moon-6-large.jpg
Binary file added images/Moon-7-large.jpg
Binary file added images/Moon-8-large.jpg
Binary file added images/Moon-9-large.jpg
42 changes: 30 additions & 12 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: N/A
Tags: astronomy
Requires at least: 4.6
Tested up to: 4.7
Stable tag: 1.3
Stable tag: 1.4
License: MIT
License URI: https://opensource.org/licenses/MIT

Expand All @@ -16,30 +16,36 @@ This plugin displays data of interest to amateur astronomers. It is calculated f
The plugin is called from a WordPress shortcode, and the parameters are specified in the shortcode. The following parameters are
required, in any order:

* **name** : The name of the location to be calculated
* **lat** : Lattitude of location in fractional degrees (e.g. 30.8910). Positive is north, negative is south of equator
* **long** : Longitude of location in fractional degrees (e.g.-98.4265). Positive is east, negative is west of the UTC line
* **timezone** : Timezone name, must be value recognized by PHP. See [http://php.net/manual/en/timezones.php]

These parameters are optional:

* **name** : The name of the location to be calculated
* **days** : The number of days of data to display. Must be a value from 1 to 10. Defaults to 3 if not specified.

**Shortcode Examples:**

* stars-at-night name=Chennai lat=13.08 long=80.26 timezone=Asia/Kolkata days=1
* stars-at-night name="COE Observing Field" lat=30.891 long=-97.4265 timezone=America/Chicago
* stars-at-night name="COE Observing Field" lat=30.891 long=-97.4265 timezone=America/Chicago days=10

The output consists of simple HTML tables:

* Sun/Moon table: The times for sunrise, sunset, moonrise, moonset, morning astronomical twilight, and evening astronomical twilight for the specified days.
* ISS table: The times and directions for visible ISS passes over the specified days.
* Iridium flares table: The times and directions for visible Iridium flares over the specified days.
* Sun/Moon table: The times for sunrise, sunset, moonrise, moonset, morning astronomical twilight, and evening astronomical twilight for the specified days (max 10 days).
* Planets table: The times and visibility for the planets, for the current day.
* ISS table: The times and directions for visible ISS passes over the specified days (max 10 days).
* Iridium flares table: The times and directions for visible Iridium flares over the specified days (max 7 days).

You can view the plugin in action here: [http://notforlong.org/stars-at-night](http://notforlong.org/stars-at-night)

**Credits and Acknowledgements:**

* Lunar images by Dan Morgan (dan@danmorgan.org). Used with permission. http://DanMorgan.org.
* Lunar images by [Dan Morgan](mailto://Dan@danmorgan.org). Used with permission. [http://DanMorgan.org](http://DanMorgan.org).
* WordPress framework and sunrise/sunset algorithm: https://github.com/bengreeley/sunrisesunset
* Moonrise and Moonset class (with a correction for timezone): http://dxprog.com/entry/calculate-moon-rise-and-set-in-php
* Moon phase class: https://github.com/solarissmoke/php-moon-phase
* ISS and Iridium Flare tables are obtained by sending GET requests to: http://heavens-above.com (HTTP API used with permission)
* Planetary, ISS and Iridium Flare tables are obtained by sending GET requests to: http://heavens-above.com (HTTP API used with permission)

== Installation ==

Expand All @@ -65,19 +71,31 @@ Search for 'zenith' in class-stars-at-night-manager.php for more information.

This plugin is driven by user requests. Just ask.

= Where did you get the satellite data? =
The ISS and Iridium flare data is obtained by parsing the response to a GET request to http://www.heavens-above.com.
= Where did you get the planet and satellite data? =
The Planet, ISS, and Iridium flare data is obtained by parsing the response to a GET request to http://www.heavens-above.com.

= Can you provide more astronomical data, like what planets are visible, etc? =
= Can you provide more astronomical data and images? =

More is coming. Stay tuned! If you have a specific request, let us know.

== Screenshots ==

1. Sample tables generated for a specified location and time
1. Sunrise and sunset table
2. Planet table
3. ISS passes table
4. Iridium flares table

== Changelog ==

= 1.4 =

* Add planet table
* More consistent look for table titles
* Clarify required vs optional params in readme
* Fixed potential Lunar image alignment
* Include larger Lunar clickable images
* Fixed satellite de-caching for fewer server hits

= 1.3 =

* Add Lunar images to Sun/Moon table. 1 image per 3 rows.
Expand Down
7 changes: 7 additions & 0 deletions src/class-iridium-data.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,11 @@ class NGC2244_Iridium_Data {
public $altitude;
public $azimuth;
public $satellite;
// required for debugging
public function toString() {
$str = "NGC2244_Iridium_DATA:" . "\n date: " . $this->date . "\n time: " . $this->time .
"\n magnitude: " . $this->magnitude . "\n altitude: " . $this->altitude .
"\n azimuth: " . $this->azimuth . "\n satellite: " . $this->satellite . "\n";
return $str;
}
}
10 changes: 10 additions & 0 deletions src/class-iss-data.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,14 @@ class NGC2244_ISS_Data {
public $endTime;
public $endAltitude;
public $endAzimuth;
// required for debugging
public function toString() {
$str = "NGC2244_ISS_DATA:" . "\n date: " . $this->date . "\n magnitude:" .
$this->magnitude . "\n startTime: " . $this->startTime . "\n startAltitude: " .
$this->startAltitude . "\n startAzimuth: " . $this->startAzimuth . "\n highTime: " .
$this->highTime . "\n highAltitude: " . $this->highAltitude . "\n highAzimuth: " .
$this->highAzimuth . "\n endTime: " . $this->endTime . "\n endAltitude: " .
$this->endAltitude . "\n endAzimuth: " . $this->endAzimuth . "\n";
return $str;
}
}
1 change: 0 additions & 1 deletion src/class-moon-phase.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
* by Samir Shah (http://rayofsolaris.net)
* License: MIT
**/
namespace Solaris;

class NGC2244_Moon_Phase {
private $timestamp;
Expand Down
48 changes: 48 additions & 0 deletions src/class-planet-data.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php
/*
* MIT License
*
* Copyright (c) 2016 Sean Leary
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

// Disallow direct access
defined ( 'ABSPATH' ) or die ();

/**
* This struct-like class represents ISS satellite cached data, as received from heavens-above.com.
*/
class NGC2244_Planet_Data {
public $date; // date only matter on the first record
public $name;
public $rise;
public $set;
public $meridian;
public $constellation;
public $visibility;
// required for debugging
public function toString() {
$str = "NGC2244_PLANET_DATA:" . "\n date: " . $this->date . "\n name: " . $this->name .
"\n rise:" . $this->rise . "\n set: " . $this->set . "\n meridian: " .
$this->meridian . "\n constellation: " . $this->constellation .
"\n visibility: " . $this->visibility . "\n";
return $str;
}
}
Loading

0 comments on commit e8f8b27

Please sign in to comment.