-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcam.html
More file actions
1642 lines (1409 loc) · 54.4 KB
/
cam.html
File metadata and controls
1642 lines (1409 loc) · 54.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<!--
todo:
Shouldn't recalculate igram when nothing changed
test on safari, firefox
sac = "synthetic aperture cropping" aka "stop cropping" aka "virtual pinhole cropping"
Helps you pick out a camera and lens for interferometry
version 1.3
1.0 initial release
1.1 Added search control for narrowing down cameras
1.2 minor changes: "start by entering mirror details", added sony cameras, automatically detects if you just need 4k pixels and no other issues,
added iphone 11, recommended camera chooser has major updates including only Nikon cropped cameras
1.3 fixed bug in recommend() where it wasn't setting the sensor size and if you had recently chosen an iphone it messed up
1.4 Changed "sac" to "virtual pinhole". Warn if focus distance is less than likely minimum lens focusing distance.
-->
<head>
<title>
Camera and Lens chooser tool for Bath Interferometry
</title>
<style>
body {
font-family: sans-serif;
}
button {
border-radius : 0.3em;
}
@media (max-width: 1000px){
body, td, input, br, button, select { font-size: 3vw;
text-size-adjust: 100%; /* Prevent automatic scaling */
-webkit-text-size-adjust: 100%; /* For WebKit browsers */
}
input[type="radio"] {width: 2.3vw; height: 2.3vw;}
.info {width: 2.3vw;}
}
@media (min-width:1000px){
body, td, input, br, button, select { font-size: 30px;
text-size-adjust: 100%; /* Prevent automatic scaling */
-webkit-text-size-adjust: 100%; /* For WebKit browsers */
}
input[type="radio"] {width: 20px; height: 20px;}
.info {width: 23px;}
}
.overlay {
opacity: 0.5;
position:fixed;
top:0;
left:0;
height:100%;
width:100%;
background-color:black;
z-index:5;
}
button {margin: 0.15em;}
.graybox {
display: inline-block;
border:1px solid black;
border-radius:10px;
padding:5px;
background-color:#E0E0E0;
}
h3 {
margin-top:15px;
margin-bottom:15px;
}
.cls_null {
color:gray;
font-size: smaller;
}
}
</style>
</head>
<body>
<h2>Camera and Lens chooser tool for Bath Interferometry</h2>
<table border="0" style="border:1px black solid;padding:5;border-radius:10px;background-color:#E0E0E0;">
<tr>
<td colspan=3>
<center><h3 id='idStartBy'><font color=blue>Start by entering mirror details</font></h3></center>
<center><h3>Mirror</h3></center>
</td>
</tr>
<tr>
<td colspan=3>
Mirror Units:
<input type="radio" name="units" id="idmm" value="mm" onclick="unitclick(this)" checked ><label for="idmm">mm</label>
<input type="radio" name="units" id="idin" value="inches" onclick="unitclick(this)"><label for="idin">inches</label>
</td>
</tr>
<tr>
<td rowspan=2 valign=top>
Mirror diameter
<input type="text" size=3 value=300 onKeyUp=updateDiam() id="idDiamtxt">
</td>
<td>
<input type="radio" name="radf" id="idradfnum" value="fnum" checked onclick="radfclick(this)"><label for="idradfnum" id="idLabelFnum" >f/#</label>
</td>
<td>
<input type="text" id="idfnumtxt" value="4" size=3 onKeyUp="fnumchange()" onfocus="fnumfocus()">
</td>
</tr>
<tr>
<td>
<input type="radio" name="radf" id="idradfl" value="fl" onclick="radfclick(this)"><label for="idradfl" id="idLabelFL">focal length</label>
</td>
<td>
<input type="text" id="idfltxt" value="0" size=3 onKeyUp="flchange()" onfocus="flfocus()">
</td>
</tr>
<tr>
<td colspan=3>
Conic constant <input type="text" size=2 value=-1 id='idCC' onKeyUp="update()"> <span id='idNull' class='cls_null'></span><br>
(-1 for parabolic mirror, 0 for spherical)
</td>
</tr>
</table>
<br>
<div class='graybox'>
<center><h3>Camera</h3></center>
<div id='idBtnDiv'><button id='idBtnChooseCamera' type='button'>Please click here to choose a camera!</button><span id='idCamDescription'></span></div><p>
<!-- popup window camera type -->
<div id='idPopup1' style="display: inline-block;border:1px solid black;border-radius:10px;padding:5;background-color:#E0E0E0;position:absolute; display:none; margin:10px; padding: 20px;z-index:10;">
<button id='idBtnRec'>I don't have a camera, please recommend one...</button><br>
<button id='idBtnNik'>Nikon...</button><br>
<button id='idBtnCan'>Canon...</button><br>
<button id='idBtnSony'>Sony</button><br>
<button id='idBtnCel'>Cell Phone</button><br>
<button id='idBtnRas'>Raspberry Pi HQ Cam</button><br>
<button id='idBtnWeb'>Web Cam</button><br>
<button id='idBtnOth'>Other</button>
<a href="javascript:void(0);" id='idClose1' style="float:right">Close</a>
</div>
<!-- popup window camera list -->
<div id='idPopup2' style="display: inline-block;border:1px solid black;border-radius:10px;padding:5;background-color:#E0E0E0;position:absolute; display:none; margin:10px; padding: 20px;z-index:10;">
</div>
<!-- popup msgbox -->
<div id='idMsgBox' style="display: inline-block;border:1px solid black;border-radius:10px;padding:5;background-color:#E0E0E0;position:absolute; display:none; margin:10px; padding: 20px;z-index:20;">
<span id='idSpanMsgBox'></span>
<a href="javascript:void(0);" id='idCloseMB' style="float:right">Close</a>
</div>
<!-- popup gray screen -->
<div id='idDarken' class="overlay" style='display:none'></div>
Camera sensor vertical size: <input type="text" id="idsensor" value="16" size=3 onKeyUp="update()"> mm
<br>
<input type='radio' name='vertSensor' id='idradMegaPix' value='mp' onclick="radMPclick(this)" checked>
<label for="idradMegaPix" id='idLabelMP'>
Camera megapixels:
</label>
<input type="text" id="idtxtMP" value="14.2" size=3 onKeyUp='MPchange()' onfocus='MPFocus()'>
<label for="idradMegaPix" id="idLabelMP2">
(assume 3:2 sensor ratio)
</label>
<br>
<input type='radio' name='vertSensor' id='idradVertPix' value='vp' onclick="radMPclick(this)">
<label for="idradVertPix" id='idLabelVertPix'>
Camera sensor vertical pixels:
</label>
<input type="text" id="idtxtVertPixels" value="2000" size=4 onKeyUp='vertPixChange()' onfocus='vertPixFocus()'>
<button id='idBtnSearch' title='show all cameras with this resolution or higher'>Search</button> <img src="i.png" class="info" id='idSearch_info'>
</div>
<p>
<div class='graybox'>
<center><h3>Camera Lens</h3></center>
<center><button id='idBtnChooseLens' type='button'>Please click here to choose a lens!</button><span id='idLensDescription'></span></center><p style="margin-bottom:5px;">
Camera lens focal length: <input type="text" id="idLensFL" value="50" size=3 onKeyUp="update()"> mm
Lens f/#: <input type="text" id="idLensFnum" value="1.8" size=3 onKeyUp="update()">
</div>
<br>
<div style="">
Calculated results. Problems detected will have red text.<br>
<span id='idMinFocus'></span>
Camera FOV: <span id='idCamFOV'></span><br>
Mirror FOV: <span id='idMirrorFOV'></span><br>
Diameter of igram in pixels: <span id='idPixelDiam'></span><br>
Pixels per fringe (smallest fringe):
<span id='idppf'></span> <img src="i.png" class="info" title="abc" id='idppf_info'><br>
<span id='idsac0'>
Estimated portion of igram available after lens cropping (blue circle in diagram below):
<span id='idsac'></span> <img src="i.png" class="info" title="abc" id='idsac_info'><br></span>
<span id='idsac1'></span>
<span id='idNote'></span>
</div>
<br>
<canvas id='idCanvas' width="500" height="602" '></canvas> <!-- 300 for top diagram, 300 for bottom, 2 for gap between -->
<p>
Another way to look at this whole concept of "cameras compatible with mirrors for the Bath" is shown in <a href='cam_chart.html'>interactive graphical form here.</a>
<script src="jquery-3.7.1.min.js"></script>
<script>
// brand 1=nikon 2-canon
var selected_cam=null;
var selected_lens=null;
function brand_to_str(brand)
{
switch(brand)
{
case 1:return "Nikon";
case 2:return "Canon";
case 3:return "Olympus";
}
}
var camera_data=
[
{brand:1,name:"D1",sensor_mm:15.6,sensor_pixels:1312, prob:"no live view"},
{brand:1,name:"D1H",sensor_mm:15.6,prob:"no live view"},
{brand:1,name:"D1X",sensor_mm:15.6,prob:"no live view"},
{brand:1,name:"D2H",sensor_mm:15.6,prob:"no live view"},
{brand:1,name:"D2Hs",sensor_mm:15.6,prob:"no live view"},
{brand:1,name:"D2Xs",sensor_mm:15.6,prob:"no live view"},
{brand:1,name:"D3",sensor_mm:23.9,sensor_pixels:2832},
{brand:1,name:"D3X",sensor_mm:23.9,sensor_pixels:4032},
{brand:1,name:"D3S",sensor_mm:23.9,sensor_pixels:2832},
{brand:1,name:"D4",sensor_mm:23.9,sensor_pixels:3280},
{brand:1,name:"D4S",sensor_mm:23.9,sensor_pixels:3280},
{brand:1,name:"D5",sensor_mm:23.9,sensor_pixels:3712},
{brand:1,name:"D6",sensor_mm:23.9,sensor_pixels:3712},
{brand:1,name:"D40",prob:"no live view"},
{brand:1,name:"D40x",prob:"no live view"},
{brand:1,name:"D60",prob:"no live view"},
{brand:1,name:"D3000",prob:"no live view"},
{brand:1,name:"D3100",sensor_mm:15.4,sensor_pixels:3072},
{brand:1,name:"D3200",sensor_mm:15.4,sensor_pixels:4000},
{brand:1,name:"D3300",sensor_mm:15.6,sensor_pixels:4000},
{brand:1,name:"D3400",sensor_mm:15.6,sensor_pixels:4000},
{brand:1,name:"D3500",sensor_mm:15.6,sensor_pixels:4000},
{brand:1,name:"D5000",sensor_mm:15.8,sensor_pixels:2848},
{brand:1,name:"D5100",sensor_mm:15.8,sensor_pixels:3264},
{brand:1,name:"D5200",sensor_mm:15.6,sensor_pixels:4000},
{brand:1,name:"D5300",sensor_mm:15.6,sensor_pixels:4000},
{brand:1,name:"D5500",sensor_mm:15.6,sensor_pixels:4000},
{brand:1,name:"D5600",sensor_mm:15.6,sensor_pixels:4000},
{brand:1,name:"D50",sensor_mm:15.8,sensor_pixels:2000,prob:"no live view"},
{brand:1,name:"D70",prob:"no live view"},
{brand:1,name:"D70s",prob:"no live view"},
{brand:1,name:"D80",prob:"no live view"},
{brand:1,name:"D90",sensor_mm:15.8,sensor_pixels:2848},
{brand:1,name:"D7000",sensor_mm:15.6,sensor_pixels:3264},
{brand:1,name:"D7100",sensor_mm:15.6,sensor_pixels:4000},
{brand:1,name:"D7200",sensor_mm:15.6,sensor_pixels:4000},
{brand:1,name:"D7500",sensor_mm:15.7,sensor_pixels:3712},
{brand:1,name:"D100",prob:"no live view"},
{brand:1,name:"D200",prob:"no live view"},
{brand:1,name:"D300",sensor_mm:15.8,sensor_pixels:2848},
{brand:1,name:"D300s",sensor_mm:15.8,sensor_pixels:2848},
{brand:1,name:"D500",sensor_mm:15.7,sensor_pixels:3712},
{brand:1,name:"D600",sensor_mm:23.9,sensor_pixels:4016},
{brand:1,name:"D610",sensor_mm:23.9,sensor_pixels:4016},
{brand:1,name:"D750",sensor_mm:23.9,sensor_pixels:4016},
{brand:1,name:"D780",sensor_mm:23.9,sensor_pixels:4024},
{brand:1,name:"D700",sensor_mm:23.9,sensor_pixels:2832},
{brand:1,name:"D800",sensor_mm:24,sensor_pixels:4912},
{brand:1,name:"D800E",sensor_mm:24,sensor_pixels:4912},
{brand:1,name:"Df",sensor_mm:23.9,sensor_pixels:3280},
{brand:1,name:"D810",sensor_mm:24,sensor_pixels:4912},
{brand:1,name:"D810A",sensor_mm:24,sensor_pixels:4912},
{brand:1,name:"D850",sensor_mm:23.9,sensor_pixels:5504},
{brand:1,name:"Z30",sensor_mm:15.7,sensor_pixels:3712},
{brand:1,name:"Z50",sensor_mm:15.7,sensor_pixels:3712},
{brand:1,name:"Z50ii",sensor_mm:15.7,sensor_pixels:3712},
{brand:1,name:"Zfc",sensor_mm:15.7,sensor_pixels:3712},
{brand:1,name:"Z5",sensor_mm:23.9,sensor_pixels:4016},
{brand:1,name:"Zf",sensor_mm:23.9,sensor_pixels:4032},
{brand:1,name:"Z6",sensor_mm:23.9,sensor_pixels:4032},
{brand:1,name:"Z6ii",sensor_mm:23.9,sensor_pixels:4032},
{brand:1,name:"Z7",sensor_mm:23.9,sensor_pixels:5504},
{brand:1,name:"Z7ii",sensor_mm:23.9,sensor_pixels:5504},
{brand:1,name:"Z8",sensor_mm:23.9,sensor_pixels:5504},
{brand:1,name:"Z9",sensor_mm:23.9,sensor_pixels:5504},
{brand:2,name:"EOS 1DC",sensor_mm:24,mp:17.9},
{brand:2,name:"EOS 1DX",sensor_mm:24,mp:17.9},
{brand:2,name:"EOS 1DX Mark ii",sensor_mm:23.9,mp:20},
{brand:2,name:"EOS 1DX Mark iii",sensor_mm:24,mp:20},
{brand:2,name:"EOS 1DS",prob:"no live view"},
{brand:2,name:"EOS 1DS Mark ii",prob:"no live view"},
{brand:2,name:"EOS 1DS Mark iii",sensor_mm:24,mp:21},
{brand:2,name:"EOS 1DS Mark iv",sensor_mm:18.6,sensor_pixels:3264},
{brand:2,name:"EOS 1D",prob:"no live view"},
{brand:2,name:"EOS 1D Mark ii",prob:"no live view"},
{brand:2,name:"EOS 1D Mark ii N",prob:"no live view"},
{brand:2,name:"EOS 1D Mark III",sensor_mm:18.7,sensor_pixels:2594},
{brand:2,name:"EOS 5D",prob:"no live view"},
{brand:2,name:"EOS 5D Mark ii",sensor_mm:24,mp:21},
{brand:2,name:"EOS 5D Mark iii",sensor_mm:24,mp:22.1},
{brand:2,name:"EOS 5D Mark iv",sensor_mm:24,mp:30.1},
{brand:2,name:"EOS 5DS",sensor_mm:24,mp:50.3},
{brand:2,name:"EOS 5DS R",sensor_mm:24,mp:50.3},
{brand:2,name:"EOS 6D",sensor_mm:24,mp:20},
{brand:2,name:"EOS 6D Mark ii",sensor_mm:24,mp:26},
{brand:2,name:"EOS 7D",sensor_mm:14.9,mp:17.9},
{brand:2,name:"EOS 7D Mark ii",sensor_mm:15,mp:20.0},
{brand:2,name:"EOS 70D",sensor_mm:15,mp:20},
{brand:2,name:"EOS 77D",sensor_mm:14.9,mp:24},
{brand:2,name:"EOS 80D",sensor_mm:14.9,mp:24},
{brand:2,name:"EOS 90D",sensor_mm:14.8,mp:32.3},
{brand:2,name:"EOS 60Da",sensor_mm:14.9,sensor_pixels:3456},
{brand:2,name:"EOS 60D",sensor_mm:14.9,sensor_pixels:3456},
{brand:2,name:"EOS 50D",sensor_mm:14.9,sensor_pixels:3168},
{brand:2,name:"EOS 40D",sensor_mm:14.8,sensor_pixels:2592},
{brand:2,name:"EOS 30D",prob:"no live view"},
{brand:2,name:"EOS 20D",prob:"no live view"},
{brand:2,name:"EOS 20Da",sensor_mm:15,sensor_pixels:2344},
{brand:2,name:"EOS 10D",prob:"no live view"},
{brand:2,name:"EOS SL1/100D",sensor_mm:14.9,sensor_pixels:3456},
{brand:2,name:"EOS SL2/200D",sensor_mm:14.9,mp:24},
{brand:2,name:"EOS SL3/250D",sensor_mm:14.9,mp:24},
{brand:2,name:"EOS DIGITAL REBEL/300D",prob:"no live view"},
{brand:2,name:"EOS XT/350D",prob:"no live view"},
{brand:2,name:"EOS XTi/400D",prob:"no live view"},
{brand:2,name:"EOS XSi/450D",sensor_mm:14.8,mp:12.2},
{brand:2,name:"EOS T1I/500D",sensor_mm:14.9,sensor_pixels:3168},
{brand:2,name:"EOS T2i/550D",sensor_mm:14.9,sensor_pixels:3456},
{brand:2,name:"EOS T3i/600D",sensor_mm:14.9,sensor_pixels:3456},
{brand:2,name:"EOS T4i/650D",sensor_mm:14.9,sensor_pixels:3456},
{brand:2,name:"EOS T5i/700D",sensor_mm:14.9,sensor_pixels:3456},
{brand:2,name:"EOS T6i/750D",sensor_mm:14.9,mp:24},
{brand:2,name:"EOS T6S/760D",sensor_mm:14.9,mp:24},
{brand:2,name:"EOS T7i/800D",sensor_mm:14.9,mp:24},
{brand:2,name:"EOS T8i/850D",sensor_mm:14.9,mp:24},
{brand:2,name:"EOS T3/1100D",sensor_mm:14.8,mp:12.2},
{brand:2,name:"EOS T5/1200D",sensor_mm:14.9,sensor_pixels:3456},
{brand:2,name:"EOS T6/1300D",sensor_mm:14.9,sensor_pixels:3456},
{brand:2,name:"EOS T7/2000D",sensor_mm:14.9,mp:24},
{brand:2,name:"EOS T100/4000D",sensor_mm:14.9,sensor_pixels:3456},
{brand:2,name:"EOS M",sensor_mm:14.9,sensor_pixels:3456},
{brand:2,name:"EOS M2",sensor_mm:14.9,sensor_pixels:3476},
{brand:2,name:"EOS M3",sensor_mm:14.9,mp:24.2},
{brand:2,name:"EOS M5",sensor_mm:14.9,mp:24.2},
{brand:2,name:"EOS M6",sensor_mm:14.9,mp:24.2},
{brand:2,name:"EOS M6 Mark ii",sensor_mm:24,mp:31.7},
{brand:2,name:"EOS M10",sensor_mm:14.9,sensor_pixels:3456},
{brand:2,name:"EOS M50",sensor_mm:14.9,mp:24.1},
{brand:2,name:"EOS M50 Mark ii",sensor_mm:14.9,mp:24.1},
{brand:2,name:"EOS M100",sensor_mm:14.9,sensor_pixels:4000},
{brand:2,name:"EOS M200",sensor_mm:14.9,sensor_pixels:4000},
{brand:2,name:"EOS R",sensor_mm:24,sensor_pixels:4480},
{brand:2,name:"EOS Ra",sensor_mm:24,sensor_pixels:2160},
{brand:2,name:"EOS RP",sensor_mm:24,mp:26.2},
{brand:2,name:"EOS R1",sensor_mm:24,mp:24.2},
{brand:2,name:"EOS R3",sensor_mm:24,sensor_pixels:4000},
{brand:2,name:"EOS R5",sensor_mm:24,sensor_pixels:5464},
{brand:2,name:"EOS R5 Mark ii",sensor_mm:24,mp:45},
{brand:2,name:"EOS R6",sensor_mm:24,sensor_pixels:3648},
{brand:2,name:"EOS R6 Mark ii",sensor_mm:24,mp:24.2},
{brand:2,name:"EOS R7",sensor_mm:14.8,mp:32.5},
{brand:2,name:"EOS R8",sensor_mm:24,mp:24.2},
{brand:2,name:"EOS R10",sensor_mm:14.9,sensor_pixels:4000},
{brand:2,name:"EOS R50",sensor_mm:14.9,mp:24.2},
{brand:2,name:"EOS R100",sensor_mm:24,mp:24.1},
];
function isMirrorless(cam)
{
if (cam.brand==1 && cam.name.substr(0,1)=="Z") return true;
if (cam.brand==2 && (cam.name.substr(0,5)=="EOS M" || cam.name.substr(0,5)=="EOS R")) return true;
return false;
}
function findCam(name)
{
// returns index into array
for(i=0;i<camera_data.length; i++)
{
if (camera_data[i].name == name)
return i;
}
return -1;
}
camera_data.sort(function(a,b)
{
var am=isMirrorless(a);
var bm=isMirrorless(b);
if (am==bm)
return a.name.localeCompare(b.name,'en',{numeric:true})
if (am) return 1;
return -1;
});
console.log(camera_data.length);
/*
for(i=0; i<camera_data.length; i++)
{
cam = camera_data[i];
if (cam.prob)continue;
var pix;
if (cam.sensor_pixels)
pix = cam.sensor_pixels;
else
pix = Math.sqrt(cam.mp*1000000/1.5);
if (pix>5000)
console.log(cam.name+" sensor "+pix);
}*/
function makeCameraRadios(brand, minpixels, sens_type)
{
// type 0=all 1=full frame 2=small sensor
if (!sens_type)sens_type=0;
save_brand = brand;
save_minpixels = minpixels;
str="";
if (minpixels)
str+="<select id='idselsens'><option value=0>all</option><option value=1>full frame (sometimes better when mirror<F/3)</option><option value=2>small sensor (better option 99% of time)</option></select><br>";
column=0;
prev_cam="";
for(i=0; i<camera_data.length; i++)
{
cam = camera_data[i];
if (brand != "*" && cam.brand != brand) continue;
if (minpixels && get_vert_pixels(i) < minpixels) continue;
if (minpixels && cam.prob) continue;
if (sens_type==1 && cam.sensor_mm < 20) continue;
if (sens_type==2 && cam.sensor_mm > 20) continue;
column++;
if (cam.brand != prev_cam.brand)
{
str+="<p>"+brand_to_str(cam.brand)+"<br>";
column=1;
}else if (isMirrorless(cam) && isMirrorless(prev_cam) == false)
{
str+="<p>mirrorless<br>";
column=1;
}
str+= "<button onclick='chose_cam("+i+")'";
if (cam.prob)
str+=" style='color:#900'";
else if (["D3100","D3200","D3300","D3400"].includes(cam.name) ||
cam.name.indexOf("1100D")>=0 ||
cam.name.indexOf("1200D")>=0 ||
cam.name.indexOf("1300D")>=0 ||
cam.name.indexOf("2000D")>=0
)
str+=" style='color:#090'";
str+=">"+cam.name+"</button>";
if (column % 4 == 0)
str+="<br>";
else
str+=" ";
prev_cam=cam;
}
str+="<a href='javascript:void(0);' id='idClose2' style='float:right'>Close</a>";
$('#idPopup2').html(str);
$('#idselsens').val(sens_type);
$('#idselsens').change(sensor_select_changed);
$('#idClose2').click(close_dialog2);
}
var save_brand;
var save_minpixels;
function sensor_select_changed()
{
makeCameraRadios(save_brand, save_minpixels, $('#idselsens').val());
}
var chosen_cam=false;
function chose_cam(i,bDontCloseMessageBox)
{
cam = camera_data[i];
chosen_cam=cam;
if (cam.prob)
{
messagebox("This camera (and all the red ones) don't have live view. You really can't use this camera. Do you have another? I recommend one of the green ones which are around USD $200 used.",null);
return;
}
selected_cam = cam;
$('#idsensor').val(cam.sensor_mm);
if (cam.sensor_pixels)
{
$('#idtxtMP').val((cam.sensor_pixels*cam.sensor_pixels*1.5/1000000).toFixed(1));
$('#idtxtVertPixels').val(cam.sensor_pixels);
vertPixFocus();
}
else
{
$('#idtxtMP').val(cam.mp);
$('#idtxtVertPixels').val(Math.round(Math.sqrt(cam.mp*1000000/1.5)));
MPFocus();
}
$('#idLensFL').val("50");
$('#idLensFnum').val("2");
var brand;
switch (cam.brand)
{
case 1:
brand ="Nikon";
break;
case 2:
brand ="Canon";
break;
}
$('#idCamDescription').text(brand+" "+cam.name);
$('#idCamDescription').css("color","blue");
close_dialog2();
update();
$('#idBtnChooseCamera').css("color","black");
$('#idBtnChooseCamera').text("click to change camera");
// now we have lots of data - let's see what minimum pixels are for a 50mm lens is, see what range of lenses will work well
// max focal length such that any higher focal length will crop the image (no margin included)
max_focal_length = 50* mirrorFOV / camFOV;
// minimum focal length such that we run out of pixels (no margin included)
min_focal_length = 50*4/ppf;
//alert("min fl: "+min_focal_length.toFixed(1)+" max fl: "+max_focal_length.toFixed(1));
if (bDontCloseMessageBox == null || bDontCloseMessageBox == false)
$('#idMsgBox').fadeOut(200);
/*
var sensorPixels; // vertical
var lensFL;
var sensorMM;
var camFOV; // ratio - 2 means F/2
var mirrorFOV; // ratio (2x the mirror F/# so 8.2 for an F/4.1 mirror)
var camFOVdeg; // in degrees
var mirrorFOVdeg; // in degrees
var mirrorFOVmm;
var cc; // conic constant
var mirror_diam; // in mm
var z8; // null value in wyant waves of S.A.
var ppf; // pixels per fringe worst case
*/
}
function info_text(id, txt)
{
// set both hover and click text for this help button
$('#'+id).attr('title', txt);
$('#'+id).click(function(){alert(txt);})
}
info_text('idppf_info', "You need at least 4 pixels per fringe for color cameras due to the bayer filter. 2ppf on bw cameras with no bayer filter.");
info_text('idsac_info', "Must be > 100%. This is hard to explain and I hope to post a video but your lens aperture might not be big enough to fit the whole igram. The igram is a cone of light exiting the interferometer, if that cone expands too fast and you can't get the camera lens close enough to the expanding point then your camera lens will crop the igram and will be unusable. The text will only turn red if it is estimated that you won't be able to see the whole igram even with the camera lens touching the splitter cube. Estimates are based on 5 lenses for DSLR cameras and not valid for other much smaller lenses such as cell phone lenses.");
info_text('idSearch_info',"Click 'Search' to show all cameras with this resolution or higher");
/*
setSizes();
$(window).resize(setSizes); // call again if window is resized
*/
//
// create an array called "lookup", used by col() (color), that will do a very fast sine wave transformation - much faster than Math.sin()
//
var steps = 400;
var lookup = new Array(steps+1);
for(var i=0; i<steps; i++)
lookup[i] = (Math.sin( (i-steps/2)/(steps/2)*3.1415926/2)+1)*127;
lookup[steps]=255; // takes care of almost impossible case where input is 1
// col() converts x which is 0 to 1 into an output from 0 to 255 on a sine curve
let vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);
//console.log(vw);
var radioPosition="mm"; // versus "inches"
fnumchange();
radfclick(get('idradfnum'));
MPFocus();
radMPclick(get('idradMegaPix'));
MPchange();
update();
function synth_apeture_cropping(fl, aperture, bZoom)
{
// returns sensor fov in mm. Note that if we are cropping too much we need larger aperture lens (not necessarily larger focal length)
// estimates how much cropping will occur due to the inherent synthetic aperture in a Bath Interferometer
// fl = focal length of lens
// bZoom is true for zoom lenses (zoom lenses will have a heavily cropped view compared to fixed fl lenses
var data=[[0,0,0],[28,10,10.8],[35,19.4,14.1],[50,27.8,38.6],[85,47.2,82],[135,67.5,105]]; // fl, aperture, fov in mm
// find nearest 2 data points and linearly interpolate between
var i1,i2;
for(var i=0; i<data.length; i++)
{
if (data[i][0]>fl || i == data.length-1)
{
if (i==0)
{
// return first 2 points
i1=0;
i2=1;
}
else if (i == data.length-1)
{
// return last 2 points
i2=i;
i1=i-1;
}
else
{
i1=i-1;
i2=i;
}
break;
}
}
var fl1=data[i1][0];
var fl2=data[i2][0];
var ap1=data[i1][1];
var ap2=data[i2][1];
var fov1=data[i1][2];
var fov2=data[i2][2];
// based on fl, linear interpolate aperture and vfov constants
var li_aperture = ap1*(fl2-fl)/(fl2-fl1) + ap2*(fl-fl1)/(fl2-fl1);
var li_fov = fov1*(fl2-fl)/(fl2-fl1) + fov2*(fl-fl1)/(fl2-fl1);
// yes I could have just found ratio of aperture/fov but this is easier for me to read
// and even my data table could have stored the ratio
var fovmm = li_fov*aperture/li_aperture; // bigger aperture gives you (roughly linear) bigger field of view
if (bZoom) fovmm /=2; // obviously very rough and this is from data from only 2 zoom lenses
return fovmm;
}
function choose_camera_close()
{
$('#idPopup1').fadeOut(200);
$('#idDarken').hide();
}
function choose_camera()
{
$('#idPopup1').fadeIn(200);
$('#idDarken').show();
}
function get_vert_pixels(i)
{
var cam=camera_data[i];
if (cam.sensor_pixels)
return cam.sensor_pixels;
else
return Math.round(Math.sqrt(cam.mp*1000000/1.5));
}
function choose_lens()
{
if ($('#idCamDescription').text().substr(0,6) == "Ras Pi")
{
messagebox("Sorry, not available for this camera at this time. You'll have to enter manually below.");
return;
}
$('#idLensFL').val('50');
$('#idLensFnum').val('2');
update();
while (mirrorFOVdeg / camFOVdeg >= 1)
{
// ppf calculations not done because igram doesn't fit in FOV so start by shrinking lens
$('#idLensFL').val($('#idLensFL').val()/2);
update();
}
// max focal length such that any higher focal length will crop the image (no margin included)
max_focal_length = lensFL* mirrorFOV / camFOV;
// minimum focal length such that we run out of pixels (no margin included)
min_focal_length = lensFL*4/ppf;
str="To achieve 4 pixels per fringe, absolute <b>minimum focal length</b>: "+min_focal_length.toFixed(1)+"<br>";
str+="To keep igram within vertical field of view <b>maximum focal length</b>: "+max_focal_length.toFixed(0)+"<br>";
// are there any lenses in this range?
if (min_focal_length > max_focal_length)
{
pixels_needed = Math.round(sensorPixels*min_focal_length/max_focal_length);
str+="No such lens exists. You need a camera with at least "+pixels_needed+" vertical pixels.<br>";
var qty=0;
for (i=0; i<camera_data.length; i++)
if (get_vert_pixels(i) > pixels_needed)
qty++;
else
console.log(camera_data[i].name);
str+=""+qty+" cameras in my database have that many pixels.<br>Please solve this issue before choosing a lens.";
messagebox(str,null,true);
return;
}
if (min_focal_length >= 35 && sensorMM > 12 && sensorMM < 18)
{
var min_pixels= min_focal_length/40*sensorMM;
if (sensorMM>12 && sensorMM < 23 && min_pixels < 3300)
str+="It might be cheaper to switch to a camera with more megapixels so that you can use a (much cheaper) 50mm lens.<br>";
}
if (min_focal_length > 40 && sensorMM > 23)
{
var min_pixels= min_focal_length/40*sensorMM;
if (min_pixels > 4000 && min_pixels < 6000)
str="I didn't do all the math, but there's a good chance it's cheaper to switch from full frame to a camera with a smaller sensor because it will probably save you a lot of money on the lens if you don't already have the right one.<br>";
}
var sac = synth_apeture_cropping(lensFL, lensFL/lensFNum, false);
var sac_percent = sac/mirrorFOVmm*100;
var bSolutionFound=false;
// 50mm work?
if (min_focal_length < 35 && max_focal_length > 55)
{
bSolutionFound=true;
if (sac_percent > 150)
{
str+="50mm F/2 lens will work and it's the cheapest possible lens<br>Avoid using zoom lenses because of the virtual pinhole issue.<img src='i.png' class='info' id='idsac_info2'><br>";
}
else if (sac_percent > 110)
str+="50mm F/2 lens will barely work but I recommend you get a wider aperture such as F/1.8 so the lens doesn't have to be right up against the splitter.<br>";
else if (sac_percent > 60)
{
var fnum_desired = sac_percent/100*2; // *2 because F/2 was used to calculate the sac (virtual pinhole)
str+="50mm focal length works but you need an aperture of F/"+fnum_desired.toFixed(2)+" (or faster) and at that f/# lens it would need to touch the splitter. <br>";
}
}
else if (max_focal_length <= 55 && max_focal_length > 40 && min_focal_length < 25)
{
// 35mm?
$('#idLensFL').val('35');
$('#idLensFnum').val('1.8');
update();
sac = synth_apeture_cropping(lensFL, lensFL/lensFNum, false);
sac_percent = sac/mirrorFOVmm*100;
if (sac > 150)
{
str+="35mm F/1.8 will work and not very expensive.<br>Avoid using zoom lenses because of the virtual pinhole issue.<img src='i.png' class='info' id='idsac_info2'><br>";
bSolutionFound=true;
}
else
{
var fnum_desired = sac_percent/100*1.8; // *1.8 because F/1.8 was used to calculate the sac
str+="35mm works but you need an aperture of F/"+fnum_desired.toFixed(2)+" (or faster) and at that f/# lens it would need to touch the splitter<br>";
}
}
if (bSolutionFound == false)
{
str+="To <b>decrease lens min</b> fl, increase camera resolution.<br>";
str+="To <b>decrease lens min and max</b> fl, use a camera with a smaller sensor size<br>";
}
if (min_focal_length*2 > max_focal_length)
{
}
// deal with sac (synth aperture cropping)
messagebox(str,null,true);
info_text('idsac_info2', "Avoid using zoom lenses: This is hard to explain and I hope to post a video but your lens aperture might not be big enough to fit the whole igram. The igram is a cone of light exiting the interferometer, if that cone expands too fast and you can't get the camera lens close enough to the expanding point then your camera lens will crop the igram and will be unusable. This is particularly bad with zoom lenses. Although less so for lenses whose minimum zoom is 100mm. It's much more of a problem for zoom lenses that can go wide angle.");
}
$('#idBtnChooseCamera').css("color","blue");
$('#idBtnChooseCamera').css("text-align","center");
//$('#idBtnChooseCamera').css("border-radius","0.3em");
$('#idBtnDiv').css("text-align","center");
function col(x) // (color)
{
return lookup[Math.floor(x*steps)];
}
function min(a,b) { return a<b ? a: b; }
// the following are all filled in when calling update()
var sensorPixels; // vertical
var lensFL;
var sensorMM;
var camFOV; // ratio - 2 means F/2
var mirrorFOV; // ratio (2x the mirror F/# so 8.2 for an F/4.1 mirror)
var camFOVdeg; // in degrees
var mirrorFOVdeg; // in degrees
var mirrorFOVmm; // size of igram on camera sensor
var cc; // conic constant
var mirror_diam; // in mm
var z8; // null value in wyant waves of S.A.
var ppf; // pixels per fringe worst case
var lensFNum; // fnum of camera lens
function update()
{
// calculate igram size on sensor
sensorPixels = parseFloat(get('idtxtVertPixels').value);
lensFL = parseFloat(get('idLensFL').value);
sensorMM = parseFloat(get('idsensor').value);
camFOV = lensFL/sensorMM;
camFOVdeg = Math.atan(1/camFOV/2)*2*180/3.14159;
mirrorFNum = parseFloat(get('idfnumtxt').value);
mirrorFOV = mirrorFNum*2;
mirrorFOVdeg = Math.atan(1/mirrorFOV/2)*2*180/3.14159;
mirrorFOVmm = camFOV/mirrorFOV*sensorMM;
cc = parseFloat(get('idCC').value);
mirror_diam = get('idDiamtxt').value;
if (get('idin').checked)
mirror_diam *=25.4;
lensFNum = $('#idLensFnum').val();
$('#idsac1').html('');
$('#idNote').html('');
var mirrorROC = $('#idfltxt').val()*2;
if (radioPosition != "mm")
mirrorROC*=25.4;
/*if (mirrorROC < 300)
$('#idNote').html("<br><font color='#ec0'>Your focal length is very short. Some camera lenses can't focus this short. Please check for this issue yourself. The camera lens needs to be able to focus at a distance of "+(mirrorROC/10).toFixed(0)+" cm</font>");*/
var wl=650;
z8 = cc*(mirror_diam/(wl/1000000))/(3072 * mirrorFNum * mirrorFNum * mirrorFNum);
$('#idNull').text("SA Null "+z8.toFixed(1)+" Waves");
get('idMirrorFOV').innerHTML=mirrorFOVdeg.toFixed(1)+" deg";
if (mirrorFOVdeg > camFOVdeg)
{
suggested_camera_focal_length = mirrorFOV*sensorMM;
get('idCamFOV').innerHTML=camFOVdeg.toFixed(1)+" deg (need cam lens f.l. < "+suggested_camera_focal_length.toFixed(0)+"mm)";
get('idCamFOV').style.color='red';
}
else if (mirrorFOVdeg*1.2 > camFOVdeg)
{
get('idCamFOV').innerHTML=camFOVdeg.toFixed(1)+" deg (Field of View) (shorter f.l. lens might be better)";
get('idCamFOV').style.color='#ec0';
}
else
{
get('idCamFOV').innerHTML=camFOVdeg.toFixed(1)+" deg (Field of View)";
get('idCamFOV').style.color='black';
}
igramPixels = sensorPixels * camFOV/mirrorFOV;
get('idPixelDiam').innerHTML = igramPixels.toFixed(0);
if (mirrorROC+25 < lensFL*10)
get('idMinFocus').innerHTML = "Your mirror under test will only be about "+((mirrorROC+25)/10).toFixed(0)+"cm from the camera. <font color='red'>Your lens probably can't focus that close</font><br>";
else
get('idMinFocus').innerHTML = "";
//
// time to draw 2 graphics of fringes into the lower canvas
//
t_can = document.getElementById('idCanvas');
ctx = t_can.getContext('2d');
canvas_width = t_can.clientWidth;
canvas_height = (t_can.clientHeight-2)/2;
//
// draw background top half white
//
ctx.fillStyle = 'rgb(255,255,255)';
ctx.fillRect(0, 0, canvas_width, canvas_height);
camera_ratio=3/2; // width/height
width = min(canvas_width, canvas_height*camera_ratio);
height = width/camera_ratio;
scale = min(height/sensorMM, height/mirrorFOVmm);
xoff = canvas_width/2;
yoff = canvas_height/2;
// sensor fov
pixW = sensorMM*camera_ratio*scale;
pixH = sensorMM*scale;
//
// draw sensor rectangle black
//
ctx.fillStyle="black";
ctx.fillRect(xoff - pixW/2, yoff-pixH/2, pixW, pixH);
//
// draw red circle representing igram
//
ctx.lineWidth=1;
ctx.strokeStyle="rgb(255,0,0)";
ctx.beginPath();
ctx.arc(xoff, yoff, mirrorFOVmm*scale/2, 0, 2*Math.PI); // divide by 2 because it's radius, not diameter
ctx.stroke();
pixels = Math.round(mirrorFOVmm*scale,0);
if (mirrorFOVdeg / camFOVdeg < 1)
{
/*
z8 def tilt
-10 12 70
-5 6 35
-1 1.5 7
.5 */
tilt=-z8*7+4;
defocus=-z8*1.2+.3;
astig=0;
oversample=2000/pixels*Math.abs(z8)/10;
if (oversample > 10) oversample=10; // otherwise it gets too slow on cpu
if (oversample < 1) oversample=1;
//
// Draw actual igram (upper drawing)
//
ppf = fringes(ctx, pixels, xoff-mirrorFOVmm*scale/2,yoff-mirrorFOVmm*scale/2,
z8,tilt,defocus,astig,655, oversample);
ppf = ppf*igramPixels/pixels;
if (ppf > 4.4) // assumes bayer filter and 10% margin
get('idppf').innerHTML=ppf.toFixed(1);
else if (ppf > 4)
// yellow
get('idppf').innerHTML="<bold><font color='#ec0'>"+ppf.toFixed(1)+"</font></bold>"
else
{
if (mirrorFOVdeg / camFOVdeg > 0.75)
get('idppf').innerHTML="<font color='red'>"+ppf.toFixed(1)+"</font> Not enough pixels. Need more pixels in camera."
else
get('idppf').innerHTML="<font color='red'>"+ppf.toFixed(1)+"</font> Not enough pixels. Need longer focal length lens or more pixels in camera."
}
}
var sac = synth_apeture_cropping(lensFL, lensFL/lensFNum, false);
var sac_percent = sac/mirrorFOVmm*100;
if (sac >= sensorMM*1.5)
{
// no vigneting due to sac
$('#idsac0').hide();
}
else
{
$('#idsac0').show();
if (sac_percent < 200)
$('#idsac1').html("<br><font color='#eco'>Your mirror f/# is very high so you need to worry about 'stop cropping' or 'virtual pinhole cropping'. Please contact me about this at thegr5store@gmail.com. I have tested a few wide angle lenses (28mm, 35mm) but the newer longer body lenses probably won't work for you and I can tell you what works and what doesn't and how you can test a lens for virtual pinhole issues. You might also need a custom made lens.</font>");
$('#idsac').text(""+sac_percent.toFixed(0)+"%");
if (sac_percent < 100)
$('#idsac').css("color", "red");
else if (sac_percent < 120)
$('#idsac').css("color", "#ec0");
else
$('#idsac').css("color", "black");
// draw blue aperture circle
if (sac_percent >= 100)
ctx.strokeStyle="rgb(90,90,255)";
else