Commit 12302e70 authored by Christopher Reis's avatar Christopher Reis

Initial Commit

parent c8033378
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="lib" path="C:/Users/Christopher/Development/commons-logging-1.2/commons-logging-1.2.jar"/>
<classpathentry kind="lib" path="C:/Users/Christopher/Development/commons-lang-1.0.jar"/>
<classpathentry kind="lib" path="C:/Users/Christopher/Development/worldwind-2.0.0/worldwind.jar" sourcepath="C:/Users/Christopher/Development/worldwind-2.0.0/src">
<attributes>
<attribute name="javadoc_location" value="file:/C:/Users/Christopher/Development/worldwind-2.0.0/doc/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="C:/Users/Christopher/Development/worldwind-2.0.0/worldwindx.jar" sourcepath="C:/Users/Christopher/Development/worldwind-2.0.0/src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Satellite</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
GPS BIIA-10 (PRN 32)
1 20959U 90103A 15269.04530958 -.00000012 00000-0 00000+0 0 9998
2 20959 54.2520 190.1599 0113066 6.3332 353.8164 2.00562097181868
GPS BIIA-23 (PRN 04)
1 22877U 93068A 15269.45673109 .00000048 00000-0 00000+0 0 9991
2 22877 53.8947 124.4699 0116901 62.6647 290.7571 2.00565876160599
GPS BIIA-24 (PRN 10)
1 23027U 94016A 15269.32112950 -.00000010 00000-0 00000+0 0 9991
2 23027 54.4487 60.9596 0100853 7.1892 348.1763 2.00566855157885
GPS BIIR-2 (PRN 13)
1 24876U 97035A 15269.11865657 .00000015 00000-0 00000+0 0 9998
2 24876 55.7631 251.9503 0044833 120.2510 67.7218 2.00562286133193
GPS BIIR-3 (PRN 11)
1 25933U 99055A 15269.46949601 .00000039 00000-0 00000+0 0 9993
2 25933 51.2373 105.3079 0160236 83.5295 278.3783 2.00568266117013
GPS BIIR-4 (PRN 20)
1 26360U 00025A 15269.43785088 -.00000007 00000-0 00000+0 0 9997
2 26360 53.0688 181.1543 0047003 69.5227 15.1571 2.00566007112704
GPS BIIR-5 (PRN 28)
1 26407U 00040A 15269.44381009 -.00000071 00000-0 00000+0 0 9993
2 26407 56.6839 9.6887 0199858 265.0841 102.7131 2.00561013111389
GPS BIIR-6 (PRN 14)
1 26605U 00071A 15269.25736054 .00000011 00000-0 00000+0 0 9993
2 26605 55.3326 249.9152 0086765 248.5059 279.1881 2.00565181108971
GPS BIIR-7 (PRN 18)
1 26690U 01004A 15269.54360140 -.00000008 00000-0 00000+0 0 9992
2 26690 52.9994 184.1384 0165788 249.3778 216.6594 2.00567512107387
GPS BIIR-8 (PRN 16)
1 27663U 03005A 15269.27710764 -.00000070 00000-0 00000+0 0 9996
2 27663 56.7613 9.3957 0080162 16.8632 353.5989 2.00569326 92747
GPS BIIR-9 (PRN 21)
1 27704U 03010A 15269.24067076 .00000047 00000-0 00000+0 0 9999
2 27704 53.5523 124.3993 0227623 252.6662 53.4906 2.00553830 91549
GPS BIIR-10 (PRN 22)
1 28129U 03058A 15269.21301227 -.00000010 00000-0 00000+0 0 9990
2 28129 52.8750 184.2064 0082094 243.7572 309.7820 2.00561982 86241
GPS BIIR-11 (PRN 19)
1 28190U 04009A 15269.41991616 .00000011 00000-0 00000+0 0 9994
2 28190 55.6275 70.9272 0112369 36.3879 319.6106 2.00392298 84426
GPS BIIR-12 (PRN 23)
1 28361U 04023A 15269.45562346 .00000004 00000-0 00000+0 0 9990
2 28361 54.2951 245.6631 0105230 210.5015 356.9411 2.00548934 82509
GPS BIIR-13 (PRN 02)
1 28474U 04045A 15268.50152568 .00000046 00000-0 00000-0 0 9992
2 28474 53.9468 123.6429 0149667 232.6782 4.1474 2.00567803 79852
GPS BIIRM-1 (PRN 17)
1 28874U 05038A 15269.06841200 .00000009 00000-0 00000+0 0 9997
2 28874 55.7956 68.1190 0106285 245.4297 144.5677 2.00575366 73264
GPS BIIRM-2 (PRN 31)
1 29486U 06042A 15269.08864984 -.00000007 00000-0 00000+0 0 9998
2 29486 55.8027 307.4370 0082577 328.7371 359.7438 2.00572537 65979
GPS BIIRM-3 (PRN 12)
1 29601U 06052A 15269.10632894 -.00000070 00000-0 00000+0 0 9994
2 29601 56.7305 8.3300 0053602 35.1844 346.0325 2.00572178 64893
GPS BIIRM-4 (PRN 15)
1 32260U 07047A 15269.18494997 .00000002 00000-0 00000+0 0 9996
2 32260 53.4258 242.5767 0073939 21.6921 189.7857 2.00557605 58274
GPS BIIRM-5 (PRN 29)
1 32384U 07062A 15269.13956852 .00000010 00000-0 00000+0 0 9997
2 32384 55.8462 68.6592 0009973 321.3935 349.4251 2.00561661 57009
GPS BIIRM-6 (PRN 07)
1 32711U 08012A 15269.30358917 -.00000008 00000-0 00000+0 0 9992
2 32711 55.5235 306.9540 0090373 206.5076 153.0968 2.00560984 55215
GPS BIIRM-8 (PRN 05)
1 35752U 09043A 15268.57723749 -.00000012 00000-0 00000-0 0 9998
2 35752 54.2259 185.0825 0043111 21.4940 203.0615 2.00566073 44789
GPS BIIF-1 (PRN 25)
1 36585U 10022A 15268.57015994 -.00000071 00000-0 00000+0 0 9992
2 36585 56.0667 5.5990 0044830 40.6059 281.8786 2.00569735 39021
GPS BIIF-2 (PRN 01)
1 37753U 11036A 15269.50839363 .00000051 00000-0 00000+0 0 9991
2 37753 55.1690 125.9064 0046142 24.7932 341.5786 2.00565009 30716
GPS BIIF-3 (PRN 24)
1 38833U 12053A 15268.99065042 -.00000006 00000-0 00000+0 0 9999
2 38833 54.5589 304.5054 0033824 13.4913 346.6672 2.00565483 21780
GPS BIIF-4 (PRN 27)
1 39166U 13023A 15269.34471794 .00000001 00000-0 10000-3 0 9991
2 39166 55.5042 65.3298 0025818 14.0462 346.0439 2.00560688 17318
GPS BIIF-5 (PRN 30)
1 39533U 14008A 15269.34542518 -.00000014 00000-0 00000+0 0 9996
2 39533 54.7084 309.6805 0017260 186.9281 173.1181 2.00561224 11685
GPS BIIF-6 (PRN 06)
1 39741U 14026A 15269.12928822 .00000051 00000-0 00000+0 0 9999
2 39741 55.1607 125.4357 0002341 229.4318 130.6452 2.00578995 9966
GPS BIIF-7 (PRN 09)
1 40105U 14045A 15269.21607097 .00000007 00000-0 00000+0 0 9995
2 40105 54.8093 245.2405 0003552 193.2034 166.7722 2.00556010 8413
GPS BIIF-8 (PRN 03)
1 40294U 14068A 15269.08576717 -.00000009 00000-0 00000+0 0 9991
2 40294 54.9610 185.5548 0007478 225.6828 134.2787 2.00571253 6633
GPS BIIF-9 (PRN 26)
1 40534U 15013A 15269.22411217 -.00000073 00000-0 00000+0 0 9999
2 40534 55.0406 5.3040 0001259 322.2203 37.7917 2.00568795 3695
GPS BIIF-10 (PRN 08)
1 40730U 15033A 15268.88935377 .00000003 00000-0 00000+0 0 9990
2 40730 55.0412 65.3058 0015914 258.7905 101.0510 2.00575741 1444
NOAA 1 [-]
1 04793U 70106A 15269.22184748 -.00000034 00000-0 71569-4 0 9996
2 04793 101.8990 323.9675 0032004 29.1728 14.2461 12.53973449 50196
NOAA 2 [-]
1 06235U 72082A 15269.49560619 -.00000035 00000-0 58986-4 0 9997
2 06235 101.5821 236.5542 0004064 121.7621 348.9123 12.53073872964576
NOAA 3 [-]
1 06920U 73086A 15269.49830588 -.00000034 00000-0 74765-4 0 9990
2 06920 101.8437 242.3213 0006334 172.2699 299.0599 12.40353491896471
NOAA 4 [-]
1 07529U 74089A 15269.50725728 -.00000039 00000-0 32428-4 0 9996
2 07529 101.5447 242.3468 0008829 158.6121 311.0402 12.53108302869163
NOAA 5 [-]
1 09057U 76077A 15269.54801728 -.00000029 00000-0 10568-3 0 9991
2 09057 101.7664 262.7119 0010034 26.5616 87.1377 12.37771359770103
TIROS N [P]
1 11060U 78096A 15269.55667835 .00000058 00000-0 50485-4 0 9995
2 11060 98.9826 304.2196 0010122 342.6747 17.4081 14.18066971123747
NOAA 6 [P]
1 11416U 79057A 15269.52985816 .00000156 00000-0 72515-4 0 9994
2 11416 98.5179 254.2471 0009561 316.2979 43.7448 14.33245552889871
NOAA 7 [-]
1 12553U 81059A 15269.55520623 -.00000002 00000-0 21410-4 0 9995
2 12553 98.9637 231.8890 0010517 244.8180 225.3216 14.17157192770151
NOAA 8 [-]
1 13923U 83022A 15269.47119625 .00000086 00000-0 51348-4 0 9990
2 13923 98.4707 265.5246 0014669 210.7362 149.2962 14.28455898691982
NOAA 9 [P]
1 15427U 84123A 15269.45275907 .00000041 00000-0 42834-4 0 9999
2 15427 98.7262 212.4340 0014278 322.8511 147.1277 14.15905372589250
NOAA 10 [-]
1 16969U 86073A 15269.54812954 .00000052 00000-0 38175-4 0 9991
2 16969 98.4838 286.1476 0011546 331.3445 180.1784 14.27921956510570
NOAA 11 [-]
1 19531U 88089A 15269.31125383 .00000009 00000-0 26445-4 0 9995
2 19531 98.6373 339.5960 0012000 48.5960 311.6243 14.15163211393669
NOAA 12 [-]
1 21263U 91032A 15269.50691727 .00000029 00000-0 30553-4 0 9990
2 21263 98.6233 294.8739 0013008 323.5019 198.0046 14.25777830267001
NOAA 13 [-]
1 22739U 93050A 15269.24158186 .00000024 00000-0 35783-4 0 9994
2 22739 98.6526 331.5613 0009866 166.6292 234.3773 14.12620513140508
NOAA 14 [-]
1 23455U 94089A 15269.45164953 -.00000009 00000-0 17875-4 0 9991
2 23455 98.7469 348.7949 0010091 146.6569 271.0540 14.14053117 69849
NOAA 15 [B]
1 25338U 98030A 15269.50110354 .00000083 00000-0 53858-4 0 9997
2 25338 98.7777 268.2305 0009680 230.9244 129.1075 14.25662700903270
NOAA 16 [-]
1 26536U 00055A 15269.48842723 .00000017 00000-0 33351-4 0 9990
2 26536 98.9328 335.3213 0009652 309.7496 50.2825 14.13109186773961
NOAA 17 [-]
1 27453U 02032A 15269.47784998 .00000016 00000-0 24415-4 0 9994
2 27453 98.3506 250.5101 0010531 243.7231 116.2868 14.24900055689083
NOAA 18 [B]
1 28654U 05018A 15269.51876032 .00000056 00000-0 55935-4 0 9996
2 28654 99.1911 264.6679 0014976 39.8046 320.4221 14.12235327533379
NOAA 19 [+]
1 33591U 09005A 15269.49988593 .00000149 00000-0 10603-3 0 9990
2 33591 99.0003 219.6711 0012986 243.4080 116.5761 14.11980612341781
NPP [+]
1 37849U 11061A 15269.45783714 .00000074 00000-0 55620-4 0 9995
2 37849 98.6909 207.0139 0001560 114.6322 353.1198 14.19556415202743
This diff is collapsed.
This diff is collapsed.
/**
predict4java: An SDP4 / SGP4 library for satellite orbit predictions
Copyright (C) 2004-2010 David A. B. Johnson, G4DPZ.
This class is a Java port of one of the core elements of
the Predict program, Copyright John A. Magliacane,
KD2BD 1991-2003: http://www.qsl.net/kd2bd/predict.html
Dr. T.S. Kelso is the author of the SGP4/SDP4 orbital models,
originally written in Fortran and Pascal, and released into the
public domain through his website (http://www.celestrak.com/).
Neoklis Kyriazis, 5B4AZ, later re-wrote Dr. Kelso's code in C,
and released it under the GNU GPL in 2002.
PREDICT's core is based on 5B4AZ's code translation efforts.
Author: David A. B. Johnson, G4DPZ <dave@g4dpz.me.uk>
Comments, questions and bugreports should be submitted via
http://sourceforge.net/projects/websat/
More details can be found at the project home page:
http://websat.sourceforge.net
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, visit http://www.fsf.org/
*/
package predict4java;
/**
* The location of the Satellite Ground Station. Instances of this class are
* immutable and thus thread safe.
*
* @author g4dpz
*/
public class GroundStationPosition {
private double latitude;
private double longitude;
private double heightAMSL;
private final int[] horizonElevations = new int[36];
private final String name;
/**
* @param latitude
* the latitue of the ground station in degrees, North: positive
* @param longitude
* the longitude of the ground station in degrees, East: positive
* @param heightAMSL
* the height of te ground station above mean sea level, in
* metres
*/
public GroundStationPosition(final double latitude, final double longitude,
final double heightAMSL) {
this.latitude = latitude;
this.longitude = longitude;
this.heightAMSL = heightAMSL;
this.name = "";
}
/**
* @param latitude
* the latitue of the ground station in degrees, North: positive
* @param longitude
* the longitude of the ground station in degrees, East: positive
* @param heightAMSL
* the height of te ground station above mean sea level, in
* metres
*/
public GroundStationPosition(final double latitude, final double longitude,
final double heightAMSL, String name) {
this.latitude = latitude;
this.longitude = longitude;
this.heightAMSL = heightAMSL;
this.name = name;
}
/**
* @return latitude
*/
public double getLatitude() {
return latitude;
}
/**
* @return longitude
*/
public double getLongitude() {
return longitude;
}
/**
* @return elevation
*/
public double getHeightAMSL() {
return heightAMSL;
}
/**
* Returns a copy of the horizon elevations.
*
* @return the horizonElevations
*/
public final int[] getHorizonElevations() {
final int[] horizonElevationsCopy = new int[horizonElevations.length];
System.arraycopy(horizonElevationsCopy, 0, horizonElevations, 0,
horizonElevations.length);
return horizonElevationsCopy;
}
public String getName() {
return name;
}
}
This diff is collapsed.
This diff is collapsed.
package predict4java;
/**
* Immutable class created to avoid returning ugly 2d arrays of lat long points
* from api methods.
*
* @author Dave Moten
*
*/
public class Position {
private final double lat;
private final double lon;
public Position(double lat, double lon) {
super();
this.lat = lat;
this.lon = lon;
}
public double getLat() {
return lat;
}
public double getLon() {
return lon;
}
@Override
public String toString() {
return "Position [lat=" + lat + ", lon=" + lon + "]";
}
}
/**
predict4java: An SDP4 / SGP4 library for satellite orbit predictions
Copyright (C) 2004-2010 David A. B. Johnson, G4DPZ.
This class is a Java port of one of the core elements of
the Predict program, Copyright John A. Magliacane,
KD2BD 1991-2003: http://www.qsl.net/kd2bd/predict.html
Dr. T.S. Kelso is the author of the SGP4/SDP4 orbital models,
originally written in Fortran and Pascal, and released into the
public domain through his website (http://www.celestrak.com/).
Neoklis Kyriazis, 5B4AZ, later re-wrote Dr. Kelso's code in C,
and released it under the GNU GPL in 2002.
PREDICT's core is based on 5B4AZ's code translation efforts.
Author: David A. B. Johnson, G4DPZ <dave@g4dpz.me.uk>
Comments, questions and bugreports should be submitted via
http://sourceforge.net/projects/websat/
More details can be found at the project home page:
http://websat.sourceforge.net
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, visit http://www.fsf.org/
*/
package predict4java;
/**
* @author David A. B. Johnson, g4dpz
*/
public class SatNotFoundException extends Exception {
private static final long serialVersionUID = 3389434245667560642L;
/**
* @param message
*/
public SatNotFoundException(final String message) {
super(message);
}
}
/**
predict4java: An SDP4 / SGP4 library for satellite orbit predictions
Copyright (C) 2004-2010 David A. B. Johnson, G4DPZ.
This class is a Java port of one of the core elements of
the Predict program, Copyright John A. Magliacane,
KD2BD 1991-2003: http://www.qsl.net/kd2bd/predict.html
Dr. T.S. Kelso is the author of the SGP4/SDP4 orbital models,
originally written in Fortran and Pascal, and released into the
public domain through his website (http://www.celestrak.com/).
Neoklis Kyriazis, 5B4AZ, later re-wrote Dr. Kelso's code in C,
and released it under the GNU GPL in 2002.
PREDICT's core is based on 5B4AZ's code translation efforts.
Author: David A. B. Johnson, G4DPZ <dave@g4dpz.me.uk>
Comments, questions and bugreports should be submitted via
http://sourceforge.net/projects/websat/
More details can be found at the project home page:
http://websat.sourceforge.net
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, visit http://www.fsf.org/
*/
package predict4java;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
public class SatPassTime {
private final Date startTime;
private final Date endTime;
private final Date tca;
private final String polePassed;
private final int aos;
private final int los;
private final double maxEl;
private static final String NEW_LINE = "\n";
private static final String DEG_NL = " deg.\n";
private static final SimpleDateFormat TIME_FORMAT;
private static final SimpleDateFormat DATE_FORMAT;
static {
TIME_FORMAT = new SimpleDateFormat("h:mm a");
TIME_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC"));
DATE_FORMAT = new SimpleDateFormat("MMMMMM d, yyyy");
DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC"));
}
public SatPassTime(final Date startTime, final Date endTime,
final String polePassed, final int aos, final int los,
final double maxEl) {
this(startTime, endTime, new Date(
(startTime.getTime() + endTime.getTime()) / 2), polePassed,
aos, los, maxEl);
}
public SatPassTime(final Date startTime, final Date endTime,
final Date tca, final String polePassed, final int aosAzimuth,
final int losAzimuth, final double maxEl) {
this.startTime = new Date(startTime.getTime());
this.endTime = new Date(endTime.getTime());
this.polePassed = polePassed;
this.aos = aosAzimuth;
this.los = losAzimuth;
this.maxEl = maxEl;
this.tca = new Date(tca.getTime());
}
public final Date getStartTime() {
return new Date(startTime.getTime());
}
public final Date getEndTime() {
return new Date(endTime.getTime());
}
public final Date getTCA() {
return new Date(tca.getTime());
}
public final String getPolePassed() {
return polePassed;
}
/**
* @return the aos azimuth
*/
public final int getAosAzimuth() {
return aos;
}
/**
* @return the los azimuth
*/
public final int getLosAzimuth() {
return los;
}
/**
* @return the maxEl
*/
public final double getMaxEl() {
return maxEl;
}
private synchronized static String formatDate(Date date) {
return DATE_FORMAT.format(date);
}
private synchronized static String formatTime(Date date) {
return TIME_FORMAT.format(date);
}
/**
* Returns a string representing the contents of the object.
*/
@Override
public String toString() {
final double duration = (endTime.getTime() - startTime.getTime()) / 60000.0;
return "Date: " + formatDate(startTime) + NEW_LINE
+ "Start Time: "
+ formatTime(startTime)
+ NEW_LINE
+
// "End Time: " + mTimeFormatter.format(endDate_time) + "\n" +
String.format("Duration: %4.1f min.%n", duration)
+ "AOS Azimuth: " + aos + DEG_NL
+ String.format("Max Elevation: %4.1f deg.%n", maxEl)
+ "LOS Azimuth: " + los + " deg.";
}
}
This diff is collapsed.
/**
predict4java: An SDP4 / SGP4 library for satellite orbit predictions
Copyright (C) 2004-2010 David A. B. Johnson, G4DPZ.
This class is a Java port of one of the core elements of
the Predict program, Copyright John A. Magliacane,
KD2BD 1991-2003: http://www.qsl.net/kd2bd/predict.html
Dr. T.S. Kelso is the author of the SGP4/SDP4 orbital models,
originally written in Fortran and Pascal, and released into the
public domain through his website (http://www.celestrak.com/).
Neoklis Kyriazis, 5B4AZ, later re-wrote Dr. Kelso's code in C,
and released it under the GNU GPL in 2002.
PREDICT's core is based on 5B4AZ's code translation efforts.
Author: David A. B. Johnson, G4DPZ <dave@g4dpz.me.uk>
Comments, questions and bugreports should be submitted via
http://sourceforge.net/projects/websat/
More details can be found at the project home page:
http://websat.sourceforge.net
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, visit http://www.fsf.org/
*/
package predict4java;
import java.util.Date;
public interface Satellite {
double DEG2RAD = 1.745329251994330E-2;
double TWO_PI = Math.PI * 2.0;
double EPSILON = 1.0E-12;
double TWO_THIRDS = 2.0 / 3.0;
double EARTH_RADIUS_KM = 6.378137E3;
double XKE = 7.43669161E-2;
double CK2 = 5.413079E-4;
/** J2 Harmonic (WGS '72). */
double J2_HARMONIC = 1.0826158E-3;
/** J3 Harmonic (WGS '72). */
double J3_HARMONIC = -2.53881E-6;
/** J4 Harmonic (WGS '72). */
double J4_HARMONIC = -1.65597E-6;
/**
* This function returns true if the satellite can ever rise above the
* horizon of the ground station.
*
* @param qth
* the ground station position
* @return boolean whether or not the satellite will be seen
*/
boolean willBeSeen(GroundStationPosition qth);
/**
* Calculates the position and velocity vectors of the satellite. When
* observations for many ground stations have to be made for one satellite,
* this method can be used together with the
* calculateSatPosForGroundStation(..) method. This gives a performance
* improvement relative to using the all-in-one method getPosition(..).
*
* @param date
* The date for the calculation the position and velocity vectors
* of the satellite.
*/
void calculateSatelliteVectors(Date time);
/**
* Calculates the ground track (sub satellite point) of the satellite, for
* the already determined position of the satellite.
*
* @return satPos The SatPos object in which the ground track of the
* satellite is stored.
*/
SatPos calculateSatelliteGroundTrack();
/**
* Calculates the position of the satellite from the perspective of a ground
* station. The position and velocity of the satellite must have been
* determined before (by calculateSatelliteVectors(..)). The ground track
* (sub satellite point) is not calculated, this should be done by
* calculateSatelliteGroundTrack(..).
*
* @param gsPos
* The position of the ground station to perform the calculations
* for.
* @return satPos The SatPos object where the position of the satellite is
* stored, as seen from a ground station.
*/
SatPos calculateSatPosForGroundStation(GroundStationPosition gsPos);
/**
* Returns the currently assigned TLE for the satellite.
*
* @return
*/
TLE getTLE();
/**
* Get the position of the satellite.
*
* @param gsPos
* the ground station position
* @param satPos
* the position of the satellite
* @param date
* the date
*/
SatPos getPosition(GroundStationPosition qth, Date time);
}
/**
predict4java: An SDP4 / SGP4 library for satellite orbit predictions
Copyright (C) 2004-2010 David A. B. Johnson, G4DPZ.
This class is a Java port of one of the core elements of
the Predict program, Copyright John A. Magliacane,
KD2BD 1991-2003: http://www.qsl.net/kd2bd/predict.html
Dr. T.S. Kelso is the author of the SGP4/SDP4 orbital models,
originally written in Fortran and Pascal, and released into the
public domain through his website (http://www.celestrak.com/).
Neoklis Kyriazis, 5B4AZ, later re-wrote Dr. Kelso's code in C,
and released it under the GNU GPL in 2002.
PREDICT's core is based on 5B4AZ's code translation efforts.
Author: David A. B. Johnson, G4DPZ <dave@g4dpz.me.uk>
Comments, questions and bugreports should be submitted via
http://sourceforge.net/projects/websat/
More details can be found at the project home page:
http://websat.sourceforge.net
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, visit http://www.fsf.org/
*/
package predict4java;
/**
* The factory which creates a LEO or Deep Space Satellite.
*
* @author G4DPZ
*
*/
public final class SatelliteFactory {
/**
* Default constructor is private so cannot be instantiated.
*/
private SatelliteFactory() {
}
/**
* Creates a <code>Satellite</code> from a <code>TLE</code>.
*
* @param tle
* The 'Three Line Elements'
* @return <code>Satellite</code>
* @throws IllegalArgumentException
* when the given TLE is null or the data is incorrect
*/
public static synchronized Satellite createSatellite(final TLE tle)
throws IllegalArgumentException {
if (null == tle) {
throw new IllegalArgumentException("TLE was null");
}
Satellite satellite = null;
if (tle.isDeepspace()) {
satellite = new DeepSpaceSatellite(tle);
} else {
satellite = new LEOSatellite(tle);
}
return satellite;
}
}
This diff is collapsed.
package satellite;
import gov.nasa.worldwind.View;
import gov.nasa.worldwind.WorldWind;
import gov.nasa.worldwind.avlist.AVKey;
import gov.nasa.worldwind.geom.LatLon;
import gov.nasa.worldwind.geom.Position;
import gov.nasa.worldwind.layers.RenderableLayer;
import gov.nasa.worldwind.render.*;
import gov.nasa.worldwind.util.WWUtil;
import gov.nasa.worldwindx.examples.ApplicationTemplate;
import java.awt.Color;
import java.util.ArrayList;
/**
* Example of {@link Path} usage. A Path is a line or curve between positions. The path may follow terrain, and may be
* turned into a curtain by extruding the path to the ground.
*
* @author tag
* @version $Id: Paths.java 1171 2013-02-11 21:45:02Z dcollins $
*/
public class Paths extends ApplicationTemplate
{
static RenderableLayer layer = new RenderableLayer();
static ArrayList<satPosition> aSatellite = new ArrayList<satPosition>();
public static void setOrbit(ArrayList<satPosition> sat){
aSatellite = sat;
// Create and set an attribute bundle.
ShapeAttributes attrs = new BasicShapeAttributes();
attrs.setOutlineMaterial(new Material(WWUtil.makeRandomColor(null)));
attrs.setOutlineWidth(2d);
ArrayList<Position> pathPositions = new ArrayList<Position>();
for(int i=0;i<aSatellite.size(); i++){
pathPositions.add(Position.fromDegrees(aSatellite.get(i).getLat(), aSatellite.get(i).getLon(), aSatellite.get(i).getAlt()*1000));
}
Path path = new Path(pathPositions);
path.setAttributes(attrs);
path.setVisible(true);
path.setAltitudeMode(WorldWind.RELATIVE_TO_GROUND);
path.setPathType(AVKey.GREAT_CIRCLE);
layer.addRenderable(path);
attrs = new BasicShapeAttributes();
attrs.setOutlineMaterial(new Material(WWUtil.makeRandomColor(null)));
attrs.setInteriorMaterial(new Material(WWUtil.makeRandomColor(null)));
attrs.setOutlineWidth(2);
path.setAttributes(attrs);
//layer.addRenderable(path);
//this.getLayerPanel().update(this.getWwd());
}
public static void setPosition(ArrayList<satPosition> aSatellite, String name){
PointPlacemark pp = new PointPlacemark(Position.fromDegrees(aSatellite.get(0).getLat(),aSatellite.get(0).getLon(),aSatellite.get(0).getAlt()*1000));;
pp.setLabelText(name);
pp.setValue(AVKey.DISPLAY_NAME, "Label, Semi-transparent, Audio icon");
pp.setLineEnabled(false);
pp.setAltitudeMode(WorldWind.RELATIVE_TO_GROUND);
PointPlacemarkAttributes attrsP = new PointPlacemarkAttributes();
attrsP.setImageAddress("satellite.png");
//attrsP.setImageColor(new Color(1f, 1f, 1f, 0.6f));
attrsP.setScale(0.1);
attrsP.setImageOffset(new Offset(175d,175d,AVKey.PIXELS, AVKey.PIXELS));
pp.setAttributes(attrsP);
layer.addRenderable(pp);
}
public static class AppFrame extends ApplicationTemplate.AppFrame
{
public AppFrame()
{
super(true, true, false);
// Add the layer to the model.
insertBeforeCompass(getWwd(), layer);
// Update layer panel
this.getLayerPanel().update(this.getWwd());
// //goto coord
// LatLon latlon = LatLon.fromDegrees(aSatellite.get(1).getLat(),aSatellite.get(1).getLon());
// System.out.println(latlon + " " + aSatellite.get(1).getAlt());
// View view = this.getWwd().getView();
// //double distance = view.getCenterPoint().distanceTo3(view.getEyePoint());
// view.goTo(new Position(latlon, 0.0), 0.0);
}
}
// public static void main(String[] args)
// {
// ApplicationTemplate.start("World Wind Paths", AppFrame.class);
// }
}
package satellite;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import predict4java.*;
public class SatelliteDB {
ArrayList<Satellite> satelliteDB = new ArrayList<Satellite>();
boolean databaseSet = false;
GroundStationPosition groundstation;
final static GroundStationPosition ALBUQUERQUE = new GroundStationPosition(35.0873191, -106.6376107, 5500, "Albuquerque");
final static GroundStationPosition STORMLAKE = new GroundStationPosition(42.6436, 95.2019, 1440,"Storm Lake");
public boolean downloadTLE(String in_url, String file){
URL url;
try {
url = new URL(in_url);
} catch (MalformedURLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
return false;
}
PrintWriter writer = null;
try {
writer = new PrintWriter(file, "UTF-8");
URLConnection yc = url.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream()));
String inputLine;
System.out.println("Data from: " + url);
while ((inputLine = in.readLine()) != null){
//System.out.println(inputLine);
writer.println(inputLine);
}
in.close();
writer.close();
return true;
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
System.err.println("Unsupported Encoding...");
e.printStackTrace();
return false;
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return false;
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return false;
}
}
public void TLEReader(String file){
//TODO
FileReader in = null;
try {
in = new FileReader(file);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
BufferedReader br = new BufferedReader(in);
String line;
try {
while((line = br.readLine()) != null) {
// if(line.startsWith("1") || line.startsWith("2")){
// System.out.println("Uhhhh this shouldn't happen");
// }else{
// System.out.println(line);
// }
String[] TLEs = {line,br.readLine(),br.readLine()};
TLE data = new TLE(TLEs);
satelliteDB.add(SatelliteFactory.createSatellite(data));
// System.out.println(line);
// System.out.println(br.readLine());
// System.out.println(br.readLine());
}
} catch (IllegalArgumentException | IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public void setGroundstation(GroundStationPosition gPos){
groundstation = gPos;
}
public void getSatellites_GPS(){
downloadTLE("https://celestrak.com/NORAD/elements/gps-ops.txt","gps.txt");
TLEReader("gps.txt");
databaseSet = true;
}
public void getSatellites_Stations(){
downloadTLE("https://celestrak.com/NORAD/elements/stations.txt","stations.txt");
TLEReader("stations.txt");
databaseSet = true;
}
public void getSatellites_NOAA(){
downloadTLE("https://celestrak.com/NORAD/elements/noaa.txt","noaa.txt");
TLEReader("noaa.txt");
databaseSet = true;
}
public int getSatIndex(String sat){
for(int i=0;i<satelliteDB.size();i++){
if(sat.equals(satelliteDB.get(i).getTLE().getName())){
return i;
}
}
return -1;
}
public int getSize(){
return satelliteDB.size();
}
public Satellite getSat(int selectedSatellite) {
return satelliteDB.get(selectedSatellite);
}
public boolean satExist(String string){
int selectedSatellite = this.getSatIndex(string);
if(selectedSatellite>=0){
//System.out.println(this.getSat(selectedSatellite).getTLE().getName() + " Exists!");
return true;
}else{
//System.out.println("Satellite does not exisit");
return false;
}
}
public static void main(String[] args) throws InterruptedException {
SatelliteDB gpsSats = new SatelliteDB();
gpsSats.getSatellites_GPS();
gpsSats.setGroundstation(ALBUQUERQUE);
SatelliteDB stationSats = new SatelliteDB();
stationSats.getSatellites_Stations();
stationSats.setGroundstation(STORMLAKE);
SatelliteDB noaaSats = new SatelliteDB();
noaaSats.getSatellites_NOAA();
noaaSats.setGroundstation(ALBUQUERQUE);
//Date now = new Date();
System.out.println(gpsSats.satExist("ISS (ZARYA)"));
System.out.println(stationSats.satExist("ISS (ZARYA)"));
// int selectedSat = stationSats.getSatIndex("ISS (ZARYA)");
// Satellite trackedSat = stationSats.getSat(selectedSat);
ArrayList<satPosition> orbit;
for(int i = 0; i<noaaSats.getSize(); i++){
orbit = satOrbit.getDoubleOrbit(noaaSats.getSat(i));
//Paths.setOrbit(orbit);
Paths.setPosition(orbit, noaaSats.getSat(i).getTLE().getName());
}
for(int i = 0; i<gpsSats.getSize(); i++){
orbit = satOrbit.getDoubleOrbit(gpsSats.getSat(i));
//Paths.setOrbit(orbit);
Paths.setPosition(orbit, gpsSats.getSat(i).getTLE().getName());
}
//WorldWind App
Paths.start("World Wind Paths - Test", Paths.AppFrame.class);
}
}
package satellite;
import predict4java.*;
import java.util.ArrayList;
import java.util.Date;
import satellite.satPosition;
public class satOrbit {
public static ArrayList<satPosition> getDayOrbit(Satellite trackedSat){
ArrayList<satPosition> dayOrbit = new ArrayList<satPosition>();
Date now = new Date();
long timeNow = now.getTime();
for(int i = 0; i<8640;i++){ //10s of seconds in a day
Date increment = new Date(timeNow + i*10000);
trackedSat.calculateSatelliteVectors(increment);
dayOrbit.add(new satPosition(
trackedSat.calculateSatelliteGroundTrack().getLatitude(),
trackedSat.calculateSatelliteGroundTrack().getLongitude(),
trackedSat.calculateSatelliteGroundTrack().getAltitude(),
trackedSat.calculateSatelliteGroundTrack().getTime()));
}
System.out.println("Calculated 24hr Orbit for: " + trackedSat.getTLE().getName());
return dayOrbit;
}
public static ArrayList<satPosition> getSingleOrbit(Satellite trackedSat){
//Array to store orbit
ArrayList<satPosition> singleOrbit = new ArrayList<satPosition>();
Date now = new Date();
long timeNow = now.getTime();
trackedSat.calculateSatelliteVectors(now);
//Iterate through one orbit
double meanMotion = trackedSat.getTLE().getMeanmo();
double period = 8460/meanMotion;
for(int i = 0;i<period;i++){ //Seconds in a day
Date increment = new Date(timeNow + i * 10000);
trackedSat.calculateSatelliteVectors(increment);
singleOrbit.add(new satPosition(
trackedSat.calculateSatelliteGroundTrack().getLatitude(),
trackedSat.calculateSatelliteGroundTrack().getLongitude(),
trackedSat.calculateSatelliteGroundTrack().getAltitude(),
trackedSat.calculateSatelliteGroundTrack().getTime()));
}
System.out.println("Calculated Single Orbit for: " + trackedSat.getTLE().getName());
return singleOrbit;
}
public static ArrayList<satPosition> getDoubleOrbit(Satellite trackedSat){
//Array to store orbit
ArrayList<satPosition> doubleOrbit = new ArrayList<satPosition>();
Date now = new Date();
long timeNow = now.getTime();
trackedSat.calculateSatelliteVectors(now);
//Iterate through two orbits
double meanMotion = trackedSat.getTLE().getMeanmo();
double period = 8460/meanMotion;
for(int i = 0;i<period*2;i++){ //Seconds in a day
Date increment = new Date(timeNow + i * 10000);
trackedSat.calculateSatelliteVectors(increment);
doubleOrbit.add(new satPosition(
trackedSat.calculateSatelliteGroundTrack().getLatitude(),
trackedSat.calculateSatelliteGroundTrack().getLongitude(),
trackedSat.calculateSatelliteGroundTrack().getAltitude(),
trackedSat.calculateSatelliteGroundTrack().getTime()));
}
System.out.println("Calculated Double Orbit for: " + trackedSat.getTLE().getName());
return doubleOrbit;
}
public static ArrayList<satPosition> getTripleOrbit(Satellite trackedSat){
//Array to store orbit
ArrayList<satPosition> tripleOrbit = new ArrayList<satPosition>();
Date now = new Date();
long timeNow = now.getTime();
trackedSat.calculateSatelliteVectors(now);
//Iterate through two orbits
double meanMotion = trackedSat.getTLE().getMeanmo();
double period = 8460/meanMotion;
for(int i = 0;i<period*3;i++){ //Seconds in a day
Date increment = new Date(timeNow + i * 10000);
trackedSat.calculateSatelliteVectors(increment);
tripleOrbit.add(new satPosition(
trackedSat.calculateSatelliteGroundTrack().getLatitude(),
trackedSat.calculateSatelliteGroundTrack().getLongitude(),
trackedSat.calculateSatelliteGroundTrack().getAltitude(),
trackedSat.calculateSatelliteGroundTrack().getTime()));
}
System.out.println("Calculated Triple Orbit for: " + trackedSat.getTLE().getName());
return tripleOrbit;
}
}
package satellite;
import java.util.Date;
public class satPosition{
private final double lat;
private final double lon;
private final double alt;
private final Date time;
public satPosition(double lat, double lon, double alt, Date time) {
super();
this.lat = lat;
this.lon = lon;
this.alt = alt;
this.time = time;
}
public double getLat() {
return lat / (Math.PI * 2.0) * 360;
}
public double getLon() {
return lon / (Math.PI * 2.0) * 360;
}
public double getAlt() {
return alt;
}
public Date getTime() {
return time;
}
@Override
public String toString() {
double degLat = lat / (Math.PI * 2.0) * 360;
double degLon = lon / (Math.PI * 2.0) * 360;
return "Position [lat=" + degLat + ", lon=" + degLon + ", alt = " + alt + ", time= " + time +"]";
}
}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment