├── Altaz2StarAlignPointingErrors.html
├── AltazConstantMotionTrackingErrors.html
├── Calculators.html
├── DobFriction.html
├── FoldedNewtonian.html
├── JoyOfMirrorMaking
└── 16 inch F3 meniscus mirror making class.html
├── NewtDesigner.html
├── ObjectContrastCalculator.htm
├── PitchLapCalc.html
├── PriAxisMountErrors.htm
├── RonchiExamples
├── 10 example.jpg
├── 25 example.jpg
└── 6 example.jpg
├── SQMandNELMconverter.html
├── Strehl RMS PV calc.html
├── VisualDetectionCalculator.htm
├── airmass.htm
├── altazCalc.html
├── apertureCalc.html
├── artificialStarDistance.html
├── astroTimes.html
├── baffle.html
├── coordErrors.html
├── css
├── Altaz2StarAlignPointingErrors.css
├── AltazConstantMotionTrackingErrors.css
├── FoldingTelescopes.css
├── HerschelsGhosts.css
├── LeonFoucault.css
├── NewtDesigner.css
├── Parabolizing.css
├── Ronchi.css
├── Telescope Magnification.css
├── WalkaboutPage.css
├── ZipDob.css
├── apertureCalc.css
├── calc.css
├── diagonal.css
├── holomaskCalc.css
├── index.css
├── objectLib.css
├── presentations.css
├── rft.css
├── scopeToSky.css
├── standardPage.css
├── telescopeCriteriaCalc.css
└── tm.css
├── diagonal.htm
├── diopterToFocalLengthConverter.html
├── encoderCalc.htm
├── equatTrackingRatesCalc.html
├── gaugeStudy.html
├── holomaskCalc.html
├── initializationErrorPlot.html
├── lib
├── Altaz2StarAlignPointingErrors.js
├── AltazConstantMotionTrackingErrors.js
├── DobFrictionCalc.js
├── NewtDesigner.js
├── NewtDesignerTestWithDiagToFLDistance7.jpg
├── P2 intrusion.jpg
├── PitchLapCalc.js
├── PriAxisMountErrorsCalc.js
├── Ronchi.js
├── SAC_DeepSky_ver81.zip
├── SAC_DeepSky_ver81
│ ├── Potpourri.txt
│ ├── Readme.txt
│ ├── Revhist.txt
│ ├── SAC_DeepSky_Ver81_Fence.TXT
│ ├── SAC_DeepSky_Ver81_QCQ.TXT
│ ├── SAC_DeepSky_ver81_Excel.xls
│ ├── Sacdoc.txt
│ ├── The NGC on the Net.doc
│ ├── The NGC on the Net.txt
│ └── testcvs.txt
├── SQMandNELMconverterCalc.js
├── Strehl RMS PV calc.js
├── airmassCalc.js
├── altazCalc.js
├── apertureCalc.js
├── artificialStarDistanceCalc.js
├── astroTimes.js
├── baffle.js
├── binoLayoutForNewtDesigner1.jpg
├── binoLayoutForNewtDesigner2.jpg
├── binoLayoutForNewtDesigner3.jpg
├── binoLayoutForNewtDesigner4.jpg
├── calcLib unitTests.htm
├── calcLib.js
├── coordErrorsCalc.js
├── coordLib unitTests.htm
├── coordLib.js
├── diagonal.js
├── diopterToFocalLengthConverter.js
├── embedHtml.js
├── encoderCalc.js
├── encoderLib unitTests.htm
├── encoderLib.js
├── equatTrackingRatesCalc.js
├── eyepiece divergence study.jpg
├── foldedNewtonian.js
├── gaugeLib.js
├── gaugeStudy.js
├── holomaskCalc.js
├── holomaskLib unitTests.htm
├── holomaskLib.js
├── images
│ └── base64images.js
├── initializationErrorPlot.js
├── initializationErrorPlotData.js
├── jqplot
│ ├── excanvas.js
│ ├── excanvas.min.js
│ ├── jquery.jqplot.1.0.8r1250.zip
│ ├── jquery.jqplot.css
│ ├── jquery.jqplot.js
│ ├── jquery.jqplot.min.css
│ ├── jquery.jqplot.min.js
│ ├── jquery.js
│ ├── jquery.min.js
│ └── plugins
│ │ ├── jqplot.BezierCurveRenderer.js
│ │ ├── jqplot.BezierCurveRenderer.min.js
│ │ ├── jqplot.barRenderer.js
│ │ ├── jqplot.barRenderer.min.js
│ │ ├── jqplot.blockRenderer.js
│ │ ├── jqplot.blockRenderer.min.js
│ │ ├── jqplot.bubbleRenderer.js
│ │ ├── jqplot.bubbleRenderer.min.js
│ │ ├── jqplot.canvasAxisLabelRenderer.js
│ │ ├── jqplot.canvasAxisLabelRenderer.min.js
│ │ ├── jqplot.canvasAxisTickRenderer.js
│ │ ├── jqplot.canvasAxisTickRenderer.min.js
│ │ ├── jqplot.canvasOverlay.js
│ │ ├── jqplot.canvasOverlay.min.js
│ │ ├── jqplot.canvasTextRenderer.js
│ │ ├── jqplot.canvasTextRenderer.min.js
│ │ ├── jqplot.categoryAxisRenderer.js
│ │ ├── jqplot.categoryAxisRenderer.min.js
│ │ ├── jqplot.ciParser.js
│ │ ├── jqplot.ciParser.min.js
│ │ ├── jqplot.cursor.js
│ │ ├── jqplot.cursor.min.js
│ │ ├── jqplot.dateAxisRenderer.js
│ │ ├── jqplot.dateAxisRenderer.min.js
│ │ ├── jqplot.donutRenderer.js
│ │ ├── jqplot.donutRenderer.min.js
│ │ ├── jqplot.dragable.js
│ │ ├── jqplot.dragable.min.js
│ │ ├── jqplot.enhancedLegendRenderer.js
│ │ ├── jqplot.enhancedLegendRenderer.min.js
│ │ ├── jqplot.funnelRenderer.js
│ │ ├── jqplot.funnelRenderer.min.js
│ │ ├── jqplot.highlighter.js
│ │ ├── jqplot.highlighter.min.js
│ │ ├── jqplot.json2.js
│ │ ├── jqplot.json2.min.js
│ │ ├── jqplot.logAxisRenderer.js
│ │ ├── jqplot.logAxisRenderer.min.js
│ │ ├── jqplot.mekkoAxisRenderer.js
│ │ ├── jqplot.mekkoAxisRenderer.min.js
│ │ ├── jqplot.mekkoRenderer.js
│ │ ├── jqplot.mekkoRenderer.min.js
│ │ ├── jqplot.meterGaugeRenderer.js
│ │ ├── jqplot.meterGaugeRenderer.min.js
│ │ ├── jqplot.mobile.js
│ │ ├── jqplot.mobile.min.js
│ │ ├── jqplot.ohlcRenderer.js
│ │ ├── jqplot.ohlcRenderer.min.js
│ │ ├── jqplot.pieRenderer.js
│ │ ├── jqplot.pieRenderer.min.js
│ │ ├── jqplot.pointLabels.js
│ │ ├── jqplot.pointLabels.min.js
│ │ ├── jqplot.pyramidAxisRenderer.js
│ │ ├── jqplot.pyramidAxisRenderer.min.js
│ │ ├── jqplot.pyramidGridRenderer.js
│ │ ├── jqplot.pyramidGridRenderer.min.js
│ │ ├── jqplot.pyramidRenderer.js
│ │ ├── jqplot.pyramidRenderer.min.js
│ │ ├── jqplot.trendline.js
│ │ └── jqplot.trendline.min.js
├── jquery
│ ├── jquery cvs URL.txt
│ ├── jquery-1.11.1.min.js
│ ├── jquery-2.1.1.min.js
│ ├── jquery-3.1.1.min.js
│ ├── jquery-ui.min.js
│ └── jquery.csv-0.71.min.js
├── json
│ ├── BortleScale.js
│ ├── MelBartels30InchDesignData.js
│ ├── MelBartelsZipDobIIDesignData.js
│ ├── SAC_DeepSky_Ver81_Json.js
│ ├── SAC_DeepSky_Ver81_abbr.js
│ ├── comaCorrectors.js
│ ├── eyepieces.js
│ ├── focusers.js
│ ├── materialFriction.js
│ ├── mountTypes.js
│ ├── spiderTypes.js
│ └── tubeTypes.js
├── lens CG.jpg
├── lockwood 42 inch f3.75 54 pt support.jpg
├── magnitudeCalc.js
├── matrix initialization errors.xls
├── meniscusMirrorMakingClass.js
├── mirror cell 54 pt support naming.jpg
├── motorCalc.js
├── motorLib unitTests.htm
├── motorLib.js
├── objectContrastCalc.js
├── objectLib data mining.htm
├── objectLib unitTests.htm
├── objectLib.js
├── objectLibCalc.js
├── pitch lap calc examples.jpg
├── precessionCalc.js
├── qunit
│ ├── qunit-2.17.1.css
│ └── qunit-2.17.1.js
├── refractionCalc.js
├── rotational vectors test example.jpg
├── sagittaCalc.js
├── scopeToSky.js
├── sharedLib unitTests.htm
├── sharedLib.js
├── slumpingCalc.js
├── telescopeCriteriaCalc.js
├── threeAxisLib unitTests.htm
├── threeAxisLib.js
├── trajLib unitTests.htm
├── trajLib.js
├── trajectoryCalc.js
├── underscore
│ ├── Underscore.js_files
│ │ ├── Underscore Test Suite_files
│ │ │ ├── arrays.js.download
│ │ │ ├── chaining.js.download
│ │ │ ├── collections.js.download
│ │ │ ├── cross-document.js.download
│ │ │ ├── functions.js.download
│ │ │ ├── objects.js.download
│ │ │ ├── placeholder.html
│ │ │ ├── qunit-extras.js.download
│ │ │ ├── qunit.css
│ │ │ ├── qunit.js.download
│ │ │ ├── saved_resource.html
│ │ │ ├── underscore.js.download
│ │ │ └── utility.js.download
│ │ ├── a_documentcloud_project.png
│ │ ├── underscore.js
│ │ └── underscore.png
│ └── underscore-min.js
└── visualDetectionCalc.js
├── magnitude.html
├── motorCalc.htm
├── objectLib.html
├── precession.html
├── readme.txt
├── refraction.htm
├── ronchi.html
├── sagitta.html
├── scopeToSky.html
├── slumpingCalc.html
├── telescopeCriteriaCalc - old.html
├── telescopeCriteriaCalc.html
├── tm.html
└── trajectory.htm
/AltazConstantMotionTrackingErrors.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
27 |
28 | Notes:
29 | Pointing error all sky plots for altazimuth telescope initializations using stars separated by 6, 22, 38 and 81 degrees.
30 | Green = no additional error beyond the initialization error. Red = twice the initilization error.
31 | North is pointing up, south is pointing down.
32 | Stars for plot 1: Deneb and Vega; for plot 2: Deneb and Sadr (Gamma Cygni); for plot 3: Deneb and Altair; for plot 4: Deneb and Fomalhaut.
33 |
34 | Mel Bartels
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/lib/DobFrictionCalc.js:
--------------------------------------------------------------------------------
1 | // copyright Mel Bartels, 2013-2014
2 |
3 | 'use strict';
4 |
5 | MLB.DobFrictionCalc = {};
6 |
7 | MLB.DobFrictionCalc.calc = function () {
8 | var roundToDecimal = MLB.sharedLib.roundToDecimal,
9 | decimals = 1,
10 | azimuthFrictionCoefficient = +$('input[name=azimuthFrictionCoefficient]').val(),
11 | altitudeFrictionCoefficient = +$('input[name=altitudeFrictionCoefficient]').val(),
12 | momentArm = +$('input[name=momentArm]').val(),
13 | azWeight = +$('input[name=azWeight]').val(),
14 | altWeight = +$('input[name=altWeight]').val(),
15 | azBearingRadius = +$('input[name=azBearingRadius]').val(),
16 | altBearingRadius = +$('input[name=altBearingRadius]').val(),
17 | altBearingAngleDegFromVertical = +$('input[name=altBearingAngleDegFromVertical]').val(),
18 | altitudeAngleDegFromHorizontal = +$('input[name=altitudeAngleDegFromHorizontal]').val(),
19 | friction = MLB.calcLib.calcDobFriction(azimuthFrictionCoefficient, altitudeFrictionCoefficient, momentArm, azWeight, altWeight, azBearingRadius, altBearingRadius, altBearingAngleDegFromVertical, altitudeAngleDegFromHorizontal);
20 |
21 | $('td[id=azFriction]').html(roundToDecimal(friction.az, decimals));
22 | $('td[id=altFriction]').html(roundToDecimal(friction.alt, decimals));
23 | };
24 |
25 | $(window).ready(function () {
26 | var btnCalc = $('input[id=btnCalc]'),
27 | calc = MLB.DobFrictionCalc.calc;
28 |
29 | // event hookups/subscribes
30 | btnCalc.click(function () {
31 | calc();
32 | });
33 |
34 | calc();
35 | });
36 |
37 | // end of file
--------------------------------------------------------------------------------
/lib/NewtDesignerTestWithDiagToFLDistance7.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MelBartels/AstronomyCalculatorsJavaScript/063dc5c497f50157b480cfedf68dc6eb66d25c59/lib/NewtDesignerTestWithDiagToFLDistance7.jpg
--------------------------------------------------------------------------------
/lib/P2 intrusion.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MelBartels/AstronomyCalculatorsJavaScript/063dc5c497f50157b480cfedf68dc6eb66d25c59/lib/P2 intrusion.jpg
--------------------------------------------------------------------------------
/lib/PriAxisMountErrorsCalc.js:
--------------------------------------------------------------------------------
1 | // copyright Mel Bartels, 2011-2014
2 |
3 | 'use strict';
4 |
5 | MLB.priAxisMountErrorsCalc = {};
6 |
7 | MLB.priAxisMountErrorsCalc.setLabel = function (initType) {
8 | var InitType = MLB.coordLib.InitType;
9 |
10 | return initType === InitType.altazimuth || initType === InitType.star ? 'Elevation (degrees)' : 'Declination (degrees)';
11 | };
12 |
13 | MLB.priAxisMountErrorsCalc.setNumberTicks = function (initType) {
14 | var InitType = MLB.coordLib.InitType;
15 |
16 | return initType === InitType.altazimuth || initType === InitType.star ? 10 : 19;
17 | };
18 |
19 | MLB.priAxisMountErrorsCalc.setYmax = function (initType, latDeg) {
20 | var InitType = MLB.coordLib.InitType;
21 |
22 | return initType === InitType.altazimuth || initType === InitType.star ? 90 : latDeg >= 0 ? 90 : -90;
23 | };
24 |
25 | MLB.priAxisMountErrorsCalc.setYmin = function setYmin(initType, latDeg) {
26 | var InitType = MLB.coordLib.InitType;
27 |
28 | return initType === InitType.altazimuth || initType === InitType.star ? 0 : latDeg >= 0 ? -90 : 90;
29 | };
30 |
31 | MLB.priAxisMountErrorsCalc.plot = function () {
32 | var z1Deg,
33 | z2Deg,
34 | latDeg,
35 | priAxisDeg,
36 | measurements,
37 | measurementType,
38 | mountingType,
39 | initType,
40 | init,
41 | series,
42 | seriesLabels,
43 | seriesLabel = MLB.sharedLib.seriesLabel,
44 | setLabel = MLB.priAxisMountErrorsCalc.setLabel,
45 | setNumberTicks = MLB.priAxisMountErrorsCalc.setNumberTicks,
46 | setYmax = MLB.priAxisMountErrorsCalc.setYmax,
47 | setYmin = MLB.priAxisMountErrorsCalc.setYmin,
48 | InitZ12Calc = MLB.calcLib.InitZ12Calc,
49 | getZ12ErrorValues = MLB.calcLib.getZ12ErrorValues,
50 | buildZ12AzErrors = MLB.calcLib.buildZ12AzErrors,
51 | MeasurementType = MLB.calcLib.MeasurementType,
52 | InitType = MLB.coordLib.InitType;
53 |
54 | // set vars from user input using jquery
55 | z1Deg = +$('input[name=z1Deg]').val();
56 | z2Deg = +$('input[name=z2Deg]').val();
57 | latDeg = +$('input[name=latDeg]').val();
58 | priAxisDeg = +$('input[name=priAxisDeg]').val();
59 |
60 | mountingType = $('input[name=mountingType]');
61 | if (mountingType[0].checked) {
62 | initType = InitType.altazimuth;
63 | } else if (mountingType[1].checked) {
64 | initType = InitType.equatorial;
65 | }
66 |
67 | measurements = $('input[name=measurements]');
68 | if (measurements[0].checked) {
69 | measurementType = MeasurementType.real;
70 | } else if (measurements[1].checked) {
71 | measurementType = MeasurementType.apparent;
72 | }
73 |
74 | getZ12ErrorValues(z1Deg, z2Deg, latDeg, priAxisDeg, initType);
75 | init = InitZ12Calc.init;
76 |
77 | series = [];
78 | series.push(buildZ12AzErrors(init.positions, init.z1Errors, measurementType, initType));
79 | series.push(buildZ12AzErrors(init.positions, init.z2Errors, measurementType, initType));
80 |
81 | // build the series labels
82 | seriesLabels = [seriesLabel('Bend only'), seriesLabel('Offset only')];
83 |
84 | // plot it, include replot
85 | $.jqplot.config.enablePlugins = true;
86 | $.jqplot('priAxisMountErrorsPlot', series, {
87 | title: 'Comparison of primary axis errors',
88 | legend: {
89 | show: true,
90 | placement: 'outsideGrid'
91 | },
92 | sortData: false, // otherwise line chart zigzags between + and - values
93 | axes: {
94 | xaxis: {
95 | tickRenderer: $.jqplot.CanvasAxisTickRenderer,
96 | label: 'Primary axis error (arc-minutes)',
97 | labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
98 | numberTicks: 13,
99 | max: 60,
100 | min: -60
101 | },
102 | yaxis: {
103 | tickRenderer: $.jqplot.CanvasAxisTickRenderer,
104 | label: setLabel(initType),
105 | labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
106 | numberTicks: setNumberTicks(initType),
107 | max: setYmax(initType, latDeg),
108 | min: setYmin(initType, latDeg)
109 | }
110 | },
111 | series: seriesLabels
112 | }).replot();
113 | };
114 |
115 | $(window).ready(function () {
116 | var plot = MLB.priAxisMountErrorsCalc.plot,
117 | btnPlot = $('#btnPlot')[0];
118 |
119 | // event hookups/subscribes
120 | btnPlot.onclick = function () {
121 | plot();
122 | };
123 |
124 | plot();
125 | });
126 |
127 | // end of file
--------------------------------------------------------------------------------
/lib/SAC_DeepSky_ver81.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MelBartels/AstronomyCalculatorsJavaScript/063dc5c497f50157b480cfedf68dc6eb66d25c59/lib/SAC_DeepSky_ver81.zip
--------------------------------------------------------------------------------
/lib/SAC_DeepSky_ver81/Readme.txt:
--------------------------------------------------------------------------------
1 | Information on the Saguaro Astronomy Club Database version 8.1
2 |
3 | dated March 22, 2010
4 |
5 | stevecoe at cloudynights dot com
6 |
7 |
8 | This club project started many years ago, when we wanted a listing of the brightest deep sky objects on our computers with 64KB of memory on floppy disks. Thinking it would be an easy task, here we are more than 25 years later, still maintaining and updating a much larger listing of information about what to observe at the telescope. How far we have come from the list of the brightest 300 objects contained within Burnham's Celestial Handbook, all typed in on my Apple II+. Time flies. As always, if you find an error, please let us know.
9 |
10 | This ZIP file contains seven files:
11 |
12 | This is the README.TXT file.
13 |
14 | SACDOC.TXT is the documentation for the SAC database, there is much information here on the data fields and what the data means. Please spend some time reading this info before trying to utilize the database, it will help you to use this data effectively.
15 |
16 | REVHIST.TXT is the revision history, a short file about the various releases of the SAC database.
17 |
18 | POTPOURRI.TXT is a set of information about a wide variety of astronomical phenomena from white dwarf stars, red stars, meteor showers, common names and more. These are useful files, but they did not fit the information style of the main database.
19 |
20 | SAC_DeepSky_81.XLS is version 8.1 of the SAC data as an Excel spreadsheet. There are lots of possible ways to search and sort the data in this popular spreadsheet. It contains information on over 10,000 deepsky objects.
21 |
22 | SAC_DeepSky_81_QCQ.TXT is version 8.1 of the Saguaro Astronomy Club database in quote, comma, quote delimited form. This is also called CSV for comma separated variable. Any modern database manager or spreadsheet will import the data in this format.
23 |
24 | SAC_DeepSky_81_FENCE.TXT is version 8.1 of the SAC data as a text file that has vertical bars between the fields. You can search and sort the data with a text editor.
25 |
26 | SAC wishes to thank all the people who have spent many hours searching for, and correcting, errors in the NGC. Their work is reflected in this release of the SAC database.
27 |
28 | A small fraction of the number of objects still persist as NONEXISTENT, compared to the beginnings of this database. Brian Skiff of Lowell Observatory has been a constant help with a variety of information about deep sky objects. Stephen Michael Schimpf spent much time with the NOTES field, finding errors and trying to make the data more consistent.
29 |
30 | Besides myself, I am going to list the dedicated group of people who have helped keep this an up to date and useful database: Bill Anderson, A.J. Crayon, David Fredericksen, Jack Jones, Jay LeBlanc, Matt Lutinnen, Peter Argenziano, Paul Lind and Paul Dickson.
31 |
32 | Thank you to the skill, knowledge and expertise of all who helped the Saguaro Astronomy Club create this listing of what to observe in the deep sky.
33 |
34 | See the NOTE at the bottom of the Revision History, we will keep an updated errata file at the SAC web site from now on and allow users to update their version 8.1 files as needed.
35 |
36 | Steve Coe
37 | Database manager
38 | Saguaro Astronomy Club
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/lib/SAC_DeepSky_ver81/SAC_DeepSky_ver81_Excel.xls:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MelBartels/AstronomyCalculatorsJavaScript/063dc5c497f50157b480cfedf68dc6eb66d25c59/lib/SAC_DeepSky_ver81/SAC_DeepSky_ver81_Excel.xls
--------------------------------------------------------------------------------
/lib/SAC_DeepSky_ver81/The NGC on the Net.doc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MelBartels/AstronomyCalculatorsJavaScript/063dc5c497f50157b480cfedf68dc6eb66d25c59/lib/SAC_DeepSky_ver81/The NGC on the Net.doc
--------------------------------------------------------------------------------
/lib/SAC_DeepSky_ver81/The NGC on the Net.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MelBartels/AstronomyCalculatorsJavaScript/063dc5c497f50157b480cfedf68dc6eb66d25c59/lib/SAC_DeepSky_ver81/The NGC on the Net.txt
--------------------------------------------------------------------------------
/lib/SAC_DeepSky_ver81/testcvs.txt:
--------------------------------------------------------------------------------
1 | "OBJECT ","OTHER ","TYPE ","CON","RA ","DEC ","MAG ","SUBR","U2K","TI","SIZE_MAX","SIZE_MIN","PA ","CLASS ","NSTS","BRSTR","BCHM","NGC DESCR ","NOTES "
2 | "NGC 7831 ","IC 1530 ","GALXY","AND","00 07.3","+32 37","12.8","12.3","89 ","4 "," 1.5 m"," 0.3 m","38 ","Sb "," "," "," ","eF;vS;mE;vF*v nr "," "
3 | "NGC 5 ","UGC 62 ","GALXY","AND","00 07.8","+35 22","13.3","13.2","89 ","4 "," 1.2 m"," 0.7 m","115","Elliptical "," "," "," ","vF;vS;N=*13;14 ","compact "
4 |
--------------------------------------------------------------------------------
/lib/SQMandNELMconverterCalc.js:
--------------------------------------------------------------------------------
1 | // copyright Mel Bartels, 2012-2018
2 |
3 | 'use strict';
4 |
5 | MLB.SQMandNELMconverterCalc = {};
6 |
7 | MLB.SQMandNELMconverterCalc.convertSQMtoNELM = function () {
8 | var decimals = 1,
9 | SQM = +$('input[name=SQMin]').val(),
10 | roundToDecimal = MLB.sharedLib.roundToDecimal,
11 | SQMtoNELMconverter = MLB.calcLib.SQMtoNELMconverter;
12 |
13 | $('input[name=NELMout]').val(roundToDecimal(SQMtoNELMconverter(SQM), decimals));
14 | };
15 |
16 | MLB.SQMandNELMconverterCalc.convertNELMtoSQM = function () {
17 | var decimals = 1,
18 | NELM = +$('input[name=NELMin]').val(),
19 | roundToDecimal = MLB.sharedLib.roundToDecimal,
20 | NELMtoSQMconverter = MLB.calcLib.NELMtoSQMconverter;
21 |
22 | $('input[name=SQMout]').val(roundToDecimal(NELMtoSQMconverter(NELM), decimals));
23 | };
24 |
25 | $(window).ready(function () {
26 | var btnConvertSQMtoNELM = $('#btnConvertSQMtoNELM')[0],
27 | convertSQMtoNELM = MLB.SQMandNELMconverterCalc.convertSQMtoNELM,
28 | btnConvertNELMtoSQM = $('#btnConvertNELMtoSQM')[0],
29 | convertNELMtoSQM = MLB.SQMandNELMconverterCalc.convertNELMtoSQM;
30 |
31 | // event hookups/subscribes
32 | btnConvertSQMtoNELM.onclick = function () {
33 | convertSQMtoNELM();
34 | };
35 | btnConvertNELMtoSQM.onclick = function () {
36 | convertNELMtoSQM();
37 | };
38 |
39 | convertSQMtoNELM();
40 | convertNELMtoSQM();
41 | });
42 |
43 | // end of file
--------------------------------------------------------------------------------
/lib/Strehl RMS PV calc.js:
--------------------------------------------------------------------------------
1 | // copyright Mel Bartels, 2016
2 |
3 | 'use strict';
4 |
5 | MLB.StrehlRMSPeakValleyCalc = {};
6 |
7 | MLB.StrehlRMSPeakValleyCalc.common = {
8 | btnCalcFromStrehl: function () {
9 | return $('[id=btnCalcFromStrehl]');
10 | },
11 | btnCalcFromRMS: function () {
12 | return $('[id=btnCalcFromRMS]');
13 | },
14 | btnCalcFromPeakValley: function () {
15 | return $('[id=btnCalcFromPeakValley]');
16 | },
17 | Strehl: function () {
18 | return $('[name=Strehl]');
19 | },
20 | RMS: function () {
21 | return $('[name=RMS]');
22 | },
23 | PeakValley: function () {
24 | return $('[name=PeakValley]');
25 | },
26 | StrehlVal: function () {
27 | return +this.Strehl().val();
28 | },
29 | RMSVal: function () {
30 | return +this.RMS().val();
31 | },
32 | PeakValleyVal: function () {
33 | return +this.PeakValley().val();
34 | }
35 | };
36 |
37 | MLB.StrehlRMSPeakValleyCalc.calcFromStrehl = function () {
38 | var common = MLB.StrehlRMSPeakValleyCalc.common,
39 | roundToDecimal = MLB.sharedLib.roundToDecimal,
40 | calcRMSFromStrehl = MLB.calcLib.calcRMSFromStrehl,
41 | calcPVFromRMS = MLB.calcLib.calcPVFromRMS,
42 | Strehl,
43 | RMS,
44 | PeakValley;
45 |
46 | Strehl = common.StrehlVal();
47 | RMS = calcRMSFromStrehl(Strehl);
48 | PeakValley = calcPVFromRMS(RMS);
49 | common.RMS().val(roundToDecimal(RMS, 3));
50 | common.PeakValley().val(roundToDecimal(PeakValley, 3));
51 | };
52 |
53 | MLB.StrehlRMSPeakValleyCalc.calcFromRMS = function () {
54 | var common = MLB.StrehlRMSPeakValleyCalc.common,
55 | roundToDecimal = MLB.sharedLib.roundToDecimal,
56 | calcStrehlFromRMS = MLB.calcLib.calcStrehlFromRMS,
57 | calcPVFromRMS = MLB.calcLib.calcPVFromRMS,
58 | Strehl,
59 | RMS,
60 | PeakValley;
61 |
62 | RMS = common.RMSVal();
63 | Strehl = calcStrehlFromRMS(RMS);
64 | PeakValley = calcPVFromRMS(RMS);
65 | common.Strehl().val(roundToDecimal(Strehl, 3));
66 | common.PeakValley().val(roundToDecimal(PeakValley, 3));
67 | };
68 |
69 | MLB.StrehlRMSPeakValleyCalc.calcFromPeakValley = function () {
70 | var common = MLB.StrehlRMSPeakValleyCalc.common,
71 | roundToDecimal = MLB.sharedLib.roundToDecimal,
72 | calcRMSFromPV = MLB.calcLib.calcRMSFromPV,
73 | calcStrehlFromRMS = MLB.calcLib.calcStrehlFromRMS,
74 | Strehl,
75 | RMS,
76 | PeakValley;
77 |
78 | PeakValley = common.PeakValleyVal();
79 | RMS = calcRMSFromPV(PeakValley);
80 | Strehl = calcStrehlFromRMS(RMS);
81 | common.RMS().val(roundToDecimal(RMS, 3));
82 | common.Strehl().val(roundToDecimal(Strehl, 3));
83 | };
84 |
85 | $(window).ready(function () {
86 | var common = MLB.StrehlRMSPeakValleyCalc.common,
87 | calcFromStrehl = MLB.StrehlRMSPeakValleyCalc.calcFromStrehl,
88 | calcFromRMS = MLB.StrehlRMSPeakValleyCalc.calcFromRMS,
89 | calcFromPeakValley = MLB.StrehlRMSPeakValleyCalc.calcFromPeakValley;
90 |
91 | // event hookups/subscribes
92 | common.btnCalcFromStrehl().click(calcFromStrehl);
93 | common.btnCalcFromRMS().click(calcFromRMS);
94 | common.btnCalcFromPeakValley().click(calcFromPeakValley);
95 |
96 | calcFromStrehl();
97 | });
98 |
99 | // end of file
--------------------------------------------------------------------------------
/lib/airmassCalc.js:
--------------------------------------------------------------------------------
1 | // copyright Mel Bartels, 2011-2014
2 |
3 | 'use strict';
4 |
5 | MLB.airmassCalc = {};
6 |
7 | MLB.airmassCalc.plot = function () {
8 | var elevation, airmassPoint, series, seriesLabels, seriesLabel = MLB.sharedLib.seriesLabel, calcAirMass = MLB.coordLib.calcAirMass;
9 |
10 | series = [];
11 | airmassPoint = [];
12 | for (elevation = 0; elevation <= 90; elevation++) {
13 | airmassPoint.push([calcAirMass(elevation), elevation]);
14 | }
15 | series.push(airmassPoint);
16 | // build the series labels
17 | seriesLabels = [seriesLabel('airmass')];
18 |
19 | // plot it, include replot
20 | $.jqplot.config.enablePlugins = true;
21 | $.jqplot('airmassChart', series, {
22 | title: 'Plot of airmass for elevation',
23 | legend: {
24 | show: true,
25 | placement: 'outsideGrid'
26 | },
27 | axes: {
28 | xaxis: {
29 | tickRenderer: $.jqplot.CanvasAxisTickRenderer,
30 | label: 'airmass',
31 | labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
32 | numberTicks: 9,
33 | max: 40,
34 | min: 0
35 | },
36 | yaxis: {
37 | tickRenderer: $.jqplot.CanvasAxisTickRenderer,
38 | label: 'elevation (degrees)',
39 | labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
40 | numberTicks: 10,
41 | max: 90,
42 | min: 0
43 | }
44 | },
45 | series: seriesLabels
46 | }).replot();
47 | };
48 |
49 | $(window).ready(function () {
50 | MLB.airmassCalc.plot();
51 | });
52 |
53 | // end of file
--------------------------------------------------------------------------------
/lib/altazCalc.js:
--------------------------------------------------------------------------------
1 | // copyright Mel Bartels, 2012-2014
2 |
3 | 'use strict';
4 |
5 | MLB.altazCalc = {};
6 |
7 | MLB.altazCalc.trackingRatesNoCorrection = {
8 | calc: new MLB.coordLib.TrackingRates(),
9 | xform: new MLB.coordLib.XForm(MLB.coordLib.ConvertStyle.trig, 0)
10 | };
11 |
12 | MLB.altazCalc.calc = function () {
13 | var includeRefraction,
14 | HA,
15 | Dec,
16 | latitude,
17 | HARad,
18 | DecRad,
19 | latitudeRad,
20 | state,
21 | rates,
22 | positionDecimals = 3,
23 | rateDecimals = 3,
24 | changeDecimals = 6,
25 | timeIntervalSecs = 1,
26 | HAOffset = 0,
27 | roundToDecimal = MLB.sharedLib.roundToDecimal,
28 | uom = MLB.sharedLib.uom,
29 | trackingRatesNoCorrection = MLB.altazCalc.trackingRatesNoCorrection,
30 | parseCoordinateGetValueInRadians = MLB.coordLib.parseCoordinateGetValueInRadians;
31 |
32 | HA = $('input[name=HA]').val();
33 | Dec = $('input[name=Dec]').val();
34 | latitude = $('input[name=latitude]').val();
35 | includeRefraction = $('[name=includeRefraction]')[0].checked;
36 |
37 | HARad = parseCoordinateGetValueInRadians(HA, true).radians;
38 | DecRad = parseCoordinateGetValueInRadians(Dec).radians;
39 | latitudeRad = parseCoordinateGetValueInRadians(latitude).radians;
40 |
41 | state = trackingRatesNoCorrection;
42 | state.xform.latitude = latitudeRad;
43 | state.xform.presetAltaz();
44 |
45 | state.xform.position.RA = 0;
46 | state.xform.position.Dec = DecRad;
47 | state.xform.position.SidT = HARad;
48 | rates = state.calc.getRatesViaDeltaTime(state.xform, timeIntervalSecs, HAOffset, includeRefraction);
49 |
50 | $('td[id=az]').html(roundToDecimal(rates.initialAz / uom.degToRad, positionDecimals));
51 | $('td[id=alt]').html(roundToDecimal(rates.initialAlt / uom.degToRad, positionDecimals));
52 | $('td[id=FR]').html(roundToDecimal(rates.initialFR / uom.degToRad, positionDecimals));
53 |
54 | if (includeRefraction) {
55 | $('td[id=refract]').html(roundToDecimal(rates.refractionResults.refraction / uom.degToRad, positionDecimals));
56 | } else {
57 | $('td[id=refract]').html('');
58 | }
59 |
60 | $('td[id=azRate]').html(roundToDecimal(rates.azRate / uom.arcsecToRad, rateDecimals));
61 | $('td[id=altRate]').html(roundToDecimal(rates.altRate / uom.arcsecToRad, rateDecimals));
62 | $('td[id=FRRate]').html(roundToDecimal(rates.FRRate / uom.arcsecToRad, rateDecimals));
63 |
64 | $('td[id=azRateChange]').html(roundToDecimal(rates.changeAzRate / uom.arcsecToRad, changeDecimals));
65 | $('td[id=altRateChange]').html(roundToDecimal(rates.changeAltRate / uom.arcsecToRad, changeDecimals));
66 | $('td[id=FRRateChange]').html(roundToDecimal(rates.changeFRRate / uom.arcsecToRad, changeDecimals));
67 | };
68 |
69 | $(window).ready(function () {
70 | var btnCalc = $('input[id=btnCalc]'),
71 | calc = MLB.altazCalc.calc;
72 |
73 | // event hookups/subscribes
74 | btnCalc.click(function () {
75 | calc();
76 | });
77 |
78 | calc();
79 | });
80 |
81 | // end of file
--------------------------------------------------------------------------------
/lib/artificialStarDistanceCalc.js:
--------------------------------------------------------------------------------
1 | // copyright Mel Bartels, 2014
2 |
3 | 'use strict';
4 |
5 | MLB.artificialStarDistanceCalc = {};
6 |
7 | MLB.artificialStarDistanceCalc.calc = function () {
8 | var mirrorDiameter = +$('input[name=mirrorDiameter]').val(),
9 | focalLength = +$('input[name=focalLength]').val(),
10 | artificialStarDistanceInches = MLB.calcLib.artificialStarDistanceInches,
11 | artificialStarDistanceMM = MLB.calcLib.artificialStarDistanceMM,
12 | artificialStarDistance,
13 | btnUom = $('[name=uom]');
14 |
15 | if (btnUom[0].checked) {
16 | artificialStarDistance = artificialStarDistanceInches;
17 | } else if (btnUom[1].checked) {
18 | artificialStarDistance = artificialStarDistanceMM;
19 | }
20 |
21 | $('input[name=distance]').val(artificialStarDistance(mirrorDiameter, focalLength));
22 | };
23 |
24 | $(window).ready(function () {
25 | var calc = MLB.artificialStarDistanceCalc.calc,
26 | btnCalculateDistance = $('#btnCalculateDistance')[0];
27 |
28 | // event hookups/subscribes
29 | btnCalculateDistance.onclick = function () {
30 | calc();
31 | };
32 |
33 | calc();
34 | });
35 |
36 | // end of file
--------------------------------------------------------------------------------
/lib/astroTimes.js:
--------------------------------------------------------------------------------
1 | // copyright Mel Bartels, 2012-2014
2 |
3 | 'use strict';
4 | MLB.astroTimes = {};
5 |
6 | MLB.astroTimes.getTimezone = function () {
7 | return +$('input[name=timezone]').val();
8 | };
9 |
10 | MLB.astroTimes.calcSidTJD = function () {
11 | var inputDate,
12 | date,
13 | JD,
14 | SidT,
15 | longitudeDeg,
16 | getTimezone = MLB.astroTimes.getTimezone,
17 | convertRadiansToHMSString = MLB.coordLib.convertRadiansToHMSString,
18 | dateFromString = MLB.coordLib.dateFromString,
19 | calcJD = MLB.coordLib.calcJD,
20 | calcSidTFromJD = MLB.coordLib.calcSidTFromJD;
21 |
22 | if ($('input[name=dateTime]').val() === '') {
23 | $('input[name=dateTime]').val(new Date().toString());
24 | }
25 |
26 | inputDate = $('input[name=dateTime]').val();
27 | longitudeDeg = +$('input[name=longitude]').val();
28 |
29 | date = dateFromString(inputDate);
30 | $('input[name=timezone]').val(-date.getTimezoneOffset() / 60);
31 |
32 | JD = calcJD(date.getFullYear(), date.getMonth() + 1, date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds(), getTimezone());
33 | $('input[name=JD]').val(JD);
34 |
35 | SidT = calcSidTFromJD(JD, longitudeDeg);
36 | $('input[name=SidT]').val(convertRadiansToHMSString(SidT));
37 | };
38 |
39 | MLB.astroTimes.calcDateTime = function () {
40 | var convertHMSMToString = MLB.coordLib.convertHMSMToString,
41 | getMonth = MLB.coordLib.getMonth,
42 | calcDateFromJD = MLB.coordLib.calcDateFromJD,
43 | getTimezone = MLB.astroTimes.getTimezone,
44 | JD = $('input[name=JD]').val(),
45 | date = calcDateFromJD(parseFloat(JD), getTimezone()),
46 | hmsm = {
47 | hours: date.hours,
48 | minutes: date.minutes,
49 | seconds: date.seconds
50 | },
51 | dateString = getMonth(date.month - 1) + ' ' + date.day + ', ' + date.year + ' ' + convertHMSMToString(hmsm);
52 |
53 | $('input[name=dateTime]').val(dateString);
54 | };
55 |
56 | $(window).ready(function () {
57 | var btnCalcSidTJD = $('input[id=btnCalcSidTJD]'),
58 | btnCalcDateTime = $('input[id=btnCalcDateTime]'),
59 | calcSidTJD = MLB.astroTimes.calcSidTJD,
60 | calcDateTime = MLB.astroTimes.calcDateTime;
61 |
62 | // event hookups/subscribes
63 | btnCalcSidTJD.click(function () {
64 | calcSidTJD();
65 | });
66 | btnCalcDateTime.click(function () {
67 | calcDateTime();
68 | });
69 |
70 | calcSidTJD();
71 | });
72 |
73 | // end of file
--------------------------------------------------------------------------------
/lib/binoLayoutForNewtDesigner1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MelBartels/AstronomyCalculatorsJavaScript/063dc5c497f50157b480cfedf68dc6eb66d25c59/lib/binoLayoutForNewtDesigner1.jpg
--------------------------------------------------------------------------------
/lib/binoLayoutForNewtDesigner2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MelBartels/AstronomyCalculatorsJavaScript/063dc5c497f50157b480cfedf68dc6eb66d25c59/lib/binoLayoutForNewtDesigner2.jpg
--------------------------------------------------------------------------------
/lib/binoLayoutForNewtDesigner3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MelBartels/AstronomyCalculatorsJavaScript/063dc5c497f50157b480cfedf68dc6eb66d25c59/lib/binoLayoutForNewtDesigner3.jpg
--------------------------------------------------------------------------------
/lib/binoLayoutForNewtDesigner4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MelBartels/AstronomyCalculatorsJavaScript/063dc5c497f50157b480cfedf68dc6eb66d25c59/lib/binoLayoutForNewtDesigner4.jpg
--------------------------------------------------------------------------------
/lib/coordErrorsCalc.js:
--------------------------------------------------------------------------------
1 | // copyright Mel Bartels, 2012-2014
2 |
3 | 'use strict';
4 |
5 | MLB.coordErrorsCalc = {};
6 |
7 | MLB.coordErrorsCalc.coordErrorsCalcState = {
8 | position: new MLB.coordLib.Position()
9 | };
10 |
11 | MLB.coordErrorsCalc.calc = function () {
12 | var RA,
13 | Dec,
14 | SidT,
15 | latitude,
16 | coordYear,
17 | calcDate,
18 | RARadians,
19 | DecRadians,
20 | SidTRadians,
21 | latitudeRadians,
22 | coordJD,
23 | calcDateObject,
24 | JD,
25 | pnaCorrections,
26 | totalRA,
27 | totalDec,
28 | refractCorrection,
29 | properMotion = 0,
30 | timeZoneOffsetHrs = 0,
31 | limitToHundredthsArcsec = true,
32 | limitToTenthsArcsec = true,
33 | coordErrorsCalcState = MLB.coordErrorsCalc.coordErrorsCalcState,
34 | position = coordErrorsCalcState.position,
35 | convertRadiansToHMSMString = MLB.coordLib.convertRadiansToHMSMString,
36 | convertRadiansToDMSMString = MLB.coordLib.convertRadiansToDMSMString,
37 | dateFromString = MLB.coordLib.dateFromString,
38 | dateTodayString = MLB.coordLib.dateTodayString,
39 | calcJDFromJulianYear = MLB.coordLib.calcJDFromJulianYear,
40 | calcJD = MLB.coordLib.calcJD,
41 | calcProperMotionPrecessionNutationAnnualAberration = MLB.coordLib.calcProperMotionPrecessionNutationAnnualAberration,
42 | parseCoordinateGetValueInRadians = MLB.coordLib.parseCoordinateGetValueInRadians,
43 | calcRefractionFromTrueEquatorialCorrection = MLB.coordLib.calcRefractionFromTrueEquatorialCorrection;
44 |
45 | if ($('input[name=calcDate]').val() === '') {
46 | $('input[name=calcDate]').val(dateTodayString());
47 | }
48 |
49 | // set vars from user input using jquery;
50 | // coordYear is a number, the rest are strings
51 | RA = $('input[name=RA]').val();
52 | Dec = $('input[name=Dec]').val();
53 | SidT = $('input[name=SidT]').val();
54 | latitude = $('input[name=latitude]').val();
55 | coordYear = +$('input[name=coordYear]').val();
56 | calcDate = $('input[name=calcDate]').val();
57 |
58 | RARadians = parseCoordinateGetValueInRadians(RA, true).radians;
59 | DecRadians = parseCoordinateGetValueInRadians(Dec).radians;
60 | SidTRadians = parseCoordinateGetValueInRadians(SidT, true).radians;
61 | latitudeRadians = parseCoordinateGetValueInRadians(latitude).radians;
62 |
63 | coordJD = calcJDFromJulianYear(coordYear);
64 | calcDateObject = dateFromString(calcDate);
65 | JD = calcJD(calcDateObject.getFullYear(), calcDateObject.getMonth() + 1, calcDateObject.getDate(), calcDateObject.getHours(), calcDateObject.getMinutes(), calcDateObject.getSeconds(), calcDateObject.getMilliseconds(), timeZoneOffsetHrs);
66 |
67 | pnaCorrections = calcProperMotionPrecessionNutationAnnualAberration(RARadians, DecRadians, coordJD, JD, properMotion, properMotion);
68 | totalRA = pnaCorrections.total.deltaRA;
69 | totalDec = pnaCorrections.total.deltaDec;
70 | refractCorrection = calcRefractionFromTrueEquatorialCorrection(RARadians + totalRA, DecRadians + totalDec, SidTRadians, latitudeRadians, position);
71 |
72 | $('td[id=precessionRA]').html(convertRadiansToHMSMString(pnaCorrections.precession.deltaRA, limitToHundredthsArcsec));
73 | $('td[id=precessionDec]').html(convertRadiansToDMSMString(pnaCorrections.precession.deltaDec, limitToTenthsArcsec));
74 |
75 | $('td[id=nutationRA]').html(convertRadiansToHMSMString(pnaCorrections.nutation.deltaRA, limitToHundredthsArcsec));
76 | $('td[id=nutationDec]').html(convertRadiansToDMSMString(pnaCorrections.nutation.deltaDec, limitToTenthsArcsec));
77 |
78 | $('td[id=annualAberrationRA]').html(convertRadiansToHMSMString(pnaCorrections.annualAberration.deltaRA, limitToHundredthsArcsec));
79 | $('td[id=annualAberrationDec]').html(convertRadiansToDMSMString(pnaCorrections.annualAberration.deltaDec, limitToTenthsArcsec));
80 |
81 | $('td[id=totalRA]').html(convertRadiansToHMSMString(totalRA, limitToHundredthsArcsec));
82 | $('td[id=totalDec]').html(convertRadiansToDMSMString(totalDec, limitToTenthsArcsec));
83 |
84 | $('td[id=refractionRA]').html(convertRadiansToHMSMString(refractCorrection.deltaRA, limitToHundredthsArcsec));
85 | $('td[id=refractionDec]').html(convertRadiansToDMSMString(refractCorrection.deltaDec, limitToTenthsArcsec));
86 | };
87 |
88 | $(window).ready(function () {
89 | var btnCalc = $('input[id=btnCalc]'),
90 | calc = MLB.coordErrorsCalc.calc;
91 |
92 | // event hookups/subscribes
93 | btnCalc.click(function () {
94 | calc();
95 | });
96 |
97 | calc();
98 | });
99 |
100 | // end of file
--------------------------------------------------------------------------------
/lib/coordLib unitTests.htm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MelBartels/AstronomyCalculatorsJavaScript/063dc5c497f50157b480cfedf68dc6eb66d25c59/lib/coordLib unitTests.htm
--------------------------------------------------------------------------------
/lib/coordLib.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MelBartels/AstronomyCalculatorsJavaScript/063dc5c497f50157b480cfedf68dc6eb66d25c59/lib/coordLib.js
--------------------------------------------------------------------------------
/lib/embedHtml.js:
--------------------------------------------------------------------------------
1 | document.addEventListener('DOMContentLoaded', function () {
2 |
3 | document.getElementById('qualityNote').innerHTML = "Fast scopes demand real quality. It can't be adjudicated afterwards by a mirror test or by tweaking collimation as the sky darkens. Instead, it must be thoroughly integrated into the process of making mirror and telescope. Astigmatism cannot be tested for then removed after the fact; instead mirror makers must adopt a process that precludes astigmatism. A mirror surface cannot be made smooth after parabolizing; instead, the mirror's surface must start smooth and kept smooth by the parabolizing process. Proper collimation that is added later by adjustments will only come undone over time. Instead, I create good alignment by building it 'right' the first time - there are no adjustments in my diagonal holder. Smooth high power motion near the zenith is built into the telescope by inventing a three-axis double flex-rocker mount. Quality is integrated into my mirror making and telescope designing and building process.";
4 |
5 | });
6 |
--------------------------------------------------------------------------------
/lib/encoderCalc.js:
--------------------------------------------------------------------------------
1 | // copyright Mel Bartels, 2015
2 |
3 | 'use strict';
4 |
5 | MLB.encoderCalc = {};
6 |
7 | MLB.encoderCalc.data = {
8 | encoder: new MLB.encoderLib.encoder()
9 | };
10 |
11 | MLB.encoderCalc.update = function () {
12 | var uom = MLB.sharedLib.uom,
13 | roundToDecimal = MLB.sharedLib.roundToDecimal,
14 | decimalPoints = 3,
15 | getReduction = MLB.sharedLib.getReduction,
16 | update = MLB.encoderLib.update,
17 | encoder = MLB.encoderCalc.data.encoder,
18 |
19 | encoderName = $('input[name=encoderName]').val(),
20 | encoderMinCount = +$('input[name=encoderMinCount]').val(),
21 | encoderMaxCount = +$('input[name=encoderMaxCount]').val(),
22 | encoderGearReduction = getReduction($('input[name=encoderGearReduction]').val()),
23 |
24 | encoderCurrentCount = $('input[name=encoderCurrentCount]'),
25 | encoderCurrentCountVal = +encoderCurrentCount.val(),
26 | encoderLastCount = $('input[name=encoderLastCount]'),
27 | encoderLastCountVal = +encoderLastCount.val(),
28 | encoderRotations = $('input[name=encoderRotations]'),
29 | encoderRotationsVal = +encoderRotations.val(),
30 | encoderAngleOffsetDeg = $('input[name=encoderAngleOffsetDeg]'),
31 | encoderAngleOffsetDegVal = +encoderAngleOffsetDeg.val() * uom.degToRad,
32 |
33 | encoderDirection = $('input[name=encoderDirection]'),
34 | encoderAngleDeg = $('input[name=encoderAngleDeg]'),
35 | encoderGearAngleDeg = $('input[name=encoderGearAngleDeg]'),
36 | encoderGearAngleWithOffsetDeg = $('input[name=encoderGearAngleWithOffsetDeg]');
37 |
38 | encoder.name = encoderName;
39 | encoder.minCount = encoderMinCount;
40 | encoder.maxCount = encoderMaxCount;
41 | encoder.totalCounts = encoder.maxCount - encoder.minCount + 1;
42 | encoder.gearReduction = encoderGearReduction;
43 | encoder.offsetAngle = encoderAngleOffsetDegVal;
44 |
45 | encoder.lastCount = encoderLastCountVal;
46 | encoder.rotations = encoderRotationsVal;
47 |
48 | update(encoder, encoderCurrentCountVal);
49 |
50 | encoderLastCount.val(encoder.lastCount);
51 | encoderDirection.val(encoder.direction);
52 | encoderRotations.val(encoder.rotations);
53 | encoderAngleDeg.val(roundToDecimal(encoder.encoderAngle / uom.degToRad, decimalPoints));
54 | encoderGearAngleDeg.val(roundToDecimal(encoder.gearAngle / uom.degToRad, decimalPoints));
55 | encoderGearAngleWithOffsetDeg.val(roundToDecimal(encoder.gearAngleWithOffset / uom.degToRad, decimalPoints));
56 | };
57 |
58 | MLB.encoderCalc.reset = function () {
59 | var uom = MLB.sharedLib.uom,
60 | roundToDecimal = MLB.sharedLib.roundToDecimal,
61 | decimalPoints = 3,
62 | reset = MLB.encoderLib.reset,
63 | encoder = MLB.encoderCalc.data.encoder,
64 |
65 | encoderCurrentCount = $('input[name=encoderCurrentCount]'),
66 | encoderLastCount = $('input[name=encoderLastCount]'),
67 | encoderRotations = $('input[name=encoderRotations]'),
68 | encoderAngleOffsetDeg = $('input[name=encoderAngleOffsetDeg]'),
69 | encoderDirection = $('input[name=encoderDirection]'),
70 | encoderAngleDeg = $('input[name=encoderAngleDeg]'),
71 | encoderGearAngleDeg = $('input[name=encoderGearAngleDeg]'),
72 | encoderGearAngleWithOffsetDeg = $('input[name=encoderGearAngleWithOffsetDeg]');
73 |
74 | reset(encoder);
75 |
76 | encoderCurrentCount.val(encoder.currentCount);
77 | encoderLastCount.val(encoder.lastCount);
78 | encoderRotations.val(encoder.rotations);
79 | encoderAngleOffsetDeg.val(roundToDecimal(encoder.offsetAngle / uom.degToRad, decimalPoints));
80 | encoderDirection.val(encoder.direction);
81 | encoderAngleDeg.val(roundToDecimal(encoder.encoderAngle / uom.degToRad, decimalPoints));
82 | encoderGearAngleDeg.val(roundToDecimal(encoder.gearAngle / uom.degToRad, decimalPoints));
83 | encoderGearAngleWithOffsetDeg.val(roundToDecimal(encoder.gearAngleWithOffset / uom.degToRad, decimalPoints));
84 | };
85 |
86 | $(window).ready(function () {
87 | var update = MLB.encoderCalc.update,
88 | reset = MLB.encoderCalc.reset,
89 | btnUpdateEncoder = $('input[id=btnUpdateEncoder]'),
90 | btnResetEncoder = $('input[id=btnResetEncoder]');
91 |
92 | // event hookups/subscribes
93 | btnUpdateEncoder.click(function () {
94 | update();
95 | });
96 | btnResetEncoder.click(function () {
97 | reset();
98 | });
99 |
100 | update();
101 | });
102 |
103 | // end of file
--------------------------------------------------------------------------------
/lib/equatTrackingRatesCalc.js:
--------------------------------------------------------------------------------
1 | // copyright Mel Bartels, 2012-2014
2 |
3 | 'use strict';
4 |
5 | MLB.equatTrackingRatesCalc = {};
6 |
7 | MLB.equatTrackingRatesCalc.trackingRatesNoCorrection = {
8 | calc: new MLB.coordLib.TrackingRates(),
9 | xform: new MLB.coordLib.XForm(MLB.coordLib.ConvertStyle.trig, 0)
10 | };
11 |
12 | MLB.equatTrackingRatesCalc.calc = function () {
13 | var HA,
14 | Dec,
15 | latitude,
16 | HARad,
17 | DecRad,
18 | latitudeRad,
19 | state,
20 | rates,
21 | elevationString,
22 | KingRate,
23 | includeRefraction = true,
24 | positionDecimals = 3,
25 | rateDecimals = 3,
26 | changeDecimals = 6,
27 | timeIntervalSecs = 1,
28 | HAOffset = 0,
29 | roundToDecimal = MLB.sharedLib.roundToDecimal,
30 | uom = MLB.sharedLib.uom,
31 | trackingRatesNoCorrection = MLB.equatTrackingRatesCalc.trackingRatesNoCorrection,
32 | parseCoordinateGetValueInRadians = MLB.coordLib.parseCoordinateGetValueInRadians,
33 | calcKingRateMinutesPerDay = MLB.coordLib.calcKingRateMinutesPerDay,
34 | calcKingRateArcsecPerSec = MLB.coordLib.calcKingRateArcsecPerSec;
35 |
36 | HA = $('input[name=HA]').val();
37 | Dec = $('input[name=Dec]').val();
38 | latitude = $('input[name=latitude]').val();
39 |
40 | HARad = parseCoordinateGetValueInRadians(HA, true).radians;
41 | DecRad = parseCoordinateGetValueInRadians(Dec).radians;
42 | latitudeRad = parseCoordinateGetValueInRadians(latitude).radians;
43 |
44 | state = trackingRatesNoCorrection;
45 | state.xform.latitude = latitudeRad;
46 | state.xform.presetEquat();
47 |
48 | state.xform.position.RA = 0;
49 | state.xform.position.Dec = DecRad;
50 | state.xform.position.SidT = HARad;
51 | rates = state.calc.getRatesViaDeltaTime(state.xform, timeIntervalSecs, HAOffset, includeRefraction);
52 | elevationString = roundToDecimal(rates.refractionResults.refractedAlt / uom.degToRad, positionDecimals);
53 |
54 | if (rates.refractionResults.refractedAlt < 0) {
55 | alert(elevationString + ' degrees below the horizon - try again');
56 | return;
57 | }
58 |
59 | KingRate = calcKingRateArcsecPerSec(calcKingRateMinutesPerDay(0, DecRad, HARad, latitudeRad));
60 |
61 | $('td[id=elevation]').html(elevationString);
62 | $('td[id=refract]').html(roundToDecimal(rates.refractionResults.refraction / uom.degToRad, positionDecimals));
63 |
64 | $('td[id=RARate]').html(roundToDecimal(rates.azRate / uom.arcsecToRad, rateDecimals));
65 | $('td[id=DecRate]').html(roundToDecimal(rates.altRate / uom.arcsecToRad, rateDecimals));
66 |
67 | $('td[id=KingRARate]').html(roundToDecimal(KingRate, rateDecimals));
68 |
69 | $('td[id=RARatePercentage]').html(roundToDecimal(rates.azRate / uom.arcsecToRad / 15 / uom.sidRate * 100, rateDecimals) + '%');
70 |
71 | $('td[id=RARateChange]').html(roundToDecimal(rates.changeAzRate / uom.arcsecToRad, changeDecimals));
72 | $('td[id=DecRateChange]').html(roundToDecimal(rates.changeAltRate / uom.arcsecToRad, changeDecimals));
73 | };
74 |
75 | $(window).ready(function () {
76 | var btnCalc = $('input[id=btnCalc]'),
77 | calc = MLB.equatTrackingRatesCalc.calc;
78 |
79 | // event hookups/subscribes
80 | btnCalc.click(function () {
81 | calc();
82 | });
83 |
84 | calc();
85 | });
86 |
87 | // end of file
--------------------------------------------------------------------------------
/lib/eyepiece divergence study.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MelBartels/AstronomyCalculatorsJavaScript/063dc5c497f50157b480cfedf68dc6eb66d25c59/lib/eyepiece divergence study.jpg
--------------------------------------------------------------------------------
/lib/gaugeLib.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MelBartels/AstronomyCalculatorsJavaScript/063dc5c497f50157b480cfedf68dc6eb66d25c59/lib/gaugeLib.js
--------------------------------------------------------------------------------
/lib/gaugeStudy.js:
--------------------------------------------------------------------------------
1 | // copyright Mel Bartels, 2012-2014
2 |
3 | 'use strict';
4 |
5 | MLB.gaugeStudy = {};
6 |
7 | MLB.gaugeStudy.drawGauges = function () {
8 | var gaugeStyle = $('#gaugeStyle')[0],
9 | selectedGaugeStyle = gaugeStyle.options[gaugeStyle.selectedIndex].text,
10 | scale = +$('[name=gaugeSize]')[0].value,
11 | stateInstances = MLB.gaugeLib.stateInstances,
12 | init = MLB.gaugeLib.init;
13 |
14 | stateInstances.states = [];
15 |
16 | init('hourGauge1', 'inputHours1', 'Time', scale, 'hoursGauge', selectedGaugeStyle);
17 | init('degreeGauge1', 'inputDegrees1', 'Angle', scale, 'degreesGauge', selectedGaugeStyle);
18 | init('negHourGauge1', 'inputNegHours1', 'Net time', scale, 'negHoursGauge', selectedGaugeStyle);
19 | init('negDegreeGauge1', 'inputNegDegrees1', 'Net angle', scale, 'negDegreesGauge', selectedGaugeStyle);
20 | init('neg10DegreeGauge1', 'inputNeg10Degrees1', 'Net angle', scale, 'neg10DegreesGauge', selectedGaugeStyle);
21 | };
22 |
23 | MLB.gaugeStudy.load = function () {
24 | var gaugeStyle = $('#gaugeStyle')[0],
25 | btnRedraw = $('#btnRedraw')[0],
26 | btnHourGauge1 = $('#btnHourGauge1')[0],
27 | btnDegreeGauge1 = $('#btnDegreeGauge1')[0],
28 | btnNegHourGauge1 = $('#btnNegHourGauge1')[0],
29 | btnNegDegreeGauge1 = $('#btnNegDegreeGauge1')[0],
30 | btnNeg10DegreeGauge1 = $('#btnNeg10DegreeGauge1')[0],
31 | drawGauges = MLB.gaugeStudy.drawGauges,
32 | plot = MLB.gaugeLib.plot;
33 |
34 | // event hookups/subscribes
35 | gaugeStyle.onchange = drawGauges;
36 | btnRedraw.onclick = drawGauges;
37 |
38 | btnHourGauge1.onclick = function () {
39 | plot('hourGauge1');
40 | };
41 | btnDegreeGauge1.onclick = function () {
42 | plot('degreeGauge1');
43 | };
44 | btnNegHourGauge1.onclick = function () {
45 | plot('negHourGauge1');
46 | };
47 | btnNegDegreeGauge1.onclick = function () {
48 | plot('negDegreeGauge1');
49 | };
50 | btnNeg10DegreeGauge1.onclick = function () {
51 | plot('neg10DegreeGauge1');
52 | };
53 |
54 | drawGauges();
55 | };
56 |
57 | $(window).ready(function () {
58 | MLB.gaugeStudy.load();
59 | });
60 |
61 | // end of file
--------------------------------------------------------------------------------
/lib/holomaskCalc.js:
--------------------------------------------------------------------------------
1 | // copyright Mel Bartels, 2015-2023
2 |
3 | /*
4 | EPS coordinate notes
5 | http://paulbourke.net/dataformats/postscript/
6 |
7 | 0,0 in bottom left hand corner
8 | units are 1/72 inch
9 | 'y' 'x' command
10 | 'm' = move to
11 | 'l' = line
12 | 's' = stroke
13 | */
14 |
15 | 'use strict';
16 |
17 | MLB.holomaskCalc = {};
18 |
19 | MLB.holomaskCalc.textFile = null;
20 | MLB.holomaskCalc.fileName = 'holomask.eps';
21 |
22 | MLB.holomaskCalc.drawGraphicsOnCanvas = function (canvas) {
23 | var canvasSize,
24 | mirrorDiameterMm,
25 | scale,
26 | lineType,
27 | int = MLB.sharedLib.int,
28 | graphicLines = MLB.holomaskLib.output.graphicLines,
29 | numbers,
30 | savedNumbers,
31 | context = canvas.getContext('2d');
32 |
33 | mirrorDiameterMm = +$('input[name = mirrorDiameterMm]').val();
34 | canvasSize = +$('input[name = canvasSize]').val();
35 | // fit the holomask into the canvas
36 | scale = canvasSize / mirrorDiameterMm * 25.4 / 72;
37 | canvas.width = canvasSize;
38 | canvas.height = canvasSize;
39 | context.clearRect(0, 0, canvas.width, canvas.height);
40 | context.strokeStyle = 'orange';
41 | context.fillStyle = context.strokeStyle;
42 | context.beginPath();
43 |
44 | // each 'm', 'l'..., 's' sequence draws a wavy rectangle outlining a fringe on the mirror's surface from center to edge back to center;
45 | // 'm', 'l'..., 'f' designates a filled in area
46 | graphicLines.forEach(function (line) {
47 | lineType = line.slice(-1);
48 | if (lineType === 'm') {
49 | numbers = line.split(' ');
50 | context.moveTo(int(scale * numbers[0]), int(scale * numbers[1]));
51 | // save the starting moveto point to draw to the final lineto
52 | savedNumbers = numbers.slice();
53 | } else if (lineType === 'l') {
54 | numbers = line.split(' ');
55 | context.lineTo(int(scale * numbers[0]), int(scale * numbers[1]));
56 | } else if (lineType === 's' || lineType === 'f') {
57 | // draw a line back to the starting point
58 | context.lineTo(int(scale * savedNumbers[0]), int(scale * savedNumbers[1]));
59 | context.stroke();
60 | context.fill();
61 | context.beginPath();
62 | }
63 | });
64 | };
65 |
66 | MLB.holomaskCalc.mainWorkFlow = function () {
67 | var setInputParmsFromDOM = MLB.holomaskLib.setInputParmsFromDOM,
68 | calcParms = MLB.holomaskLib.calcParms,
69 | buildContentPreamble = MLB.holomaskLib.buildContentPreamble,
70 | generateEPSfileHeader = MLB.holomaskLib.generateEPSfileHeader,
71 | fringes = MLB.holomaskLib.fringes,
72 | addCenterSpotAndFooter = MLB.holomaskLib.addCenterSpotAndFooter,
73 | output = MLB.holomaskLib.output,
74 | extractGraphics = MLB.holomaskLib.extractGraphics,
75 | drawGraphicsOnCanvas = MLB.holomaskCalc.drawGraphicsOnCanvas,
76 | canvas,
77 | decimalPrecision = +$('input[name = decimalPrecision]').val();
78 |
79 | setInputParmsFromDOM();
80 | calcParms();
81 | generateEPSfileHeader();
82 | buildContentPreamble();
83 | fringes(decimalPrecision);
84 | addCenterSpotAndFooter();
85 |
86 | // file contents are found in MLB.holomaskLib.output.fileContents
87 | $('#parms').html(output.parms + output.fringeCount);
88 |
89 | extractGraphics();
90 | canvas = $('#holomaskCanvas')[0];
91 | drawGraphicsOnCanvas(canvas);
92 | };
93 |
94 | var makeTextFile = function () {
95 | var fileContents = MLB.holomaskLib.output.fileContents,
96 | textFile = MLB.holomaskCalc.textFile,
97 | data = new Blob([fileContents]);
98 |
99 | // if we are replacing a previously generated file we need to manually revoke the object URL to avoid memory leaks
100 | if (textFile !== null) {
101 | window.URL.revokeObjectURL(textFile);
102 | }
103 | textFile = window.URL.createObjectURL(data);
104 | return textFile;
105 | };
106 |
107 |
108 | $(window).ready(function () {
109 | var btnCalc = $('input[id = btnCalc]'),
110 | btnCreateFile = $('#createFile'),
111 | mainWorkFlow = MLB.holomaskCalc.mainWorkFlow,
112 | fileName = MLB.holomaskCalc.fileName;
113 |
114 | // event hookups / subscribes
115 | btnCalc.click(function () {
116 | mainWorkFlow();
117 | });
118 | btnCreateFile.click(function () {
119 | var link = document.getElementById('downloadlink');
120 | link.href = makeTextFile();
121 | link.fileName = fileName;
122 | link.style.display = 'block';
123 | });
124 |
125 | mainWorkFlow();
126 | });
127 |
128 | // end of file
129 |
--------------------------------------------------------------------------------
/lib/initializationErrorPlot.js:
--------------------------------------------------------------------------------
1 | // copyright Mel Bartels, 2014
2 |
3 | 'use strict';
4 |
5 | MLB.initializationErrorPlot = {};
6 |
7 | // so that 180 degrees, or horizon to horizon just fits the canvas
8 | MLB.initializationErrorPlot.radius = 90;
9 | // init points random error is this, so this is the best possible pointing error
10 | MLB.initializationErrorPlot.minPointingError = 0.7;
11 |
12 | MLB.initializationErrorPlot.plotStar = function (star, context, center) {
13 | var radius = MLB.initializationErrorPlot.radius,
14 | uom = MLB.sharedLib.uom,
15 | mInt = MLB.sharedLib.int,
16 | fillCircle = MLB.sharedLib.fillCircle,
17 | point = MLB.sharedLib.point,
18 | azimuth,
19 | altitude,
20 | x,
21 | y;
22 |
23 | azimuth = star[0];
24 | altitude = star[1];
25 | y = center.y - mInt((radius - altitude) * Math.cos(azimuth * uom.degToRad));
26 | x = center.x - mInt((radius - altitude) * Math.sin(azimuth * uom.degToRad));
27 | fillCircle(context, point(x, y), 2, 'black');
28 | };
29 |
30 | MLB.initializationErrorPlot.plot = function (context, center, data, stars, maxError) {
31 | var plotStar = MLB.initializationErrorPlot.plotStar,
32 | radius = MLB.initializationErrorPlot.radius,
33 | minPointingError = MLB.initializationErrorPlot.minPointingError,
34 | uom = MLB.sharedLib.uom,
35 | mInt = MLB.sharedLib.int,
36 | point = MLB.sharedLib.point,
37 | drawCircle = MLB.sharedLib.drawCircle,
38 | fillCircle = MLB.sharedLib.fillCircle,
39 | drawLine = MLB.sharedLib.drawLine,
40 | ix,
41 | row,
42 | azimuth,
43 | altitude,
44 | x,
45 | y,
46 | pointingError,
47 | brightness,
48 | errorToBrightnessScale,
49 | circleAltitude,
50 | circleAzimuth,
51 | azimuthPoint1,
52 | azimuthPoint2;
53 |
54 | for (ix = 0; ix < data.length; ix++) {
55 | row = data[ix];
56 | pointingError = row[1];
57 | azimuth = row[2];
58 | altitude = row[3];
59 | y = center.y - mInt((radius - altitude) * Math.cos(azimuth * uom.degToRad));
60 | x = center.x - mInt((radius - altitude) * Math.sin(azimuth * uom.degToRad));
61 | errorToBrightnessScale = 255 / (maxError - minPointingError);
62 | brightness = mInt((pointingError - minPointingError) * errorToBrightnessScale);
63 | if (brightness > 255) {
64 | brightness = 255;
65 | }
66 | if (brightness < 0) {
67 | brightness = 0;
68 | }
69 | fillCircle(context, point(x, y), 1, 'rgb(' + brightness.toString() + ',' + (255 - brightness).toString() + ', 0)');
70 | }
71 |
72 | plotStar(stars[0], context, center);
73 | plotStar(stars[1], context, center);
74 |
75 | for (circleAltitude = radius; circleAltitude > 0; circleAltitude -= 30) {
76 | drawCircle(context, center, circleAltitude, 1, 'blue');
77 | }
78 | for (circleAzimuth = 0; circleAzimuth < 180; circleAzimuth += 30) {
79 | azimuthPoint1 = point(center.x - radius * Math.cos(circleAzimuth * uom.degToRad), center.y - radius * Math.sin(circleAzimuth * uom.degToRad));
80 | azimuthPoint2 = point(2 * center.x - azimuthPoint1.x, 2 * center.y - azimuthPoint1.y);
81 | drawLine(context, 'blue', 1, azimuthPoint1, azimuthPoint2);
82 | }
83 | };
84 |
85 | MLB.initializationErrorPlot.load = function () {
86 | var radius = MLB.initializationErrorPlot.radius,
87 | maxError = 2 * MLB.initializationErrorPlot.minPointingError,
88 | point = MLB.sharedLib.point,
89 | canvas,
90 | context,
91 | width,
92 | height,
93 | center;
94 |
95 | canvas = $('#c1')[0];
96 | context = canvas.getContext("2d");
97 | width = canvas.width;
98 | height = canvas.height;
99 | center = point(radius, height / 2);
100 | MLB.initializationErrorPlot.plot(context, center, MLB.initializationErrorPlotData.separation6, MLB.initializionErrorPlotStarAltaz6, maxError);
101 |
102 | canvas = $('#c2')[0];
103 | context = canvas.getContext("2d");
104 | width = canvas.width;
105 | height = canvas.height;
106 | center = point(radius, height / 2);
107 | MLB.initializationErrorPlot.plot(context, center, MLB.initializationErrorPlotData.separation24, MLB.initializionErrorPlotStarAltaz24, maxError);
108 |
109 | canvas = $('#c3')[0];
110 | context = canvas.getContext("2d");
111 | width = canvas.width;
112 | height = canvas.height;
113 | center = point(radius, height / 2);
114 | MLB.initializationErrorPlot.plot(context, center, MLB.initializationErrorPlotData.separation38, MLB.initializionErrorPlotStarAltaz38, maxError);
115 |
116 | canvas = $('#c4')[0];
117 | context = canvas.getContext("2d");
118 | width = canvas.width;
119 | height = canvas.height;
120 | center = point(radius, height / 2);
121 | MLB.initializationErrorPlot.plot(context, center, MLB.initializationErrorPlotData.separation81, MLB.initializionErrorPlotStarAltaz81, maxError);
122 | };
123 |
124 | $(window).ready(function () {
125 | MLB.initializationErrorPlot.load();
126 | });
127 |
128 | // end of file
--------------------------------------------------------------------------------
/lib/jqplot/jquery.jqplot.1.0.8r1250.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MelBartels/AstronomyCalculatorsJavaScript/063dc5c497f50157b480cfedf68dc6eb66d25c59/lib/jqplot/jquery.jqplot.1.0.8r1250.zip
--------------------------------------------------------------------------------
/lib/jqplot/jquery.jqplot.min.css:
--------------------------------------------------------------------------------
1 | .jqplot-target{position:relative;color:#666;font-family:"Trebuchet MS",Arial,Helvetica,sans-serif;font-size:1em}.jqplot-axis{font-size:.75em}.jqplot-xaxis{margin-top:10px}.jqplot-x2axis{margin-bottom:10px}.jqplot-yaxis{margin-right:10px}.jqplot-y2axis,.jqplot-y3axis,.jqplot-y4axis,.jqplot-y5axis,.jqplot-y6axis,.jqplot-y7axis,.jqplot-y8axis,.jqplot-y9axis,.jqplot-yMidAxis{margin-left:10px;margin-right:10px}.jqplot-axis-tick,.jqplot-xaxis-tick,.jqplot-yaxis-tick,.jqplot-x2axis-tick,.jqplot-y2axis-tick,.jqplot-y3axis-tick,.jqplot-y4axis-tick,.jqplot-y5axis-tick,.jqplot-y6axis-tick,.jqplot-y7axis-tick,.jqplot-y8axis-tick,.jqplot-y9axis-tick,.jqplot-yMidAxis-tick{position:absolute;white-space:pre}.jqplot-xaxis-tick{top:0;left:15px;vertical-align:top}.jqplot-x2axis-tick{bottom:0;left:15px;vertical-align:bottom}.jqplot-yaxis-tick{right:0;top:15px;text-align:right}.jqplot-yaxis-tick.jqplot-breakTick{right:-20px;margin-right:0;padding:1px 5px 1px 5px;z-index:2;font-size:1.5em}.jqplot-y2axis-tick,.jqplot-y3axis-tick,.jqplot-y4axis-tick,.jqplot-y5axis-tick,.jqplot-y6axis-tick,.jqplot-y7axis-tick,.jqplot-y8axis-tick,.jqplot-y9axis-tick{left:0;top:15px;text-align:left}.jqplot-yMidAxis-tick{text-align:center;white-space:nowrap}.jqplot-xaxis-label{margin-top:10px;font-size:11pt;position:absolute}.jqplot-x2axis-label{margin-bottom:10px;font-size:11pt;position:absolute}.jqplot-yaxis-label{margin-right:10px;font-size:11pt;position:absolute}.jqplot-yMidAxis-label{font-size:11pt;position:absolute}.jqplot-y2axis-label,.jqplot-y3axis-label,.jqplot-y4axis-label,.jqplot-y5axis-label,.jqplot-y6axis-label,.jqplot-y7axis-label,.jqplot-y8axis-label,.jqplot-y9axis-label{font-size:11pt;margin-left:10px;position:absolute}.jqplot-meterGauge-tick{font-size:.75em;color:#999}.jqplot-meterGauge-label{font-size:1em;color:#999}table.jqplot-table-legend{margin-top:12px;margin-bottom:12px;margin-left:12px;margin-right:12px}table.jqplot-table-legend,table.jqplot-cursor-legend{background-color:rgba(255,255,255,0.6);border:1px solid #ccc;position:absolute;font-size:.75em}td.jqplot-table-legend{vertical-align:middle}td.jqplot-seriesToggle:hover,td.jqplot-seriesToggle:active{cursor:pointer}.jqplot-table-legend .jqplot-series-hidden{text-decoration:line-through}div.jqplot-table-legend-swatch-outline{border:1px solid #ccc;padding:1px}div.jqplot-table-legend-swatch{width:0;height:0;border-top-width:5px;border-bottom-width:5px;border-left-width:6px;border-right-width:6px;border-top-style:solid;border-bottom-style:solid;border-left-style:solid;border-right-style:solid}.jqplot-title{top:0;left:0;padding-bottom:.5em;font-size:1.2em}table.jqplot-cursor-tooltip{border:1px solid #ccc;font-size:.75em}.jqplot-cursor-tooltip{border:1px solid #ccc;font-size:.75em;white-space:nowrap;background:rgba(208,208,208,0.5);padding:1px}.jqplot-highlighter-tooltip,.jqplot-canvasOverlay-tooltip{border:1px solid #ccc;font-size:.75em;white-space:nowrap;background:rgba(208,208,208,0.5);padding:1px}.jqplot-point-label{font-size:.75em;z-index:2}td.jqplot-cursor-legend-swatch{vertical-align:middle;text-align:center}div.jqplot-cursor-legend-swatch{width:1.2em;height:.7em}.jqplot-error{text-align:center}.jqplot-error-message{position:relative;top:46%;display:inline-block}div.jqplot-bubble-label{font-size:.8em;padding-left:2px;padding-right:2px;color:rgb(20%,20%,20%)}div.jqplot-bubble-label.jqplot-bubble-label-highlight{background:rgba(90%,90%,90%,0.7)}div.jqplot-noData-container{text-align:center;background-color:rgba(96%,96%,96%,0.3)}
--------------------------------------------------------------------------------
/lib/jqplot/plugins/jqplot.blockRenderer.min.js:
--------------------------------------------------------------------------------
1 | /* jqPlot 1.0.8r1250 | (c) 2009-2013 Chris Leonello | jplot.com
2 | jsDate | (c) 2010-2013 Chris Leonello
3 | */(function(a){a.jqplot.BlockRenderer=function(){a.jqplot.LineRenderer.call(this)};a.jqplot.BlockRenderer.prototype=new a.jqplot.LineRenderer();a.jqplot.BlockRenderer.prototype.constructor=a.jqplot.BlockRenderer;a.jqplot.BlockRenderer.prototype.init=function(b){this.css={padding:"2px",border:"1px solid #999",textAlign:"center"};this.escapeHtml=false;this.insertBreaks=true;this.varyBlockColors=false;a.extend(true,this,b);if(this.css.backgroundColor){this.color=this.css.backgroundColor}else{if(this.css.background){this.color=this.css.background}else{if(!this.varyBlockColors){this.css.background=this.color}}}this.canvas=new a.jqplot.BlockCanvas();this.shadowCanvas=new a.jqplot.BlockCanvas();this.canvas._plotDimensions=this._plotDimensions;this.shadowCanvas._plotDimensions=this._plotDimensions;this._type="block";this.moveBlock=function(l,j,i,e){var c=this.canvas._elem.children(":eq("+l+")");this.data[l][0]=j;this.data[l][1]=i;this._plotData[l][0]=j;this._plotData[l][1]=i;this._stackData[l][0]=j;this._stackData[l][1]=i;this.gridData[l][0]=this._xaxis.series_u2p(j);this.gridData[l][1]=this._yaxis.series_u2p(i);var k=c.outerWidth();var f=c.outerHeight();var d=this.gridData[l][0]-k/2+"px";var g=this.gridData[l][1]-f/2+"px";if(e){if(parseInt(e,10)){e=parseInt(e,10)}c.animate({left:d,top:g},e)}else{c.css({left:d,top:g})}c=null}};a.jqplot.BlockRenderer.prototype.draw=function(q,o,r){if(this.plugins.pointLabels){this.plugins.pointLabels.show=false}var f,c,l,o,p,k,n,g,e,m;var b=(r!=undefined)?r:{};var j=new a.jqplot.ColorGenerator(this.seriesColors);this.canvas._elem.empty();for(f=0;f
")}k=a.extend(true,{},this.css,k);c=a('
');this.canvas._elem.append(c);this.escapeHtml?c.text(p):c.html(p);delete k.position;delete k.marginRight;delete k.marginLeft;if(!k.background&&!k.backgroundColor&&!k.backgroundImage){k.background=j.next()}c.css(k);n=c.outerWidth();g=c.outerHeight();e=o[0]-n/2+"px";m=o[1]-g/2+"px";c.css({left:e,top:m});c=null}};a.jqplot.BlockCanvas=function(){a.jqplot.ElemContainer.call(this);this._ctx};a.jqplot.BlockCanvas.prototype=new a.jqplot.ElemContainer();a.jqplot.BlockCanvas.prototype.constructor=a.jqplot.BlockCanvas;a.jqplot.BlockCanvas.prototype.createElement=function(i,e,c){this._offsets=i;var b="jqplot-blockCanvas";if(e!=undefined){b=e}var g;if(this._elem){g=this._elem.get(0)}else{g=document.createElement("div")}if(c!=undefined){this._plotDimensions=c}var d=this._plotDimensions.width-this._offsets.left-this._offsets.right+"px";var f=this._plotDimensions.height-this._offsets.top-this._offsets.bottom+"px";this._elem=a(g);this._elem.css({position:"absolute",width:d,height:f,left:this._offsets.left,top:this._offsets.top});this._elem.addClass(b);return this._elem};a.jqplot.BlockCanvas.prototype.setContext=function(){this._ctx={canvas:{width:0,height:0},clearRect:function(){return null}};return this._ctx}})(jQuery);
--------------------------------------------------------------------------------
/lib/jqplot/plugins/jqplot.canvasAxisLabelRenderer.min.js:
--------------------------------------------------------------------------------
1 | /* jqPlot 1.0.8r1250 | (c) 2009-2013 Chris Leonello | jplot.com
2 | jsDate | (c) 2010-2013 Chris Leonello
3 | */(function(a){a.jqplot.CanvasAxisLabelRenderer=function(b){this.angle=0;this.axis;this.show=true;this.showLabel=true;this.label="";this.fontFamily='"Trebuchet MS", Arial, Helvetica, sans-serif';this.fontSize="11pt";this.fontWeight="normal";this.fontStretch=1;this.textColor="#666666";this.enableFontSupport=true;this.pt2px=null;this._elem;this._ctx;this._plotWidth;this._plotHeight;this._plotDimensions={height:null,width:null};a.extend(true,this,b);if(b.angle==null&&this.axis!="xaxis"&&this.axis!="x2axis"){this.angle=-90}var c={fontSize:this.fontSize,fontWeight:this.fontWeight,fontStretch:this.fontStretch,fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily};if(this.pt2px){c.pt2px=this.pt2px}if(this.enableFontSupport){if(a.jqplot.support_canvas_text()){this._textRenderer=new a.jqplot.CanvasFontRenderer(c)}else{this._textRenderer=new a.jqplot.CanvasTextRenderer(c)}}else{this._textRenderer=new a.jqplot.CanvasTextRenderer(c)}};a.jqplot.CanvasAxisLabelRenderer.prototype.init=function(b){a.extend(true,this,b);this._textRenderer.init({fontSize:this.fontSize,fontWeight:this.fontWeight,fontStretch:this.fontStretch,fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily})};a.jqplot.CanvasAxisLabelRenderer.prototype.getWidth=function(d){if(this._elem){return this._elem.outerWidth(true)}else{var f=this._textRenderer;var c=f.getWidth(d);var e=f.getHeight(d);var b=Math.abs(Math.sin(f.angle)*e)+Math.abs(Math.cos(f.angle)*c);return b}};a.jqplot.CanvasAxisLabelRenderer.prototype.getHeight=function(d){if(this._elem){return this._elem.outerHeight(true)}else{var f=this._textRenderer;var c=f.getWidth(d);var e=f.getHeight(d);var b=Math.abs(Math.cos(f.angle)*e)+Math.abs(Math.sin(f.angle)*c);return b}};a.jqplot.CanvasAxisLabelRenderer.prototype.getAngleRad=function(){var b=this.angle*Math.PI/180;return b};a.jqplot.CanvasAxisLabelRenderer.prototype.draw=function(c,f){if(this._elem){if(a.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==undefined){window.G_vmlCanvasManager.uninitElement(this._elem.get(0))}this._elem.emptyForce();this._elem=null}var e=f.canvasManager.getCanvas();this._textRenderer.setText(this.label,c);var b=this.getWidth(c);var d=this.getHeight(c);e.width=b;e.height=d;e.style.width=b;e.style.height=d;e=f.canvasManager.initCanvas(e);this._elem=a(e);this._elem.css({position:"absolute"});this._elem.addClass("jqplot-"+this.axis+"-label");e=null;return this._elem};a.jqplot.CanvasAxisLabelRenderer.prototype.pack=function(){this._textRenderer.draw(this._elem.get(0).getContext("2d"),this.label)}})(jQuery);
--------------------------------------------------------------------------------
/lib/jqplot/plugins/jqplot.canvasAxisTickRenderer.min.js:
--------------------------------------------------------------------------------
1 | /* jqPlot 1.0.8r1250 | (c) 2009-2013 Chris Leonello | jplot.com
2 | jsDate | (c) 2010-2013 Chris Leonello
3 | */(function(a){a.jqplot.CanvasAxisTickRenderer=function(b){this.mark="outside";this.showMark=true;this.showGridline=true;this.isMinorTick=false;this.angle=0;this.markSize=4;this.show=true;this.showLabel=true;this.labelPosition="auto";this.label="";this.value=null;this._styles={};this.formatter=a.jqplot.DefaultTickFormatter;this.formatString="";this.prefix="";this.fontFamily='"Trebuchet MS", Arial, Helvetica, sans-serif';this.fontSize="10pt";this.fontWeight="normal";this.fontStretch=1;this.textColor="#666666";this.enableFontSupport=true;this.pt2px=null;this._elem;this._ctx;this._plotWidth;this._plotHeight;this._plotDimensions={height:null,width:null};a.extend(true,this,b);var c={fontSize:this.fontSize,fontWeight:this.fontWeight,fontStretch:this.fontStretch,fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily};if(this.pt2px){c.pt2px=this.pt2px}if(this.enableFontSupport){if(a.jqplot.support_canvas_text()){this._textRenderer=new a.jqplot.CanvasFontRenderer(c)}else{this._textRenderer=new a.jqplot.CanvasTextRenderer(c)}}else{this._textRenderer=new a.jqplot.CanvasTextRenderer(c)}};a.jqplot.CanvasAxisTickRenderer.prototype.init=function(b){a.extend(true,this,b);this._textRenderer.init({fontSize:this.fontSize,fontWeight:this.fontWeight,fontStretch:this.fontStretch,fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily})};a.jqplot.CanvasAxisTickRenderer.prototype.getWidth=function(d){if(this._elem){return this._elem.outerWidth(true)}else{var f=this._textRenderer;var c=f.getWidth(d);var e=f.getHeight(d);var b=Math.abs(Math.sin(f.angle)*e)+Math.abs(Math.cos(f.angle)*c);return b}};a.jqplot.CanvasAxisTickRenderer.prototype.getHeight=function(d){if(this._elem){return this._elem.outerHeight(true)}else{var f=this._textRenderer;var c=f.getWidth(d);var e=f.getHeight(d);var b=Math.abs(Math.cos(f.angle)*e)+Math.abs(Math.sin(f.angle)*c);return b}};a.jqplot.CanvasAxisTickRenderer.prototype.getTop=function(b){if(this._elem){return this._elem.position().top}else{return null}};a.jqplot.CanvasAxisTickRenderer.prototype.getAngleRad=function(){var b=this.angle*Math.PI/180;return b};a.jqplot.CanvasAxisTickRenderer.prototype.setTick=function(b,d,c){this.value=b;if(c){this.isMinorTick=true}return this};a.jqplot.CanvasAxisTickRenderer.prototype.draw=function(c,f){if(!this.label){this.label=this.prefix+this.formatter(this.formatString,this.value)}if(this._elem){if(a.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==undefined){window.G_vmlCanvasManager.uninitElement(this._elem.get(0))}this._elem.emptyForce();this._elem=null}var e=f.canvasManager.getCanvas();this._textRenderer.setText(this.label,c);var b=this.getWidth(c);var d=this.getHeight(c);e.width=b;e.height=d;e.style.width=b;e.style.height=d;e.style.textAlign="left";e.style.position="absolute";e=f.canvasManager.initCanvas(e);this._elem=a(e);this._elem.css(this._styles);this._elem.addClass("jqplot-"+this.axis+"-tick");e=null;return this._elem};a.jqplot.CanvasAxisTickRenderer.prototype.pack=function(){this._textRenderer.draw(this._elem.get(0).getContext("2d"),this.label)}})(jQuery);
--------------------------------------------------------------------------------
/lib/jqplot/plugins/jqplot.ciParser.js:
--------------------------------------------------------------------------------
1 | /**
2 | * jqPlot
3 | * Pure JavaScript plotting plugin using jQuery
4 | *
5 | * Version: 1.0.8
6 | * Revision: 1250
7 | *
8 | * Copyright (c) 2009-2013 Chris Leonello
9 | * jqPlot is currently available for use in all personal or commercial projects
10 | * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
11 | * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
12 | * choose the license that best suits your project and use it accordingly.
13 | *
14 | * Although not required, the author would appreciate an email letting him
15 | * know of any substantial use of jqPlot. You can reach the author at:
16 | * chris at jqplot dot com or see http://www.jqplot.com/info.php .
17 | *
18 | * If you are feeling kind and generous, consider supporting the project by
19 | * making a donation at: http://www.jqplot.com/donate.php .
20 | *
21 | * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
22 | *
23 | * version 2007.04.27
24 | * author Ash Searle
25 | * http://hexmen.com/blog/2007/03/printf-sprintf/
26 | * http://hexmen.com/js/sprintf.js
27 | * The author (Ash Searle) has placed this code in the public domain:
28 | * "This code is unrestricted: you are free to use it however you like."
29 | *
30 | */
31 | (function($) {
32 | /**
33 | * Class: $.jqplot.ciParser
34 | * Data Renderer function which converts a custom JSON data object into jqPlot data format.
35 | * Set this as a callable on the jqplot dataRenderer plot option:
36 | *
37 | * > plot = $.jqplot('mychart', [data], { dataRenderer: $.jqplot.ciParser, ... });
38 | *
39 | * Where data is an object in JSON format or a JSON encoded string conforming to the
40 | * City Index API spec.
41 | *
42 | * Note that calling the renderer function is handled internally by jqPlot. The
43 | * user does not have to call the function. The parameters described below will
44 | * automatically be passed to the ciParser function.
45 | *
46 | * Parameters:
47 | * data - JSON encoded string or object.
48 | * plot - reference to jqPlot Plot object.
49 | *
50 | * Returns:
51 | * data array in jqPlot format.
52 | *
53 | */
54 | $.jqplot.ciParser = function (data, plot) {
55 | var ret = [],
56 | line,
57 | temp,
58 | i, j, k, kk;
59 |
60 | if (typeof(data) == "string") {
61 | data = $.jqplot.JSON.parse(data, handleStrings);
62 | }
63 |
64 | else if (typeof(data) == "object") {
65 | for (k in data) {
66 | for (i=0; i
= 0) {
87 | //here we will try to extract the ticks from the Date string in the "value" fields of JSON returned data
88 | a = /^\/Date\((-?[0-9]+)\)\/$/.exec(value);
89 | if (a) {
90 | return parseInt(a[1], 10);
91 | }
92 | }
93 | return value;
94 | }
95 | }
96 |
97 | for (var prop in data) {
98 | line = [];
99 | temp = data[prop];
100 | switch (prop) {
101 | case "PriceTicks":
102 | for (i=0; i=0){i=/^\/Date\((-?[0-9]+)\)\/$/.exec(k);if(i){return parseInt(i[1],10)}}return k}}for(var b in g){o=[];n=g[b];switch(b){case"PriceTicks":for(h=0;h=0.6)?l[3]*0.6:l[3]*(2-l[3]);m.color="rgba("+o[0]+","+o[1]+","+o[2]+","+k+")"}i.color=m.color;i.init();var g=(p.pointIndex>0)?p.pointIndex-1:0;var j=p.pointIndex+2;m._gridData=q.gridData.slice(g,j)}function e(o,l,h,t,m){if(m.plugins.dragable.dragCanvas.isDragging){var u=m.plugins.dragable.dragCanvas;var i=u._neighbor;var w=m.series[i.seriesIndex];var k=w.plugins.dragable;var r=w.gridData;var p=(k.constrainTo=="y")?i.gridData[0]:l.x;var n=(k.constrainTo=="x")?i.gridData[1]:l.y;var g=w._xaxis.series_p2u(p);var q=w._yaxis.series_p2u(n);var v=u._ctx;v.clearRect(0,0,v.canvas.width,v.canvas.height);if(i.pointIndex>0){k._gridData[1]=[p,n]}else{k._gridData[0]=[p,n]}m.series[i.seriesIndex].draw(u._ctx,{gridData:k._gridData,shadow:false,preventJqPlotSeriesDrawTrigger:true,color:k.color,markerOptions:{color:k.color,shadow:false},trendline:{show:false}});m.target.trigger("jqplotSeriesPointChange",[i.seriesIndex,i.pointIndex,[g,q],[p,n]])}else{if(t!=null){var j=m.series[t.seriesIndex];if(j.isDragable){var u=m.plugins.dragable.dragCanvas;if(!u.isOver){u._cursors.push(o.target.style.cursor);o.target.style.cursor="pointer"}u.isOver=true}}else{if(t==null){var u=m.plugins.dragable.dragCanvas;if(u.isOver){o.target.style.cursor=u._cursors.pop();u.isOver=false}}}}}function c(k,i,g,l,j){var m=j.plugins.dragable.dragCanvas;m._cursors.push(k.target.style.cursor);if(l!=null){var o=j.series[l.seriesIndex];var h=o.plugins.dragable;if(o.isDragable&&!m.isDragging){m._neighbor=l;m.isDragging=true;f(j,l);h.markerRenderer.draw(o.gridData[l.pointIndex][0],o.gridData[l.pointIndex][1],m._ctx);k.target.style.cursor="move";j.target.trigger("jqplotDragStart",[l.seriesIndex,l.pointIndex,i,g])}}else{var n=m._ctx;n.clearRect(0,0,n.canvas.width,n.canvas.height);m.isDragging=false}}function a(m,j,g,o,k){if(k.plugins.dragable.dragCanvas.isDragging){var p=k.plugins.dragable.dragCanvas;var q=p._ctx;q.clearRect(0,0,q.canvas.width,q.canvas.height);p.isDragging=false;var h=p._neighbor;var r=k.series[h.seriesIndex];var i=r.plugins.dragable;var n=(i.constrainTo=="y")?h.data[0]:g[r.xaxis];var l=(i.constrainTo=="x")?h.data[1]:g[r.yaxis];r.data[h.pointIndex][0]=n;r.data[h.pointIndex][1]=l;k.drawSeries({preventJqPlotSeriesDrawTrigger:true},h.seriesIndex);p._neighbor=null;m.target.style.cursor=p._cursors.pop();k.target.trigger("jqplotDragStop",[j,g])}}})(jQuery);
--------------------------------------------------------------------------------
/lib/jqplot/plugins/jqplot.enhancedLegendRenderer.min.js:
--------------------------------------------------------------------------------
1 | /* jqPlot 1.0.8r1250 | (c) 2009-2013 Chris Leonello | jplot.com
2 | jsDate | (c) 2010-2013 Chris Leonello
3 | */(function(c){c.jqplot.EnhancedLegendRenderer=function(){c.jqplot.TableLegendRenderer.call(this)};c.jqplot.EnhancedLegendRenderer.prototype=new c.jqplot.TableLegendRenderer();c.jqplot.EnhancedLegendRenderer.prototype.constructor=c.jqplot.EnhancedLegendRenderer;c.jqplot.EnhancedLegendRenderer.prototype.init=function(d){this.numberRows=null;this.numberColumns=null;this.seriesToggle="normal";this.seriesToggleReplot=false;this.disableIEFading=true;c.extend(true,this,d);if(this.seriesToggle){c.jqplot.postDrawHooks.push(b)}};c.jqplot.EnhancedLegendRenderer.prototype.draw=function(m,y){var f=this;if(this.show){var r=this._series;var u;var w="position:absolute;";w+=(this.background)?"background:"+this.background+";":"";w+=(this.border)?"border:"+this.border+";":"";w+=(this.fontSize)?"font-size:"+this.fontSize+";":"";w+=(this.fontFamily)?"font-family:"+this.fontFamily+";":"";w+=(this.textColor)?"color:"+this.textColor+";":"";w+=(this.marginTop!=null)?"margin-top:"+this.marginTop+";":"";w+=(this.marginBottom!=null)?"margin-bottom:"+this.marginBottom+";":"";w+=(this.marginLeft!=null)?"margin-left:"+this.marginLeft+";":"";w+=(this.marginRight!=null)?"margin-right:"+this.marginRight+";":"";this._elem=c('');if(this.seriesToggle){this._elem.css("z-index","3")}var C=false,q=false,d,o;if(this.numberRows){d=this.numberRows;if(!this.numberColumns){o=Math.ceil(r.length/d)}else{o=this.numberColumns}}else{if(this.numberColumns){o=this.numberColumns;d=Math.ceil(r.length/this.numberColumns)}else{d=r.length;o=1}}var B,z,e,l,k,n,p,t,h,g;var v=0;for(B=r.length-1;B>=0;B--){if(o==1&&r[B]._stack||r[B].renderer.constructor==c.jqplot.BezierCurveRenderer){q=true}}for(B=0;B0){C=true}else{C=false}}else{if(B==d-1){C=false}else{C=true}}p=(C)?this.rowSpacing:"0";l=c(document.createElement("td"));l.addClass("jqplot-table-legend jqplot-table-legend-swatch");l.css({textAlign:"center",paddingTop:p});h=c(document.createElement("div"));h.addClass("jqplot-table-legend-swatch-outline");g=c(document.createElement("div"));g.addClass("jqplot-table-legend-swatch");g.css({backgroundColor:x,borderColor:x});l.append(h.append(g));k=c(document.createElement("td"));k.addClass("jqplot-table-legend jqplot-table-legend-label");k.css("paddingTop",p);if(this.escapeHtml){k.text(n)}else{k.html(n)}if(q){if(this.showLabels){k.prependTo(e)}if(this.showSwatches){l.prependTo(e)}}else{if(this.showSwatches){l.appendTo(e)}if(this.showLabels){k.appendTo(e)}}if(this.seriesToggle){var A;if(typeof(this.seriesToggle)==="string"||typeof(this.seriesToggle)==="number"){if(!c.jqplot.use_excanvas||!this.disableIEFading){A=this.seriesToggle}}if(this.showSwatches){l.bind("click",{series:u,speed:A,plot:y,replot:this.seriesToggleReplot},a);l.addClass("jqplot-seriesToggle")}if(this.showLabels){k.bind("click",{series:u,speed:A,plot:y,replot:this.seriesToggleReplot},a);k.addClass("jqplot-seriesToggle")}if(!u.show&&u.showLabel){l.addClass("jqplot-series-hidden");k.addClass("jqplot-series-hidden")}}C=true}}v++}l=k=h=g=null}}return this._elem};var a=function(j){var i=j.data,m=i.series,k=i.replot,h=i.plot,f=i.speed,l=m.index,g=false;if(m.canvas._elem.is(":hidden")||!m.show){g=true}var e=function(){if(k){var n={};if(c.isPlainObject(k)){c.extend(true,n,k)}h.replot(n);if(g&&f){var d=h.series[l];if(d.shadowCanvas._elem){d.shadowCanvas._elem.hide().fadeIn(f)}d.canvas._elem.hide().fadeIn(f);d.canvas._elem.nextAll(".jqplot-point-label.jqplot-series-"+d.index).hide().fadeIn(f)}}else{var d=h.series[l];if(d.canvas._elem.is(":hidden")||!d.show){if(typeof h.options.legend.showSwatches==="undefined"||h.options.legend.showSwatches===true){h.legend._elem.find("td").eq(l*2).addClass("jqplot-series-hidden")}if(typeof h.options.legend.showLabels==="undefined"||h.options.legend.showLabels===true){h.legend._elem.find("td").eq((l*2)+1).addClass("jqplot-series-hidden")}}else{if(typeof h.options.legend.showSwatches==="undefined"||h.options.legend.showSwatches===true){h.legend._elem.find("td").eq(l*2).removeClass("jqplot-series-hidden")}if(typeof h.options.legend.showLabels==="undefined"||h.options.legend.showLabels===true){h.legend._elem.find("td").eq((l*2)+1).removeClass("jqplot-series-hidden")}}}};m.toggleDisplay(j,e)};var b=function(){if(this.legend.renderer.constructor==c.jqplot.EnhancedLegendRenderer&&this.legend.seriesToggle){var d=this.legend._elem.detach();this.eventCanvas._elem.after(d)}}})(jQuery);
--------------------------------------------------------------------------------
/lib/jqplot/plugins/jqplot.json2.min.js:
--------------------------------------------------------------------------------
1 | /* jqPlot 1.0.8r1250 | (c) 2009-2013 Chris Leonello | jplot.com
2 | jsDate | (c) 2010-2013 Chris Leonello
3 | */(function($){$.jqplot.JSON=window.JSON;if(!window.JSON){$.jqplot.JSON={}}function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;ib.max||b.max==null){b.max=f[c][1]}}}else{for(var c=0;cb.max||b.max==null){b.max=f[c][2]}}}};a.jqplot.OHLCRenderer.prototype.draw=function(A,N,j){var J=this.data;var v=this._xaxis.min;var z=this._xaxis.max;var l=0;var K=J.length;var p=this._xaxis.series_u2p;var G=this._yaxis.series_u2p;var D,E,f,M,F,n,O,C;var y;var u=this.renderer;var s=(j!=undefined)?j:{};var k=(s.shadow!=undefined)?s.shadow:this.shadow;var B=(s.fill!=undefined)?s.fill:this.fill;var c=(s.fillAndStroke!=undefined)?s.fillAndStroke:this.fillAndStroke;u.bodyWidth=(s.bodyWidth!=undefined)?s.bodyWidth:u.bodyWidth;u.tickLength=(s.tickLength!=undefined)?s.tickLength:u.tickLength;A.save();if(this.show){var m,q,g,Q,t;for(var D=0;Dq){if(u.wickColor){y.color=u.wickColor}else{if(u.downBodyColor){y.color=u.downBodyColor}}f=a.extend(true,{},s,y);u.shapeRenderer.draw(A,[[m,g],[m,q]],f);u.shapeRenderer.draw(A,[[m,t],[m,Q]],f);y={};M=q;F=t-q;if(u.fillDownBody){y.fillRect=true}else{y.strokeRect=true;n=n-this.lineWidth;O=m-n/2}if(u.downBodyColor){y.color=u.downBodyColor;y.fillStyle=u.downBodyColor}C=[O,M,n,F]}else{if(u.wickColor){y.color=u.wickColor}f=a.extend(true,{},s,y);u.shapeRenderer.draw(A,[[m,g],[m,Q]],f);y={};y.fillRect=false;y.strokeRect=false;O=[m-n/2,q];M=[m+n/2,t];n=null;F=null;C=[O,M]}}f=a.extend(true,{},s,y);u.shapeRenderer.draw(A,C,f)}else{E=s.color;if(u.openColor){s.color=u.openColor}if(!u.hlc){u.shapeRenderer.draw(A,[[m-u._tickLength,q],[m,q]],s)}s.color=E;if(u.wickColor){s.color=u.wickColor}u.shapeRenderer.draw(A,[[m,g],[m,Q]],s);s.color=E;if(u.closeColor){s.color=u.closeColor}u.shapeRenderer.draw(A,[[m,t],[m+u._tickLength,t]],s);s.color=E}}}A.restore()};a.jqplot.OHLCRenderer.prototype.drawShadow=function(b,d,c){};a.jqplot.OHLCRenderer.checkOptions=function(d,c,b){if(!b.highlighter){b.highlighter={showMarker:false,tooltipAxes:"y",yvalues:4,formatString:'date: %s open: %s hi: %s low: %s close: %s
'}}}})(jQuery);
--------------------------------------------------------------------------------
/lib/jqplot/plugins/jqplot.pointLabels.min.js:
--------------------------------------------------------------------------------
1 | /* jqPlot 1.0.8r1250 | (c) 2009-2013 Chris Leonello | jplot.com
2 | jsDate | (c) 2010-2013 Chris Leonello
3 | */(function(c){c.jqplot.PointLabels=function(e){this.show=c.jqplot.config.enablePlugins;this.location="n";this.labelsFromSeries=false;this.seriesLabelIndex=null;this.labels=[];this._labels=[];this.stackedValue=false;this.ypadding=6;this.xpadding=6;this.escapeHTML=true;this.edgeTolerance=-5;this.formatter=c.jqplot.DefaultTickFormatter;this.formatString="";this.hideZeros=false;this._elems=[];c.extend(true,this,e)};var a=["nw","n","ne","e","se","s","sw","w"];var d={nw:0,n:1,ne:2,e:3,se:4,s:5,sw:6,w:7};var b=["se","s","sw","w","nw","n","ne","e"];c.jqplot.PointLabels.init=function(j,h,f,g,i){var e=c.extend(true,{},f,g);e.pointLabels=e.pointLabels||{};if(this.renderer.constructor===c.jqplot.BarRenderer&&this.barDirection==="horizontal"&&!e.pointLabels.location){e.pointLabels.location="e"}this.plugins.pointLabels=new c.jqplot.PointLabels(e.pointLabels);this.plugins.pointLabels.setLabels.call(this)};c.jqplot.PointLabels.prototype.setLabels=function(){var f=this.plugins.pointLabels;var h;if(f.seriesLabelIndex!=null){h=f.seriesLabelIndex}else{if(this.renderer.constructor===c.jqplot.BarRenderer&&this.barDirection==="horizontal"){h=(this._plotData[0].length<3)?0:this._plotData[0].length-1}else{h=(this._plotData.length===0)?0:this._plotData[0].length-1}}f._labels=[];if(f.labels.length===0||f.labelsFromSeries){if(f.stackedValue){if(this._plotData.length&&this._plotData[0].length){for(var e=0;eB||s+C>m){z.remove()}z=null;f=null}}};c.jqplot.postSeriesInitHooks.push(c.jqplot.PointLabels.init);c.jqplot.postDrawSeriesHooks.push(c.jqplot.PointLabels.draw)})(jQuery);
--------------------------------------------------------------------------------
/lib/jqplot/plugins/jqplot.trendline.min.js:
--------------------------------------------------------------------------------
1 | /* jqPlot 1.0.8r1250 | (c) 2009-2013 Chris Leonello | jplot.com
2 | jsDate | (c) 2010-2013 Chris Leonello
3 | */(function(f){f.jqplot.Trendline=function(){this.show=f.jqplot.config.enablePlugins;this.color="#666666";this.renderer=new f.jqplot.LineRenderer();this.rendererOptions={marker:{show:false}};this.label="";this.type="linear";this.shadow=true;this.markerRenderer={show:false};this.lineWidth=1.5;this.shadowAngle=45;this.shadowOffset=1;this.shadowAlpha=0.07;this.shadowDepth=3;this.isTrendline=true};f.jqplot.postSeriesInitHooks.push(e);f.jqplot.postDrawSeriesHooks.push(g);f.jqplot.addLegendRowHooks.push(a);function a(k){var j=null;if(k.trendline&&k.trendline.show){var i=k.trendline.label.toString();if(i){j={label:i,color:k.trendline.color}}}return j}function e(m,k,j,i,l){if(this._type&&(this._type==="line"||this._type=="bar")){this.trendline=new f.jqplot.Trendline();i=i||{};f.extend(true,this.trendline,{color:this.color},j.trendline,i.trendline);this.trendline.renderer.init.call(this.trendline,null)}}function g(m,i){i=f.extend(true,{},this.trendline,i);if(this.trendline&&i.show){var k;var l=i.data||this.data;k=c(l,this.trendline.type);var j=i.gridData||this.renderer.makeGridData.call(this,k.data);this.trendline.renderer.draw.call(this.trendline,m,j,{showLine:true,shadow:this.trendline.shadow})}}function b(w,v,n){var u=(n==null)?"linear":n;var s=w.length;var t;var z;var o=0;var m=0;var r=0;var q=0;var l=0;var j=[];var k=[];if(u=="linear"){k=w;j=v}else{if(u=="exp"||u=="exponential"){for(var p=0;p4 vane search'},
4 | {spiderType: '3 vane', diffractionPattern: '6 spikes in an hexagonal pattern', description: '3 vanes spaced at 120 degree angles', strength: 'slightly less diffraction than 4 vanes', weakness: '6 spikes vs 4 spikes for the 4 vane spider; susceptibility for large heavy diagonals to quiver because of weak torsional resistance', examples: '3 vane search '},
5 | {spiderType: 'bar', diffractionPattern: 'single bright spike stretching away from stars like outstretched hands', description: 'a single thick bar stretching from one side of the tube to the other', strength: 'easy to manufacture and mount', weakness: 'greater overall diffraction', examples: 'Coulter telescope single bar spider '},
6 | {spiderType: 'single stalk', diffractionPattern: 'single spike stretching away from stars like outstretched hands', description: 'a single stalk from edge of tube to diagonal holder', strength: 'easy to make', weakness: 'can bend', examples: '12.5 inch F6 with single stalk spider '},
7 | {spiderType: 'curved 3 vane spider', diffractionPattern: 'a smear of light around stars', description: '3 vane spider only with curved vanes', strength: 'when the vanes are highly curved, there is hardly any diffraction spikes', weakness: 'smeared light around stars', examples: 'curved 3 vane search '},
8 | {spiderType: 'curved single vane', diffractionPattern: 'a smear of light around stars', description: 'a single vane spider that is curved', strength: 'wehn the van is highly curved, there is hardly any dffraction spie', weakness: 'smeared light around stars', examples: 'a curved single vane spider '},
9 | {spiderType: 'V', diffractionPattern: 'two spikes at the angle of the V', description: 'shaped like the letter V', strength: 'robust and strong', weakness: 'typically more overall diffraction than a single stalk', examples: 'V shaped spider on a 14 inch with a shadow V spider for guiding '},
10 | {spiderType: 'wire spider', diffractionPattern: 'essentially none', description: 'wires, typically 8 incount, used to suspect the diagonal and holder', strength: 'lack of diffraction', weakness: 'complex to build; needs jig to center diagonal holder while wiring', examples: 'wire spider on a 25 inch '},
11 | {spiderType: '', diffractionPattern: '', description: '', strength: '', weakness: '', examples: ' '}
12 | ]
13 | };
14 |
--------------------------------------------------------------------------------
/lib/json/tubeTypes.js:
--------------------------------------------------------------------------------
1 | MLB.tubeTypesJson = {
2 | 'tubeTypes': [
3 | {tubeType: 'Solid', numberOfTrusses: 'na', localSeeingIssues: 'Must cool down mirror; insulate metal tubes', engineeringNotes: 'Round tubes available in many materials; can be octagonal or hexagonal; may be heavy in larger sizes; keep round at the ends; can be thought of as a single hollow truss tube with internal optics', examples: '8 inch Dob 10 inch hexagonal '},
4 | {tubeType: 'Bay', numberOfTrusses: 'na', localSeeingIssues: 'Exposed diagonal can dew', engineeringNotes: 'Can be cut from solid tube; can use wires', examples: 'McDonald Observatory 82 inch Lassell 48 inch '},
5 | {tubeType: 'One truss', numberOfTrusses: '1', localSeeingIssues: 'Exposed diagonal can dew', engineeringNotes: 'Single truss must be quite stiff', examples: 'Ross Sackett travelscopes Cambridge LiteScope Bob Cox folding Cassegrain '},
6 | {tubeType: 'A-frame', numberOfTrusses: '2', localSeeingIssues: 'Exposed diagonal can dew', engineeringNotes: 'Be careful of torque that twists the focuser board', examples: '12 inch A frame Dob '},
7 | {tubeType: 'Two truss - one side', numberOfTrusses: '2', localSeeingIssues: 'Exposed diagonal can dew', engineeringNotes: 'Be careful of torque that twists the focuser board', examples: 'Peter Pekurar 12 inch Hobbit telescope '},
8 | {tubeType: 'Two truss, two sides', numberOfTrusses: '2', localSeeingIssues: 'Exposed diagonal can dew', engineeringNotes: 'Diagonal holder is typically a single strut from one truss tube to the other', examples: 'ZipDob J frame '},
9 | {tubeType: 'Three straight truss', numberOfTrusses: '3', localSeeingIssues: 'Exposed diagonal can dew', engineeringNotes: 'See Albert Highes book', examples: 'DobStuff telescopes '},
10 | {tubeType: 'Four straight truss', numberOfTrusses: '4', localSeeingIssues: 'Exposed diagonal can dew', engineeringNotes: 'Similar to three straight trusses', examples: 'Greg Babcock travel scope Teleport collapsable telescope '},
11 | {tubeType: 'Six truss', numberOfTrusses: '6', localSeeingIssues: 'Exposed diagonal can dew', engineeringNotes: 'Similar to 8 truss designs but need wider base to prevent tubes from intruding into light path', examples: '20.5 inch TriDod '},
12 | {tubeType: 'Eight truss', numberOfTrusses: '8', localSeeingIssues: 'Exposed diagonal can dew', engineeringNotes: 'Truss tube connectors are critical', examples: '20.5 inch computerized altazimuth '},
13 | {tubeType: 'String (conventional)', numberOfTrusses: '6', localSeeingIssues: 'Exposed diagonal can dew', engineeringNotes: 'Portland, Oregon is a hotbed of string telescopes', examples: 'String scopes Ken Lulay\'s string scope '},
14 | {tubeType: 'Tensegrity (string+rod)', numberOfTrusses: '6', localSeeingIssues: 'Exposed diagonal can dew', engineeringNotes: 'Invented by Don Peckham; amazingly strong design', examples: 'Don Peckham Tensegrity telescopes '}
15 | ]
16 | };
17 |
--------------------------------------------------------------------------------
/lib/lens CG.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MelBartels/AstronomyCalculatorsJavaScript/063dc5c497f50157b480cfedf68dc6eb66d25c59/lib/lens CG.jpg
--------------------------------------------------------------------------------
/lib/lockwood 42 inch f3.75 54 pt support.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MelBartels/AstronomyCalculatorsJavaScript/063dc5c497f50157b480cfedf68dc6eb66d25c59/lib/lockwood 42 inch f3.75 54 pt support.jpg
--------------------------------------------------------------------------------
/lib/magnitudeCalc.js:
--------------------------------------------------------------------------------
1 | // copyright Mel Bartels, 2013-2021
2 |
3 | 'use strict';
4 |
5 | MLB.magnitudeCalc = {};
6 |
7 | MLB.magnitudeCalc.calcUsingPercent = function () {
8 | var magDecimals = 2,
9 | percent = +$('input[name=percent]').val(),
10 | roundToDecimal = MLB.sharedLib.roundToDecimal,
11 | getMagnitudeFromIllum = MLB.calcLib.getMagnitudeFromIllum,
12 | magDiff = -getMagnitudeFromIllum(percent / 100);
13 |
14 | $('input[name=magOutPercent]').val(roundToDecimal(magDiff, magDecimals));
15 | };
16 |
17 | MLB.magnitudeCalc.calcUsingAperture = function () {
18 | var magDecimals = 2,
19 | aperture1 = +$('input[name=aperture1]').val(),
20 | aperture2 = +$('input[name=aperture2]').val(),
21 | roundToDecimal = MLB.sharedLib.roundToDecimal,
22 | magnitudeDifferenceBetweenApertures = MLB.calcLib.magnitudeDifferenceBetweenApertures,
23 | magDiff = -magnitudeDifferenceBetweenApertures(aperture1, aperture2);
24 |
25 | $('input[name=magOutAperture]').val(roundToDecimal(magDiff, magDecimals));
26 | };
27 |
28 | MLB.magnitudeCalc.addMagnitudes = function () {
29 | var magDecimals = 2,
30 | magnitude1 = +$('input[name=magnitude1]').val(),
31 | magnitude2 = +$('input[name=magnitude2]').val(),
32 | roundToDecimal = MLB.sharedLib.roundToDecimal,
33 | adddMagnitudes = MLB.calcLib.addMagnitudes,
34 | combinedMagnitude = adddMagnitudes(magnitude1, magnitude2);
35 |
36 | $('input[name=combinedMagnitude]').val(roundToDecimal(combinedMagnitude, magDecimals));
37 | };
38 |
39 | MLB.magnitudeCalc.calcTotalMagnitude = function () {
40 | var magDecimals = 2,
41 | roundToDecimal = MLB.sharedLib.roundToDecimal,
42 | adddMagnitudes = MLB.calcLib.addMagnitudes,
43 | combinedMagnitude;
44 |
45 | combinedMagnitude = $('input[name=magnitudesToAdd]')
46 | .val()
47 | .split(/[ ,]+/)
48 | .filter(Number)
49 | .reduce((a, b) => adddMagnitudes(a, b));
50 |
51 | $('input[name=totalMagnitude]').val(roundToDecimal(combinedMagnitude, magDecimals));
52 | };
53 |
54 | $(window).ready(function () {
55 | var btnCalcPercent = $('#btnCalcPercent')[0],
56 | btnCalcAperture = $('#btnCalcAperture')[0],
57 | btnAddMagnitudes = $('#btnAddMagnitudes')[0],
58 | btnCalcTotalMagnitude = $('#btnCalcTotalMagnitude')[0],
59 | calcUsingPercent = MLB.magnitudeCalc.calcUsingPercent,
60 | calcUsingAperture = MLB.magnitudeCalc.calcUsingAperture,
61 | addMagnitudes = MLB.magnitudeCalc.addMagnitudes,
62 | calcTotalMagnitude = MLB.magnitudeCalc.calcTotalMagnitude;
63 |
64 | // event hookups/subscribes
65 | btnCalcPercent.onclick = function () {
66 | calcUsingPercent();
67 | };
68 | btnCalcAperture.onclick = function () {
69 | calcUsingAperture();
70 | };
71 | btnAddMagnitudes.onclick = function () {
72 | addMagnitudes();
73 | };
74 | btnCalcTotalMagnitude.onclick = function () {
75 | calcTotalMagnitude();
76 | };
77 |
78 | calcUsingPercent();
79 | calcUsingAperture();
80 | addMagnitudes();
81 | });
82 |
83 | // end of file
--------------------------------------------------------------------------------
/lib/matrix initialization errors.xls:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MelBartels/AstronomyCalculatorsJavaScript/063dc5c497f50157b480cfedf68dc6eb66d25c59/lib/matrix initialization errors.xls
--------------------------------------------------------------------------------
/lib/meniscusMirrorMakingClass.js:
--------------------------------------------------------------------------------
1 | // copyright Mel Bartels, 2023
2 |
3 | 'use strict';
4 |
5 | MLB.meniscusMirrorMakingClass = {};
6 |
7 | // form passes itself via this.form ('this' is the input element and 'form' is its surrounding form)
8 |
9 | MLB.meniscusMirrorMakingClass.calculateMirrorWeight = (form) => {
10 | var roundToDecimal = MLB.sharedLib.roundToDecimal,
11 | isMeniscus = form.chBoxIsMeniscus.checked,
12 | weight = MLB.calcLib.calcMirrorWeight(form.mirrorDia.value, form.focalRatio.value, form.edgeThickness.value, isMeniscus);
13 |
14 | form.results.value = roundToDecimal(weight, 1) + ' pounds';
15 | };
16 |
17 | MLB.meniscusMirrorMakingClass.calculateToolVolume = (form) => {
18 | var roundToDecimal = MLB.sharedLib.roundToDecimal,
19 | volume = MLB.calcLib.calcToolVolume(form.mirrorDia.value, form.focalRatio.value, form.plasterThickness.value);
20 |
21 | form.results.value = roundToDecimal(volume, 0) + ' cubic inches';
22 | };
23 |
24 | MLB.meniscusMirrorMakingClass.calcSphereToParabolaDifference = (form) => {
25 | var mirrorDia = form.mirrorDia.value,
26 | focalRatio = form.focalRatio.value,
27 | diff = MLB.calcLib.calcSphereParabolaDifference(mirrorDia, focalRatio);
28 |
29 | form.results.value = diff;
30 | };
31 |
32 | MLB.meniscusMirrorMakingClass.calcSagittaSpherical = (form) => {
33 | var roundToDecimal = MLB.sharedLib.roundToDecimal,
34 | mirrorDia = form.mirrorDia.value,
35 | focalRatio = form.focalRatio.value,
36 | sagitta = MLB.calcLib.calcSagittaSpherical(mirrorDia, focalRatio);
37 |
38 | form.sagitta.value = roundToDecimal(sagitta, 3) + ' inches';;
39 | };
40 |
41 | MLB.meniscusMirrorMakingClass.calcFocalRatioAndFocalLength = (form) => {
42 | var roundToDecimal = MLB.sharedLib.roundToDecimal,
43 | mirrorDia = form.mirrorDia.value,
44 | sagitta = form.sagitta.value,
45 | focalRatio = MLB.calcLib.calcFocalRatio(mirrorDia, sagitta),
46 | focalLength = mirrorDia * focalRatio;
47 |
48 | form.focalRatio.value = 'f/' + roundToDecimal(focalRatio, 2) + '; focal length = ' + roundToDecimal(focalLength, 2) + ' inches';
49 | };
50 |
51 | // end of file
--------------------------------------------------------------------------------
/lib/mirror cell 54 pt support naming.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MelBartels/AstronomyCalculatorsJavaScript/063dc5c497f50157b480cfedf68dc6eb66d25c59/lib/mirror cell 54 pt support naming.jpg
--------------------------------------------------------------------------------
/lib/motorLib.js:
--------------------------------------------------------------------------------
1 | // copyright Mel Bartels, 2014
2 | // see motorLib unitTests.htm for unit tests; also the motor calculator, motorCalc.htm
3 | // turn on jslint's Tolerate ++ and --
4 |
5 | 'use strict';
6 |
7 | MLB.motorLib = {};
8 |
9 | MLB.motorLib.drive = function () {
10 | this.name = undefined;
11 | this.speedReductions = [];
12 | this.totalReduction = undefined;
13 | };
14 |
15 | MLB.motorLib.driveBuilder = function (name) {
16 | var drive = new MLB.motorLib.drive();
17 | drive.name = name;
18 | return drive;
19 | };
20 |
21 | MLB.motorLib.addReduction = function (drive, name, reduction) {
22 | if (!isNaN(reduction)) {
23 | drive.speedReductions.push({name: name, reduction: reduction});
24 | MLB.motorLib.calcTotalReduction(drive);
25 | }
26 | };
27 |
28 | MLB.motorLib.calcTotalReduction = function (drive) {
29 | var ix,
30 | speedReductionsLength = drive.speedReductions.length;
31 |
32 | drive.totalReduction = 1;
33 | for (ix = 0; ix < speedReductionsLength; ix++) {
34 | drive.totalReduction *= drive.speedReductions[ix].reduction;
35 | }
36 | };
37 |
38 | MLB.motorLib.calcMotorEncoderTicksPerArcsec = function (drive) {
39 | return drive.totalReduction * MLB.sharedLib.uom.arcsecToRev;
40 | };
41 |
42 | MLB.motorLib.calcRPMs = function (drive, driveAngularSpeedDegreesPerSecond) {
43 | var ix,
44 | speedReductionsLength = drive.speedReductions.length,
45 | runningReduction = 1,
46 | rpms = [];
47 |
48 | for (ix = speedReductionsLength - 1; ix > -1; ix--) {
49 | runningReduction *= drive.speedReductions[ix].reduction;
50 | // 'x' deg/sec * 1 rev/360deg * 60 sec/min = x/6 rev/min (rpms)
51 | rpms[ix] = driveAngularSpeedDegreesPerSecond / 6 * runningReduction;
52 | }
53 | return rpms;
54 | };
55 |
56 | MLB.motorLib.calcTotalReductionUnitsPerSec = function (drive, driveAngularSpeedDegreesPerSecond) {
57 | // 'x' deg/sec * 1 rev/360deg = x/360 rev/sec
58 | return driveAngularSpeedDegreesPerSecond / 360 * drive.totalReduction;
59 | };
60 |
61 | MLB.motorLib.calcMaxSlewSpeedDegSec = function (drive, maxMotorRPM) {
62 | // eg, maxMotorRPM = 1800; 1800rpm * 1min/60sec = 30rps; 30rps * 10,000 encoder ticks/motorRev = 300,000 encoder ticks/sec; 300,000 encoder ticks/sec * 1296000 arcsec/totalReduction(ticks/rev of 37800000) = 10285.714285714286 arcsec/sec; 10285.714285714286 arcsec/sec * 1deg/3600arcsec = 2.857142857142857 deg/sec
63 | // constant of 6 derived from 1min/60sec * 1296000arcsec/rev * 1deg/3600arcsec = 6 min-deg/sec-rev
64 | // or 1800 motorRev/min * 10,000 encoder ticks/motorRev / totalReduction(ticks/rev of 37800000) * 6 min-deg/sec-rev = 2.8571428571428568
65 | // uoms: motorRev-ticks-rev-min-deg/min-motorRev-ticks-sec-rev = deg/sec
66 | // alternatively, return maxMotorRPM / 60 * drive.speedReductions[0].reduction / MLB.sharedLib.uom.arcsecToRev / drive.totalReduction / 3600;
67 | return maxMotorRPM * drive.speedReductions[0].reduction / drive.totalReduction * 6;
68 | };
69 |
70 | // end of file
71 |
--------------------------------------------------------------------------------
/lib/objectContrastCalc.js:
--------------------------------------------------------------------------------
1 | /*global
2 | MLB,$,window,document
3 | */
4 | /*jslint
5 | this, for
6 | */
7 |
8 | // copyright Mel Bartels, 2018-2020
9 |
10 | 'use strict';
11 |
12 | MLB.objectContrastCalc = {};
13 |
14 | MLB.objectContrastCalc.util = {
15 | magnitudeDecimalPlaces: 2,
16 | contrastResultDecimalPlaces: 1,
17 | magnificationDecimalPlaces: 0,
18 |
19 | objMPAS: function () {
20 | return $('[name=objMPAS]');
21 | },
22 | objMag: function () {
23 | return $('[name=objMag]');
24 | },
25 | objSize1: function () {
26 | return $('[name=objSize1]');
27 | },
28 | objSize2: function () {
29 | return $('[name=objSize2]');
30 | },
31 | skyMPAS: function () {
32 | return $('[name=skyMPAS]');
33 | },
34 | ccntrastResult: function () {
35 | return $('[name=ccntrastResult]');
36 | },
37 | btnCalcObjectMPAS: function () {
38 | return $('input[id=btnCalcObjectMPAS]');
39 | },
40 | btnCalcContrast: function () {
41 | return $('input[id=btnCalcContrast]');
42 | },
43 | objMPASVal: function () {
44 | return +this.objMPAS().val();
45 | },
46 | objMagVal: function () {
47 | return +this.objMag().val();
48 | },
49 | objSize1Val: function () {
50 | return +this.objSize1().val();
51 | },
52 | objSize2Val: function () {
53 | return +this.objSize2().val();
54 | },
55 | skyMPASVal: function () {
56 | return +this.skyMPAS().val();
57 | }
58 | };
59 |
60 | MLB.objectContrastCalc.calcObjectMPAS = function () {
61 | var util = MLB.objectContrastCalc.util,
62 | uom = MLB.sharedLib.uom,
63 | getMagnitudeFromIllum = MLB.calcLib.getMagnitudeFromIllum,
64 | roundToDecimal = MLB.sharedLib.roundToDecimal,
65 | magDrop = getMagnitudeFromIllum(uom.sqrArcminToSqrArcsec * util.objSize1Val() * util.objSize2Val());
66 |
67 | util.objMPAS().val(roundToDecimal(util.objMagVal() - magDrop, util.magnitudeDecimalPlaces));
68 | };
69 |
70 | MLB.objectContrastCalc.calcContrast = function () {
71 | var util = MLB.objectContrastCalc.util,
72 | getMagnitudeFromIllum = MLB.calcLib.getMagnitudeFromIllum,
73 | getIllumFromMagnitude = MLB.calcLib.getIllumFromMagnitude,
74 | roundToDecimal = MLB.sharedLib.roundToDecimal,
75 | objMPAS = util.objMPASVal(),
76 | skyMPAS = util.skyMPASVal(),
77 | objectPlusSkyMPAS = getMagnitudeFromIllum(getIllumFromMagnitude(objMPAS) + getIllumFromMagnitude(skyMPAS)),
78 | // ex: object=24.5 MPAS, sky=21.5 MPAS, obj+sky=21.43 MPAS; 21.43 contrast to 21.5 = MPAS difference of 0.24 MPAS or 106% compared to background (=1=100%) or 6% difference
79 | contrast = getIllumFromMagnitude(objectPlusSkyMPAS - skyMPAS) - 1,
80 | objectSize1 = util.objSize1Val(),
81 | objectSize2 = util.objSize2Val(),
82 | largestObjectSize = objectSize1 > objectSize2
83 | ? objectSize1
84 | : objectSize2,
85 | magnificationFiveDegApparentSize = 300 / largestObjectSize,
86 | magnificationHundredDegApparentSize = 6000 / largestObjectSize;
87 |
88 | if (magnificationFiveDegApparentSize < 1) {
89 | magnificationFiveDegApparentSize = 1;
90 | }
91 | if (magnificationHundredDegApparentSize < 1) {
92 | magnificationHundredDegApparentSize = 1;
93 | }
94 |
95 | util.ccntrastResult().html('Object = '
96 | + roundToDecimal(objMPAS, util.magnitudeDecimalPlaces)
97 | + ' MPAS sky = '
98 | + roundToDecimal(skyMPAS, util.magnitudeDecimalPlaces)
99 | + ' MPAS object+sky = '
100 | + roundToDecimal(objectPlusSkyMPAS, util.magnitudeDecimalPlaces)
101 | + ' MPAS Contrast of object+sky to sky = '
102 | + roundToDecimal(contrast * 100, util.contrastResultDecimalPlaces)
103 | + '% difference. Magnification needed for 5 degree apparent size = '
104 | + roundToDecimal(magnificationFiveDegApparentSize, util.magnificationDecimalPlaces)
105 | + 'X; for 100 degree apparent size = '
106 | + roundToDecimal(magnificationHundredDegApparentSize, util.magnificationDecimalPlaces)
107 | + 'X.');
108 | };
109 |
110 | $(window).ready(function () {
111 | var util = MLB.objectContrastCalc.util,
112 | calcObjectMPAS = MLB.objectContrastCalc.calcObjectMPAS,
113 | calcContrast = MLB.objectContrastCalc.calcContrast;
114 |
115 | // event hookups/subscribes
116 | util.btnCalcObjectMPAS().click(calcObjectMPAS);
117 | util.btnCalcContrast().click(calcContrast);
118 |
119 | calcObjectMPAS();
120 | calcContrast();
121 | });
122 |
123 | // end of file
--------------------------------------------------------------------------------
/lib/pitch lap calc examples.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MelBartels/AstronomyCalculatorsJavaScript/063dc5c497f50157b480cfedf68dc6eb66d25c59/lib/pitch lap calc examples.jpg
--------------------------------------------------------------------------------
/lib/precessionCalc.js:
--------------------------------------------------------------------------------
1 | // copyright Mel Bartels, 2013-2014
2 |
3 | 'use strict';
4 |
5 | MLB.precessionCalc = {};
6 |
7 | MLB.precessionCalc.precessionCalcState = {
8 | position: new MLB.coordLib.Position()
9 | };
10 |
11 | MLB.precessionCalc.calc = function () {
12 | var RA,
13 | Dec,
14 | fromYear,
15 | toYear,
16 | RARadians,
17 | DecRadians,
18 | precession,
19 | limitToHundredthsArcsec = true,
20 | limitToTenthsArcsec = true,
21 | convertRadiansToHMSMString = MLB.coordLib.convertRadiansToHMSMString,
22 | convertRadiansToDMSMString = MLB.coordLib.convertRadiansToDMSMString,
23 | dateTodayString = MLB.coordLib.dateTodayString,
24 | calcPrecessionRigorous = MLB.coordLib.calcPrecessionRigorous,
25 | parseCoordinateGetValueInRadians = MLB.coordLib.parseCoordinateGetValueInRadians;
26 |
27 | if ($('input[name=toYear]').val() === '') {
28 | $('input[name=toYear]').val(new Date().getFullYear());
29 | }
30 |
31 | // set vars from user input using jquery;
32 | // fromYear is a number, the rest are strings
33 | RA = $('input[name=RA]').val();
34 | Dec = $('input[name=Dec]').val();
35 | fromYear = +$('input[name=fromYear]').val();
36 | toYear = +$('input[name=toYear]').val();
37 |
38 | RARadians = parseCoordinateGetValueInRadians(RA, true).radians;
39 | DecRadians = parseCoordinateGetValueInRadians(Dec).radians;
40 |
41 | precession = calcPrecessionRigorous(RARadians, DecRadians, fromYear, toYear - fromYear);
42 |
43 | $('input[name=RAout]').val(convertRadiansToHMSMString(RARadians + precession.deltaRA, limitToHundredthsArcsec));
44 | $('input[name=Decout]').val(convertRadiansToDMSMString(DecRadians + precession.deltaDec, limitToTenthsArcsec));
45 | };
46 |
47 | $(window).ready(function () {
48 | var btnPrecess = $('input[id=btnPrecess]'),
49 | calc = MLB.precessionCalc.calc;
50 |
51 | // event hookups/subscribes
52 | btnPrecess.click(function () {
53 | calc();
54 | });
55 |
56 | calc();
57 | });
58 |
59 | // end of file
--------------------------------------------------------------------------------
/lib/refractionCalc.js:
--------------------------------------------------------------------------------
1 | // copyright Mel Bartels, 2011-2014
2 |
3 | 'use strict';
4 |
5 | MLB.refractionCalc = {};
6 |
7 | MLB.refractionCalc.plot = function () {
8 | var elevation,
9 | refractionPoint,
10 | series,
11 | seriesLabels,
12 | seriesLabel = MLB.sharedLib.seriesLabel,
13 | uom = MLB.sharedLib.uom,
14 | calcRefractionFromTrue = MLB.coordLib.calcRefractionFromTrue;
15 |
16 | series = [];
17 | refractionPoint = [];
18 | for (elevation = 0; elevation <= 90; elevation++) {
19 | refractionPoint.push([calcRefractionFromTrue(elevation) / uom.arcminToRad, elevation]);
20 | }
21 | series.push(refractionPoint);
22 | // build the series labels
23 | seriesLabels = [seriesLabel('refraction')];
24 |
25 | // plot it, include replot
26 | $.jqplot.config.enablePlugins = true;
27 | $.jqplot('refractionChart', series, {
28 | title: 'Plot of refraction for elevation',
29 | legend: {
30 | show: true,
31 | placement: 'outsideGrid'
32 | },
33 | axes: {
34 | xaxis: {
35 | tickRenderer: $.jqplot.CanvasAxisTickRenderer,
36 | label: 'refraction (arc minutes)',
37 | labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
38 | numberTicks: 9,
39 | max: 40,
40 | min: 0
41 | },
42 | yaxis: {
43 | tickRenderer: $.jqplot.CanvasAxisTickRenderer,
44 | label: 'elevation (degrees)',
45 | labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
46 | numberTicks: 10,
47 | max: 90,
48 | min: 0
49 | }
50 | },
51 | series: seriesLabels
52 | }).replot();
53 | };
54 |
55 | $(window).ready(function () {
56 | MLB.refractionCalc.plot();
57 | });
58 |
59 | // end of file
60 |
--------------------------------------------------------------------------------
/lib/rotational vectors test example.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MelBartels/AstronomyCalculatorsJavaScript/063dc5c497f50157b480cfedf68dc6eb66d25c59/lib/rotational vectors test example.jpg
--------------------------------------------------------------------------------
/lib/sharedLib.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MelBartels/AstronomyCalculatorsJavaScript/063dc5c497f50157b480cfedf68dc6eb66d25c59/lib/sharedLib.js
--------------------------------------------------------------------------------
/lib/slumpingCalc.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MelBartels/AstronomyCalculatorsJavaScript/063dc5c497f50157b480cfedf68dc6eb66d25c59/lib/slumpingCalc.js
--------------------------------------------------------------------------------
/lib/threeAxisLib unitTests.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | QUnit test for threeAxisLib.js
5 |
6 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
86 |
87 |
--------------------------------------------------------------------------------
/lib/underscore/Underscore.js_files/Underscore Test Suite_files/chaining.js.download:
--------------------------------------------------------------------------------
1 | (function() {
2 | var _ = typeof require == 'function' ? require('..') : window._;
3 |
4 | QUnit.module('Chaining');
5 |
6 | test('map/flatten/reduce', function() {
7 | var lyrics = [
8 | 'I\'m a lumberjack and I\'m okay',
9 | 'I sleep all night and I work all day',
10 | 'He\'s a lumberjack and he\'s okay',
11 | 'He sleeps all night and he works all day'
12 | ];
13 | var counts = _(lyrics).chain()
14 | .map(function(line) { return line.split(''); })
15 | .flatten()
16 | .reduce(function(hash, l) {
17 | hash[l] = hash[l] || 0;
18 | hash[l]++;
19 | return hash;
20 | }, {}).value();
21 | equal(counts.a, 16, 'counted all the letters in the song');
22 | equal(counts.e, 10, 'counted all the letters in the song');
23 | });
24 |
25 | test('select/reject/sortBy', function() {
26 | var numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
27 | numbers = _(numbers).chain().select(function(n) {
28 | return n % 2 === 0;
29 | }).reject(function(n) {
30 | return n % 4 === 0;
31 | }).sortBy(function(n) {
32 | return -n;
33 | }).value();
34 | deepEqual(numbers, [10, 6, 2], 'filtered and reversed the numbers');
35 | });
36 |
37 | test('select/reject/sortBy in functional style', function() {
38 | var numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
39 | numbers = _.chain(numbers).select(function(n) {
40 | return n % 2 === 0;
41 | }).reject(function(n) {
42 | return n % 4 === 0;
43 | }).sortBy(function(n) {
44 | return -n;
45 | }).value();
46 | deepEqual(numbers, [10, 6, 2], 'filtered and reversed the numbers');
47 | });
48 |
49 | test('reverse/concat/unshift/pop/map', function() {
50 | var numbers = [1, 2, 3, 4, 5];
51 | numbers = _(numbers).chain()
52 | .reverse()
53 | .concat([5, 5, 5])
54 | .unshift(17)
55 | .pop()
56 | .map(function(n){ return n * 2; })
57 | .value();
58 | deepEqual(numbers, [34, 10, 8, 6, 4, 2, 10, 10], 'can chain together array functions.');
59 | });
60 |
61 | test('splice', function() {
62 | var instance = _([1, 2, 3, 4, 5]).chain();
63 | deepEqual(instance.splice(1, 3).value(), [1, 5]);
64 | deepEqual(instance.splice(1, 0).value(), [1, 5]);
65 | deepEqual(instance.splice(1, 1).value(), [1]);
66 | deepEqual(instance.splice(0, 1).value(), [], '#397 Can create empty array');
67 | });
68 |
69 | test('shift', function() {
70 | var instance = _([1, 2, 3]).chain();
71 | deepEqual(instance.shift().value(), [2, 3]);
72 | deepEqual(instance.shift().value(), [3]);
73 | deepEqual(instance.shift().value(), [], '#397 Can create empty array');
74 | });
75 |
76 | test('pop', function() {
77 | var instance = _([1, 2, 3]).chain();
78 | deepEqual(instance.pop().value(), [1, 2]);
79 | deepEqual(instance.pop().value(), [1]);
80 | deepEqual(instance.pop().value(), [], '#397 Can create empty array');
81 | });
82 |
83 | test('chaining works in small stages', function() {
84 | var o = _([1, 2, 3, 4]).chain();
85 | deepEqual(o.filter(function(i) { return i < 3; }).value(), [1, 2]);
86 | deepEqual(o.filter(function(i) { return i > 2; }).value(), [3, 4]);
87 | });
88 |
89 | test('#1562: Engine proxies for chained functions', function() {
90 | var wrapped = _(512);
91 | strictEqual(wrapped.toJSON(), 512);
92 | strictEqual(wrapped.valueOf(), 512);
93 | strictEqual(+wrapped, 512);
94 | strictEqual(wrapped.toString(), '512');
95 | strictEqual('' + wrapped, '512');
96 | });
97 |
98 | }());
99 |
--------------------------------------------------------------------------------
/lib/underscore/Underscore.js_files/Underscore Test Suite_files/cross-document.js.download:
--------------------------------------------------------------------------------
1 | (function() {
2 | if (typeof document == 'undefined') return;
3 |
4 | var _ = typeof require == 'function' ? require('..') : window._;
5 |
6 | QUnit.module('Cross Document');
7 | /* global iObject, iElement, iArguments, iFunction, iArray, iError, iString, iNumber, iBoolean, iDate, iRegExp, iNaN, iNull, iUndefined, ActiveXObject */
8 |
9 | // Setup remote variables for iFrame tests.
10 | var iframe = document.createElement('iframe');
11 | iframe.frameBorder = iframe.height = iframe.width = 0;
12 | document.body.appendChild(iframe);
13 | var iDoc = (iDoc = iframe.contentDocument || iframe.contentWindow).document || iDoc;
14 | iDoc.write(
15 | [
16 | ''
32 | ].join('\n')
33 | );
34 | iDoc.close();
35 |
36 | test('isEqual', function() {
37 |
38 | ok(!_.isEqual(iNumber, 101));
39 | ok(_.isEqual(iNumber, 100));
40 |
41 | // Objects from another frame.
42 | ok(_.isEqual({}, iObject), 'Objects with equivalent members created in different documents are equal');
43 |
44 | // Array from another frame.
45 | ok(_.isEqual([1, 2, 3], iArray), 'Arrays with equivalent elements created in different documents are equal');
46 | });
47 |
48 | test('isEmpty', function() {
49 | ok(!_([iNumber]).isEmpty(), '[1] is not empty');
50 | ok(!_.isEmpty(iArray), '[] is empty');
51 | ok(_.isEmpty(iObject), '{} is empty');
52 | });
53 |
54 | test('isElement', function() {
55 | ok(!_.isElement('div'), 'strings are not dom elements');
56 | ok(_.isElement(document.body), 'the body tag is a DOM element');
57 | ok(_.isElement(iElement), 'even from another frame');
58 | });
59 |
60 | test('isArguments', function() {
61 | ok(_.isArguments(iArguments), 'even from another frame');
62 | });
63 |
64 | test('isObject', function() {
65 | ok(_.isObject(iElement), 'even from another frame');
66 | ok(_.isObject(iFunction), 'even from another frame');
67 | });
68 |
69 | test('isArray', function() {
70 | ok(_.isArray(iArray), 'even from another frame');
71 | });
72 |
73 | test('isString', function() {
74 | ok(_.isString(iString), 'even from another frame');
75 | });
76 |
77 | test('isNumber', function() {
78 | ok(_.isNumber(iNumber), 'even from another frame');
79 | });
80 |
81 | test('isBoolean', function() {
82 | ok(_.isBoolean(iBoolean), 'even from another frame');
83 | });
84 |
85 | test('isFunction', function() {
86 | ok(_.isFunction(iFunction), 'even from another frame');
87 | });
88 |
89 | test('isDate', function() {
90 | ok(_.isDate(iDate), 'even from another frame');
91 | });
92 |
93 | test('isRegExp', function() {
94 | ok(_.isRegExp(iRegExp), 'even from another frame');
95 | });
96 |
97 | test('isNaN', function() {
98 | ok(_.isNaN(iNaN), 'even from another frame');
99 | });
100 |
101 | test('isNull', function() {
102 | ok(_.isNull(iNull), 'even from another frame');
103 | });
104 |
105 | test('isUndefined', function() {
106 | ok(_.isUndefined(iUndefined), 'even from another frame');
107 | });
108 |
109 | test('isError', function() {
110 | ok(_.isError(iError), 'even from another frame');
111 | });
112 |
113 | if (typeof ActiveXObject != 'undefined') {
114 | test('IE host objects', function() {
115 | var xml = new ActiveXObject('Msxml2.DOMDocument.3.0');
116 | ok(!_.isNumber(xml));
117 | ok(!_.isBoolean(xml));
118 | ok(!_.isNaN(xml));
119 | ok(!_.isFunction(xml));
120 | ok(!_.isNull(xml));
121 | ok(!_.isUndefined(xml));
122 | });
123 |
124 | test('#1621 IE 11 compat mode DOM elements are not functions', function() {
125 | var fn = function() {};
126 | var xml = new ActiveXObject('Msxml2.DOMDocument.3.0');
127 | var div = document.createElement('div');
128 |
129 | // JIT the function
130 | var count = 200;
131 | while (count--) {
132 | _.isFunction(fn);
133 | }
134 |
135 | equal(_.isFunction(xml), false);
136 | equal(_.isFunction(div), false);
137 | equal(_.isFunction(fn), true);
138 | });
139 | }
140 |
141 | }());
--------------------------------------------------------------------------------
/lib/underscore/Underscore.js_files/Underscore Test Suite_files/placeholder.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/lib/underscore/Underscore.js_files/Underscore Test Suite_files/saved_resource.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/lib/underscore/Underscore.js_files/a_documentcloud_project.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MelBartels/AstronomyCalculatorsJavaScript/063dc5c497f50157b480cfedf68dc6eb66d25c59/lib/underscore/Underscore.js_files/a_documentcloud_project.png
--------------------------------------------------------------------------------
/lib/underscore/Underscore.js_files/underscore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MelBartels/AstronomyCalculatorsJavaScript/063dc5c497f50157b480cfedf68dc6eb66d25c59/lib/underscore/Underscore.js_files/underscore.png
--------------------------------------------------------------------------------
/magnitude.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Magnitude Calculator
7 |
8 |
9 |
10 |
11 |
12 |
17 |
18 |
19 | Percent transmission
20 |
21 | % =
22 |
23 |
24 | change in magnitude.
25 |
26 |
27 |
28 |
29 |
30 | Compare aperture of
31 |
32 | to aperture of
33 |
34 | =
35 |
36 |
37 | change in magnitude.
38 |
39 |
40 |
41 |
42 |
43 | Add magnitude of
44 |
45 | to magnitude of
46 |
47 | =
48 |
49 |
50 | combined magnitude.
51 |
52 |
53 |
54 |
55 |
56 | Enter a series of magnitudes to add (can be space delimited or comma delimited)
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/objectLib.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Object Description Decoder
7 |
8 |
9 |
10 |
11 |
12 |
16 |
17 |
18 |
19 | Shorthand object description
20 |
21 |
22 | translates to
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 | Load SAC CSV file by clicking the button to browse or dragging the file onto the button...
32 |
33 |
34 | ...or drag and drop the file here.
35 |
36 |
Cancel read
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/precession.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MelBartels/AstronomyCalculatorsJavaScript/063dc5c497f50157b480cfedf68dc6eb66d25c59/precession.html
--------------------------------------------------------------------------------
/readme.txt:
--------------------------------------------------------------------------------
1 | This code comprises a series of calculators (see Calculators.html).
2 |
3 | The working webpage is at http://bbastrodesigns.com/Calculators.html.
4 |
5 | Mel Bartels
--------------------------------------------------------------------------------
/refraction.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Refraction Calculator
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | Interpreting the chart:
16 |
17 | Plots refraction versus elevation in degrees. Refraction causes the object to appear higher in the sky than they are in reality. When the Sun sets, we see it touch the horizon when it has already set.
18 |
19 | Mel Bartels
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/sagitta.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Sagitta Calculator
7 |
8 |
9 |
10 |
11 |
102 |
103 |
104 | Notes:
105 |
106 | Calculates parabolic and spherical sagitta from mirror diameter and either mirror focal length or mirror focal ratio.
107 |
108 | The difference between the sagitta of a spherical and parabolic curve is very small and is typically ignored. In fact, it is the amount that the center needs to be deepened to bring the mirror from spherical to paraboloidal (though the most common method of parabolizing deepends the center somewhat and deepens the edge somewhat, splitting the difference).
109 |
110 | The waves of correction uses inches as the unit of measurement. If you are using another unit of measurement, then convert. For instance, if entering values in millimeters, then divide the resulting waves of correction by 25.4.
111 |
112 | Curious how fast a table needs to rotate so that gravity forms a parabola? The calculation expects the focal length in inches.
113 |
114 | Mel Bartels
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
--------------------------------------------------------------------------------
/scopeToSky.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MelBartels/AstronomyCalculatorsJavaScript/063dc5c497f50157b480cfedf68dc6eb66d25c59/scopeToSky.html
--------------------------------------------------------------------------------
/slumpingCalc.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Mirror Slumping Calculator
7 |
8 |
9 |
10 |
11 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 | Interpreting the plot:
65 |
66 | When a flat piece of glass is slumped, it is bent over a mold. This slightly reduces the effective or entrance aperture. This calculator displays the precise effective aperture, needed in CAD applications. The edge also bends outward, creating a slight angle. This edge angle is also noted. The sagitta is the spherical sagitta, the depth at the center of the mirror. This differs slightly from the parabolic sagitta, the mirror depth necessary for a particular radius of curvature for a parabolic primary.
67 |
68 | The equation is simple: effectiveAperture = mirrorDiameter * focalRatio * 4 * Sin(1 / (4 * focalRatio)). The '1/(4*focalRatio)' is half the angle that the mirror subtends from the radius of curvature and is also the edge angle from the mirror center line.
69 |
70 | Mel Bartels
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/telescopeCriteriaCalc.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Please travel here for my improved Newtonian Telescope Designer with better workflow and user interface.
10 |
11 |
--------------------------------------------------------------------------------
/trajectory.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Trajectory Calculator
7 |
8 |
9 |
10 |
11 |
12 |
13 |
74 |
75 |
76 |
77 |
78 | Notes:
79 |
80 | This calculator finds the quickest trajectory that concludes coincident to the target trajectory, that is, concluding on the target with the target's speed. The target trajectory is assumed to move at constant speed. The chase trajectory is a trapezoidal trajectory with constant acceleration, deceleration and a maximum speed.
81 |
82 | In the 1990s I wanted to add satellite tracking to my computerized telescope. It is not easy to slew across the sky to precisely center a fast moving satellite in the eyepiece. I found a paper on radio telescopes that had math on trajectory matching but was clearly wrong. Deriving the correct math was a modest but interesting exercise. Details on the derivation and the Javascript functions can be found at http://www.bbastrodesigns.com/lib/trajLib.js . Corresponding unit tests can be found at http://www.bbastrodesigns.com/lib/trajLib%20unitTests.htm .
83 |
84 | Mel Bartels
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
--------------------------------------------------------------------------------