Skip to content

Commit e8f8b27

Browse files
authored
Merge pull request #27 from stleary/visible-planets
Visible planets
2 parents 3ff6184 + c53fad8 commit e8f8b27

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+620
-82
lines changed

assets/screenshot-1.jpg

51 KB
Loading

assets/screenshot-1.png

-14.1 KB
Binary file not shown.

assets/screenshot-2.jpg

44 KB
Loading

assets/screenshot-3.jpg

55 KB
Loading

assets/screenshot-4.jpg

54.9 KB
Loading

css/stars-at-night.css

+4
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ table.ngc2244_stars_at_night_standardTable {
4848
text-align:center;
4949
}
5050

51+
/* keep images aligned with however many rows are displayed */
52+
.ngc2244_stars_at_night_standardTable tbody td {
53+
vertical-align:middle;
54+
}
5155

5256
/* table row alternating background colors */
5357
.ngc2244_stars_at_night_standardTable tbody tr:nth-child(odd) {color: black; background-color: white;}

images/Moon-1-large.jpg

189 KB
Loading

images/Moon-10-large.jpg

356 KB
Loading

images/Moon-11-large.jpg

381 KB
Loading

images/Moon-12-large.jpg

424 KB
Loading

images/Moon-13-large.jpg

437 KB
Loading

images/Moon-14-large.jpg

438 KB
Loading

images/Moon-15-large.jpg

406 KB
Loading

images/Moon-16-large.jpg

368 KB
Loading

images/Moon-17-large.jpg

376 KB
Loading

images/Moon-18-large.jpg

333 KB
Loading

images/Moon-19-large.jpg

284 KB
Loading

images/Moon-2-large.jpg

201 KB
Loading

images/Moon-20-large.jpg

257 KB
Loading

images/Moon-21-large.jpg

261 KB
Loading

images/Moon-22-large.jpg

244 KB
Loading

images/Moon-23-large.jpg

222 KB
Loading

images/Moon-24-large.jpg

208 KB
Loading

images/Moon-25-large.jpg

200 KB
Loading

images/Moon-26-large.jpg

192 KB
Loading

images/Moon-3-large.jpg

209 KB
Loading

images/Moon-4-large.jpg

222 KB
Loading

images/Moon-5-large.jpg

242 KB
Loading

images/Moon-6-large.jpg

260 KB
Loading

images/Moon-7-large.jpg

309 KB
Loading

images/Moon-8-large.jpg

323 KB
Loading

images/Moon-9-large.jpg

337 KB
Loading

readme.txt

+30-12
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Donate link: N/A
44
Tags: astronomy
55
Requires at least: 4.6
66
Tested up to: 4.7
7-
Stable tag: 1.3
7+
Stable tag: 1.4
88
License: MIT
99
License URI: https://opensource.org/licenses/MIT
1010

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

19-
* **name** : The name of the location to be calculated
2019
* **lat** : Lattitude of location in fractional degrees (e.g. 30.8910). Positive is north, negative is south of equator
2120
* **long** : Longitude of location in fractional degrees (e.g.-98.4265). Positive is east, negative is west of the UTC line
2221
* **timezone** : Timezone name, must be value recognized by PHP. See [http://php.net/manual/en/timezones.php]
22+
23+
These parameters are optional:
24+
25+
* **name** : The name of the location to be calculated
2326
* **days** : The number of days of data to display. Must be a value from 1 to 10. Defaults to 3 if not specified.
2427

2528
**Shortcode Examples:**
2629

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

3033
The output consists of simple HTML tables:
3134

32-
* Sun/Moon table: The times for sunrise, sunset, moonrise, moonset, morning astronomical twilight, and evening astronomical twilight for the specified days.
33-
* ISS table: The times and directions for visible ISS passes over the specified days.
34-
* Iridium flares table: The times and directions for visible Iridium flares over the specified days.
35+
* Sun/Moon table: The times for sunrise, sunset, moonrise, moonset, morning astronomical twilight, and evening astronomical twilight for the specified days (max 10 days).
36+
* Planets table: The times and visibility for the planets, for the current day.
37+
* ISS table: The times and directions for visible ISS passes over the specified days (max 10 days).
38+
* Iridium flares table: The times and directions for visible Iridium flares over the specified days (max 7 days).
39+
40+
You can view the plugin in action here: [http://notforlong.org/stars-at-night](http://notforlong.org/stars-at-night)
3541

3642
**Credits and Acknowledgements:**
3743

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

4450
== Installation ==
4551

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

6672
This plugin is driven by user requests. Just ask.
6773

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

71-
= Can you provide more astronomical data, like what planets are visible, etc? =
77+
= Can you provide more astronomical data and images? =
7278

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

7581
== Screenshots ==
7682

77-
1. Sample tables generated for a specified location and time
83+
1. Sunrise and sunset table
84+
2. Planet table
85+
3. ISS passes table
86+
4. Iridium flares table
7887

7988
== Changelog ==
8089

90+
= 1.4 =
91+
92+
* Add planet table
93+
* More consistent look for table titles
94+
* Clarify required vs optional params in readme
95+
* Fixed potential Lunar image alignment
96+
* Include larger Lunar clickable images
97+
* Fixed satellite de-caching for fewer server hits
98+
8199
= 1.3 =
82100

83101
* Add Lunar images to Sun/Moon table. 1 image per 3 rows.

src/class-iridium-data.php

+7
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,11 @@ class NGC2244_Iridium_Data {
3737
public $altitude;
3838
public $azimuth;
3939
public $satellite;
40+
// required for debugging
41+
public function toString() {
42+
$str = "NGC2244_Iridium_DATA:" . "\n date: " . $this->date . "\n time: " . $this->time .
43+
"\n magnitude: " . $this->magnitude . "\n altitude: " . $this->altitude .
44+
"\n azimuth: " . $this->azimuth . "\n satellite: " . $this->satellite . "\n";
45+
return $str;
46+
}
4047
}

src/class-iss-data.php

+10
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,14 @@ class NGC2244_ISS_Data {
4141
public $endTime;
4242
public $endAltitude;
4343
public $endAzimuth;
44+
// required for debugging
45+
public function toString() {
46+
$str = "NGC2244_ISS_DATA:" . "\n date: " . $this->date . "\n magnitude:" .
47+
$this->magnitude . "\n startTime: " . $this->startTime . "\n startAltitude: " .
48+
$this->startAltitude . "\n startAzimuth: " . $this->startAzimuth . "\n highTime: " .
49+
$this->highTime . "\n highAltitude: " . $this->highAltitude . "\n highAzimuth: " .
50+
$this->highAzimuth . "\n endTime: " . $this->endTime . "\n endAltitude: " .
51+
$this->endAltitude . "\n endAzimuth: " . $this->endAzimuth . "\n";
52+
return $str;
53+
}
4454
}

src/class-moon-phase.php

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
* by Samir Shah (http://rayofsolaris.net)
3030
* License: MIT
3131
**/
32-
namespace Solaris;
3332

3433
class NGC2244_Moon_Phase {
3534
private $timestamp;

src/class-planet-data.php

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
/*
3+
* MIT License
4+
*
5+
* Copyright (c) 2016 Sean Leary
6+
*
7+
* Permission is hereby granted, free of charge, to any person obtaining a copy
8+
* of this software and associated documentation files (the "Software"), to deal
9+
* in the Software without restriction, including without limitation the rights
10+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
* copies of the Software, and to permit persons to whom the Software is
12+
* furnished to do so, subject to the following conditions:
13+
*
14+
* The above copyright notice and this permission notice shall be included in all
15+
* copies or substantial portions of the Software.
16+
*
17+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
* SOFTWARE.
24+
*/
25+
26+
// Disallow direct access
27+
defined ( 'ABSPATH' ) or die ();
28+
29+
/**
30+
* This struct-like class represents ISS satellite cached data, as received from heavens-above.com.
31+
*/
32+
class NGC2244_Planet_Data {
33+
public $date; // date only matter on the first record
34+
public $name;
35+
public $rise;
36+
public $set;
37+
public $meridian;
38+
public $constellation;
39+
public $visibility;
40+
// required for debugging
41+
public function toString() {
42+
$str = "NGC2244_PLANET_DATA:" . "\n date: " . $this->date . "\n name: " . $this->name .
43+
"\n rise:" . $this->rise . "\n set: " . $this->set . "\n meridian: " .
44+
$this->meridian . "\n constellation: " . $this->constellation .
45+
"\n visibility: " . $this->visibility . "\n";
46+
return $str;
47+
}
48+
}

0 commit comments

Comments
 (0)