-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
test_client_calls.py
6846 lines (5770 loc) · 631 KB
/
test_client_calls.py
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
import ast
import json
import os, sys
import random
import shutil
import tempfile
import time
import pytest
from tests.utils import wrap_test_forked, make_user_path_test, get_llama, get_inf_server, get_inf_port, \
count_tokens_llm, kill_weaviate
from src.client_test import get_client, get_args, run_client_gen
from src.enums import LangChainAction, LangChainMode, no_model_str, no_lora_str, no_server_str, DocumentChoice, \
db_types_full, noop_prompt_type, git_hash_unset
from src.utils import get_githash, remove, download_simple, hash_file, makedirs, lg_to_gr, FakeTokenizer, \
is_gradio_version4, get_hf_server
from src.prompter import model_names_curated, openai_gpts, model_names_curated_big
@wrap_test_forked
def test_client1():
os.environ['TEST_LANGCHAIN_IMPORT'] = "1"
sys.modules.pop('gpt_langchain', None)
sys.modules.pop('langchain', None)
from src.gen import main
main(base_model='h2oai/h2ogpt-oig-oasst1-512-6_9b', prompt_type='human_bot', chat=False,
stream_output=False, gradio=True, num_beams=1, block_gradio_exit=False)
from src.client_test import test_client_basic
res_dict, _ = test_client_basic()
assert res_dict['prompt'] == 'Who are you?'
assert res_dict['iinput'] == ''
assert 'I am h2oGPT' in res_dict['response'] or "I'm h2oGPT" in res_dict['response'] or 'I’m h2oGPT' in res_dict[
'response']
@wrap_test_forked
def test_client1_lock_choose_model():
os.environ['TEST_LANGCHAIN_IMPORT'] = "1"
sys.modules.pop('gpt_langchain', None)
sys.modules.pop('langchain', None)
from src.gen import main
base1 = 'h2oai/h2ogpt-oig-oasst1-512-6_9b'
base2 = 'h2oai/h2o-danube-1.8b-chat'
model_lock = [dict(base_model=base1, prompt_type='human_bot'),
dict(base_model=base2, prompt_type=noop_prompt_type)]
main(chat=False, model_lock=model_lock,
stream_output=False, gradio=True, num_beams=1, block_gradio_exit=False)
from src.client_test import test_client_basic
for prompt_type in ['human_bot', None, '']:
for visible_models in [None, 0, base1]:
prompt = 'Who are you?'
res_dict, _ = test_client_basic(visible_models=visible_models, prompt=prompt,
prompt_type=prompt_type)
assert res_dict['prompt'] == prompt
assert res_dict['iinput'] == ''
assert 'I am h2oGPT' in res_dict['response'] or "I'm h2oGPT" in res_dict['response'] or 'I’m h2oGPT' in \
res_dict[
'response']
for prompt_type in [noop_prompt_type, None, '']:
for visible_models in [1, base2]:
prompt = 'The sky is'
res_dict, _ = test_client_basic(visible_models=visible_models, prompt=prompt,
prompt_type=prompt_type)
assert res_dict['prompt'] == prompt
assert res_dict['iinput'] == ''
if prompt_type == noop_prompt_type:
assert 'The sky is a big, blue' in res_dict['response'] or 'blue' in res_dict['response']
else:
assert 'The sky is a big, blue, and sometimes' in res_dict['response'] or 'blue' in res_dict['response']
@pytest.mark.parametrize("base_model", [
# 'h2oai/h2ogpt-gm-oasst1-en-2048-falcon-7b-v2', # can't handle
'llama',
])
@wrap_test_forked
def test_client1_context(base_model):
os.environ['TEST_LANGCHAIN_IMPORT'] = "1"
sys.modules.pop('gpt_langchain', None)
sys.modules.pop('langchain', None)
from src.gen import main
main(base_model=base_model, chat=False,
stream_output=False, gradio=True, num_beams=1, block_gradio_exit=False)
from gradio_client import Client
client = Client(get_inf_server())
# string of dict for input
prompt = 'Who are you?'
if base_model == 'h2oai/h2ogpt-gm-oasst1-en-2048-falcon-7b-v2':
context = """<|answer|>I am a pixie filled with fairy dust<|endoftext|><|prompt|>What kind of pixie are you?<|endoftext|><|answer|>Magical<|endoftext|>"""
else:
# FYI llama70b even works with falcon prompt_answer context
context = """[/INST] I am a pixie filled with fairy dust </s><s>[INST] What kind of pixie are you? [/INST] Magical"""
kwargs = dict(instruction_nochat=prompt, context=context)
res = client.predict(str(dict(kwargs)), api_name='/submit_nochat_api')
# string of dict for output
response = ast.literal_eval(res)['response']
print(response)
assert """mischievous and playful pixie""" in response or \
"""mischievous pixie""" in response
@wrap_test_forked
def test_client1api():
os.environ['TEST_LANGCHAIN_IMPORT'] = "1"
sys.modules.pop('gpt_langchain', None)
sys.modules.pop('langchain', None)
from src.gen import main
main(base_model='h2oai/h2ogpt-oig-oasst1-512-6_9b', prompt_type='human_bot', chat=False,
stream_output=False, gradio=True, num_beams=1, block_gradio_exit=False)
from src.client_test import test_client_basic_api
res_dict, _ = test_client_basic_api()
assert res_dict['prompt'] == 'Who are you?'
assert res_dict['iinput'] == ''
assert 'I am h2oGPT' in res_dict['response'] or "I'm h2oGPT" in res_dict['response'] or 'I’m h2oGPT' in res_dict[
'response']
@pytest.mark.parametrize("admin_pass", ['', 'foodoo1234'])
@pytest.mark.parametrize("save_dir", [None, 'save_foodoo1234'])
@wrap_test_forked
def test_client1api_lean(save_dir, admin_pass):
from src.gen import main
base_model = 'h2oai/h2ogpt-oig-oasst1-512-6_9b'
os.environ['ADMIN_PASS'] = admin_pass
main(base_model=base_model, prompt_type='human_bot', chat=False,
stream_output=False, gradio=True, num_beams=1, block_gradio_exit=False,
system_api_open=True,
save_dir=save_dir)
client1 = get_client(serialize=False)
from gradio_utils.grclient import GradioClient
client2 = GradioClient(get_inf_server())
client2.refresh_client() # test refresh
for client in [client1, client2]:
api_name = '/submit_nochat_api' # NOTE: like submit_nochat but stable API for string dict passing
prompt = 'Who are you?'
kwargs = dict(instruction_nochat=prompt)
# pass string of dict. All entries are optional, but expect at least instruction_nochat to be filled
res = client.predict(str(dict(kwargs)), api_name=api_name)
res = ast.literal_eval(res)
assert 'base_model' in res['save_dict']
assert res['save_dict']['base_model'] == base_model
assert res['save_dict']['error'] in [None, '']
assert 'extra_dict' in res['save_dict']
assert res['save_dict']['extra_dict']['ntokens'] > 0
assert res['save_dict']['extra_dict']['t_generate'] > 0
assert res['save_dict']['extra_dict']['tokens_persecond'] > 0
print("Raw client result: %s" % res, flush=True)
response = res['response']
assert 'I am h2oGPT' in response or "I'm h2oGPT" in response or 'I’m h2oGPT' in response
api_name = '/system_info_dict'
# pass string of dict. All entries are optional, but expect at least instruction_nochat to be filled
ADMIN_PASS = os.getenv('ADMIN_PASS', admin_pass)
res = client.predict(ADMIN_PASS, api_name=api_name)
res = json.loads(res)
assert isinstance(res, dict)
assert res['base_model'] == base_model, "Problem with res=%s" % res
assert 'load_8bit' in res
assert res['hash'] == get_githash()
api_name = '/system_hash'
res = client.predict(api_name=api_name)
assert res == get_githash()
res = client.predict(api_name=api_name)
assert res == get_githash()
client2.refresh_client() # test refresh
res = client.predict(api_name=api_name)
assert res in [get_githash(), git_hash_unset]
res = client2.get_server_hash()
assert res in [get_githash(), git_hash_unset]
@wrap_test_forked
def test_client1api_lean_lock_choose_model():
from src.gen import main
base1 = 'h2oai/h2ogpt-oig-oasst1-512-6_9b'
base2 = 'distilgpt2'
model_lock = [dict(base_model=base1, prompt_type='human_bot'),
dict(base_model=base2, prompt_type=noop_prompt_type)]
save_dir = 'save_test'
main(model_lock=model_lock, chat=False,
stream_output=False, gradio=True, num_beams=1, block_gradio_exit=False,
save_dir=save_dir)
client = get_client(serialize=not is_gradio_version4)
for prompt_type in ['human_bot', None, '', noop_prompt_type]:
for visible_models in [None, 0, base1, 1, base2]:
base_model = base1 if visible_models in [None, 0, base1] else base2
if base_model == base1 and prompt_type == noop_prompt_type:
continue
if base_model == base2 and prompt_type == 'human_bot':
continue
api_name = '/submit_nochat_api' # NOTE: like submit_nochat but stable API for string dict passing
if base_model == base1:
prompt = 'Who are you?'
else:
prompt = 'The sky is'
kwargs = dict(instruction_nochat=prompt, prompt_type=prompt_type, visible_models=visible_models)
# pass string of dict. All entries are optional, but expect at least instruction_nochat to be filled
res = client.predict(str(dict(kwargs)), api_name=api_name)
res = ast.literal_eval(res)
assert save_dir
assert 'base_model' in res['save_dict']
assert res['save_dict']['base_model'] == base_model
assert res['save_dict']['error'] in [None, '']
assert 'extra_dict' in res['save_dict']
assert res['save_dict']['extra_dict']['ntokens'] > 0
assert res['save_dict']['extra_dict']['t_generate'] > 0
assert res['save_dict']['extra_dict']['tokens_persecond'] > 0
print("Raw client result: %s" % res, flush=True)
response = res['response']
if base_model == base1:
assert 'I am h2oGPT' in response or "I'm h2oGPT" in response or 'I’m h2oGPT' in response
else:
assert 'the limit of time' in response or 'the limit' in response or 'I am a man of the night' in response
api_name = '/model_names'
res = client.predict(api_name=api_name)
res = ast.literal_eval(res)
assert [x['base_model'] for x in res] == [base1, base2]
assert res == [{'base_model': 'h2oai/h2ogpt-oig-oasst1-512-6_9b', 'prompt_type': 'human_bot', 'prompt_dict': None,
'load_8bit': False, 'load_4bit': False, 'low_bit_mode': 1, 'load_half': True,
'use_flash_attention_2': False, 'load_gptq': '', 'load_awq': '', 'load_exllama': False,
'use_safetensors': False, 'revision': None, 'use_gpu_id': True, 'gpu_id': 0, 'compile_model': None,
'use_cache': None,
'llamacpp_dict': {'n_gpu_layers': 100, 'use_mlock': True, 'n_batch': 1024, 'n_gqa': 0,
'model_path_llama': '', 'model_name_gptj': '', 'model_name_gpt4all_llama': '',
'model_name_exllama_if_no_config': ''}, 'rope_scaling': {}, 'max_seq_len': 2048,
'exllama_dict': {}, 'gptq_dict': {}, 'attention_sinks': False, 'sink_dict': {},
'truncation_generation': False, 'hf_model_dict': {}},
{'base_model': 'distilgpt2', 'prompt_type': noop_prompt_type, 'prompt_dict': None,
'load_8bit': False,
'load_4bit': False, 'low_bit_mode': 1, 'load_half': True, 'use_flash_attention_2': False,
'load_gptq': '', 'load_awq': '', 'load_exllama': False, 'use_safetensors': False, 'revision': None,
'use_gpu_id': True, 'gpu_id': 0, 'compile_model': None, 'use_cache': None,
'llamacpp_dict': {'n_gpu_layers': 100, 'use_mlock': True, 'n_batch': 1024, 'n_gqa': 0,
'model_path_llama': '', 'model_name_gptj': '', 'model_name_gpt4all_llama': '',
'model_name_exllama_if_no_config': ''}, 'rope_scaling': {}, 'max_seq_len': 1024,
'exllama_dict': {}, 'gptq_dict': {}, 'attention_sinks': False, 'sink_dict': {},
'truncation_generation': False, 'hf_model_dict': {}}]
@wrap_test_forked
def test_client1api_lean_chat_server():
from src.gen import main
main(base_model='h2oai/h2ogpt-oig-oasst1-512-6_9b', prompt_type='human_bot', chat=True,
stream_output=True, gradio=True, num_beams=1, block_gradio_exit=False)
api_name = '/submit_nochat_api' # NOTE: like submit_nochat but stable API for string dict passing
prompt = 'Who are you?'
kwargs = dict(instruction_nochat=prompt)
client = get_client(serialize=not is_gradio_version4)
# pass string of dict. All entries are optional, but expect at least instruction_nochat to be filled
res = client.predict(str(dict(kwargs)), api_name=api_name)
print("Raw client result: %s" % res, flush=True)
response = ast.literal_eval(res)['response']
assert 'I am h2oGPT' in response or "I'm h2oGPT" in response or 'I’m h2oGPT' in response
@wrap_test_forked
def test_client_chat_nostream():
res_dict, client = run_client_chat_with_server(stream_output=False)
assert 'I am h2oGPT' in res_dict['response'] or "I'm h2oGPT" in res_dict['response'] or 'I’m h2oGPT' in res_dict[
'response']
@wrap_test_forked
def test_client_chat_nostream_gpt4all():
res_dict, client = run_client_chat_with_server(stream_output=False, base_model='gptj', prompt_type='gptj')
assert 'I am a computer program designed to assist' in res_dict['response'] or \
'I am a person who enjoys' in res_dict['response'] or \
'I am a student at' in res_dict['response'] or \
'I am a person who' in res_dict['response']
@wrap_test_forked
def test_client_chat_nostream_gpt4all_llama():
res_dict, client = run_client_chat_with_server(stream_output=False, base_model='gpt4all_llama', prompt_type='gptj')
assert 'What do you want from me?' in res_dict['response'] or \
'What do you want?' in res_dict['response'] or \
'What is your name and title?' in res_dict['response'] or \
'I can assist you with any information' in res_dict['response'] or \
'I can provide information or assistance' in res_dict['response'] or \
'am a student' in res_dict['response'] or \
'As an AI assistant' in res_dict['response'] or \
'I do not have a physical' in res_dict['response']
@pytest.mark.need_tokens
@wrap_test_forked
def test_client_chat_nostream_llama7b():
prompt_type, full_path = get_llama()
res_dict, client = run_client_chat_with_server(stream_output=False, base_model='llama',
prompt_type=prompt_type, model_path_llama=full_path)
assert "am a virtual assistant" in res_dict['response'] or \
'am a student' in res_dict['response'] or \
"My name is John." in res_dict['response'] or \
"how can I assist" in res_dict['response'] or \
"I'm LLaMA" in res_dict['response']
@pytest.mark.need_tokens
@pytest.mark.parametrize("model_num", [1, 2])
@pytest.mark.parametrize("prompt_num", [1, 2])
# GGML fails for >=2500
# e.g. https://huggingface.co/TheBloke/Llama-2-7B-Chat-GGML/resolve/main/llama-2-7b-chat.ggmlv3.q8_0.bin
@pytest.mark.parametrize("max_seq_len", [2048, 3000, 4096])
@wrap_test_forked
def test_client_chat_nostream_llama2_long(max_seq_len, prompt_num, model_num):
prompt1 = """2017-08-24.
Wright, Andy (2017-08-16). "Chasing Totality: A Look Into the World of Umbraphiles". Atlas Obscura. Archived from the original on 2020-12-14. Retrieved 2017-08-24.
Kramer, Bill. "Photographing a Total Solar Eclipse". Eclipse-chasers.com. Archived from the original on January 29, 2009. Retrieved March 7, 2010.
Vorenkamp, Todd (April 2017). "How to Photograph a Solar Eclipse". B&H Photo Video. Archived from the original on July 1, 2019. Retrieved August 19, 2017.
"The science of eclipses". ESA. September 28, 2004. Archived from the original on August 1, 2012. Retrieved August 4, 2007.
Johnson-Groh, Mara (10 August 2017). "Five Tips from NASA for Photographing the Total Solar Eclipse on Aug. 21". NASA. Archived from the original on 18 August 2020. Retrieved 21 September 2017.
Dravins, Dainis. "Flying Shadows". Lund Observatory. Archived from the original on July 26, 2020. Retrieved January 15, 2012.
Dyson, F.W.; Eddington, A.S.; Davidson, C.R. (1920). "A Determination of the Deflection of Light by the Sun's Gravitational Field, from Observations Made at the Solar eclipse of May 29, 1919". Phil. Trans. Roy. Soc. A. 220 (571–81): 291–333. Bibcode:1920RSPTA.220..291D. doi:10.1098/rsta.1920.0009. Archived from the original on November 3, 2020. Retrieved August 27, 2019.
"Relativity and the 1919 eclipse". ESA. September 13, 2004. Archived from the original on October 21, 2012. Retrieved January 11, 2011.
Steel, pp. 114–120
Allais, Maurice (1959). "Should the Laws of Gravitation be Reconsidered?". Aero/Space Engineering. 9: 46–55.
Saxl, Erwin J.; Allen, Mildred (1971). "1970 solar eclipse as 'seen' by a torsion pendulum". Physical Review D. 3 (4): 823–825. Bibcode:1971PhRvD...3..823S. doi:10.1103/PhysRevD.3.823.
Wang, Qian-shen; Yang, Xin-she; Wu, Chuan-zhen; Guo, Hong-gang; Liu, Hong-chen; Hua, Chang-chai (2000). "Precise measurement of gravity variations during a total solar eclipse". Physical Review D. 62 (4): 041101(R). arXiv:1003.4947. Bibcode:2000PhRvD..62d1101W. doi:10.1103/PhysRevD.62.041101. S2CID 6846335.
Yang, X. S.; Wang, Q. S. (2002). "Gravity anomaly during the Mohe total solar eclipse and new constraint on gravitational shielding parameter". Astrophysics and Space Science. 282 (1): 245–253. Bibcode:2002Ap&SS.282..245Y. doi:10.1023/A:1021119023985. S2CID 118497439.
Meeus, J.; Vitagliano, A. (2004). "Simultaneous transits" (PDF). J. Br. Astron. Assoc. 114 (3): 132–135. Bibcode:2004JBAA..114..132M. Archived from the original (PDF) on July 10, 2007.
Grego, Peter (2008). Venus and Mercury, and How to Observe Them. Springer. p. 3. ISBN 978-0387742854.
"ISS-Venustransit". astronomie.info (in German). Archived from the original on 2020-07-28. Retrieved 2004-07-29.
"JSC Digital Image Collection". NASA Johnson Space Center. January 11, 2006. Archived from the original on February 4, 2012. Retrieved January 15, 2012.
Nemiroff, R.; Bonnell, J., eds. (August 30, 1999). "Looking Back on an Eclipsed Earth". Astronomy Picture of the Day. NASA. Retrieved January 15, 2012.
"Solar Eclipse 2015 – Impact Analysis Archived 2017-02-21 at the Wayback Machine" pp. 3, 6–7, 13. European Network of Transmission System Operators for Electricity, 19 February 2015. Accessed: 4 March 2015.
"Curve of potential power loss". ing.dk. Archived from the original on 2020-07-28. Retrieved 2015-03-04.
Gray, S. L.; Harrison, R. G. (2012). "Diagnosing eclipse-induced wind changes". Proceedings of the Royal Society. 468 (2143): 1839–1850. Bibcode:2012RSPSA.468.1839G. doi:10.1098/rspa.2012.0007. Archived from the original on 2015-03-04. Retrieved 2015-03-04.
Young, Alex. "How Eclipses Work". NASA. Archived from the original on 2017-09-18. Retrieved 21 September 2017.
van Gent, R.H. "Solar- and Lunar-Eclipse Predictions from Antiquity to the Present". A Catalogue of Eclipse Cycles. Utrecht University. Retrieved 6 October 2018.
van Gent, R.H. "Solar- and Lunar-Eclipse Predictions from Antiquity to the Present". A Catalogue of Eclipse Cycles. Utrecht University. Retrieved 6 October 2018.
van Gent, R.H. "Solar- and Lunar-Eclipse Predictions from Antiquity to the Present". A Catalogue of Eclipse Cycles. Utrecht University. Retrieved 6 October 2018.
van Gent, R.H. "Solar- and Lunar-Eclipse Predictions from Antiquity to the Present". A Catalogue of Eclipse Cycles. Utrecht University. Retrieved 6 October 2018.
van Gent, R.H. "Solar- and Lunar-Eclipse Predictions from Antiquity to the Present". A Catalogue of Eclipse Cycles. Utrecht University. Retrieved 6 October 2018.
van Gent, R.H. "Solar- and Lunar-Eclipse Predictions from Antiquity to the Present". A Catalogue of Eclipse Cycles. Utrecht University. Retrieved 6 October 2018.
van Gent, R.H. "Solar- and Lunar-Eclipse Predictions from Antiquity to the Present". A Catalogue of Eclipse Cycles. Utrecht University. Retrieved 6 October 2018.
van Gent, R.H. "Solar- and Lunar-Eclipse Predictions from Antiquity to the Present". A Catalogue of Eclipse Cycles. Utrecht University. Retrieved 6 October 2018.
van Gent, R.H. "Solar- and Lunar-Eclipse Predictions from Antiquity to the Present". A Catalogue of Eclipse Cycles. Utrecht University. Retrieved 6 October 2018.
References
Mucke, Hermann; Meeus, Jean (1992). Canon of Solar Eclipses −2003 to +2526 (2 ed.). Vienna: Astronomisches Büro.
Harrington, Philip S. (1997). Eclipse! The What, Where, When, Why and How Guide to Watching Solar and Lunar Eclipses. New York: John Wiley and Sons. ISBN 0-471-12795-7.
Steel, Duncan (1999). Eclipse: The celestial phenomenon which has changed the course of history. London: Headline. ISBN 0-7472-7385-5.
Mobberley, Martin (2007). Total Solar Eclipses and How to Observe Them. Astronomers' Observing Guides. New York: Springer. ISBN 978-0-387-69827-4.
Espenak, Fred (2015). Thousand Year Canon of Solar Eclipses 1501 to 2500. Portal AZ: Astropixels Publishing. ISBN 978-1-941983-02-7.
Espenak, Fred (2016). 21st Century Canon of Solar Eclipses. Portal AZ: Astropixels Publishing. ISBN 978-1-941983-12-6.
Fotheringham, John Knight (1921). Historical eclipses: being the Halley lecture delivered 17 May 1921. Oxford: Clarendon Press.
External links
Wikimedia Commons has media related to Solar eclipses.
Wikivoyage has a travel guide for Solar eclipses.
Listen to this article
(2 parts, 27 minutes)
Duration: 15 minutes and 41 seconds.15:41
Duration: 11 minutes and 48 seconds.11:48
Spoken Wikipedia icon
These audio files were created from a revision of this article dated 3 May 2006, and do not reflect subsequent edits.
(Audio help · More spoken articles)
NASA Eclipse Web Site, with information on future eclipses and eye safety information
NASA Eclipse Web Site (older version)
Eclipsewise, Fred Espenak's new eclipse site
Andrew Lowe's Eclipse Page, with maps and circumstances for 5000 years of solar eclipses
A Guide to Eclipse Activities for Educators, Explaining eclipses in educational settings
Detailed eclipse explanations and predictions, Hermit Eclipse
Eclipse Photography, Prof. Miroslav Druckmüller
Animated maps of August 21, 2017 solar eclipses, Larry Koehn
Five Millennium (−1999 to +3000) Canon of Solar Eclipses Database, Xavier M. Jubier
Animated explanation of the mechanics of a solar eclipse Archived 2013-05-25 at the Wayback Machine, University of South Wales
Eclipse Image Gallery Archived 2016-10-15 at the Wayback Machine, The World at Night
Ring of Fire Eclipse: 2012, Photos
"Sun, Eclipses of the" . Collier's New Encyclopedia. 1921.
Centered and aligned video recording of Total Solar Eclipse 20th March 2015 on YouTube
Solar eclipse photographs taken from the Lick Observatory from the Lick Observatory Records Digital Archive, UC Santa Cruz Library’s Digital Collections Archived 2020-06-05 at the Wayback Machine
Video with Total Solar Eclipse March 09 2016 (from the beginning to the total phase) on YouTube
Total Solar Eclipse Shadow on Earth March 09 2016 CIMSSSatelite
List of all solar eclipses
National Geographic Solar Eclipse 101 video Archived 2018-08-04 at the Wayback Machine
Wikiversity has a solar eclipse lab that students can do on any sunny day.
vte
Solar eclipses
vte
The Sun
vte
The Moon
Portals:
Astronomy
icon Stars
Spaceflight
Outer space
Solar System
Authority control databases: National Edit this at Wikidata
GermanyIsraelUnited StatesJapanCzech Republic
Categories: EclipsesSolar eclipses
This page was last edited on 15 October 2023, at 00:16 (UTC).
Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.
Privacy policyAbout WikipediaDisclaimersContact WikipediaCode of ConductDevelopersStatisticsCookie statementMobile viewWikimedia FoundationPowered by MediaWiki
\"\"\"
Summarize"""
prompt2 = """
\"\"\"
Main menu
WikipediaThe Free Encyclopedia
Search Wikipedia
Search
Create account
Log in
Personal tools
Photograph a historic site, help Wikipedia, and win a prize. Participate in the world's largest photography competition this month!
Learn more
Contents hide
(Top)
Types
Toggle Types subsection
Predictions
Toggle Predictions subsection
Occurrence and cycles
Toggle Occurrence and cycles subsection
Historical eclipses
Viewing
Toggle Viewing subsection
Other observations
Toggle Other observations subsection
Recent and forthcoming solar eclipses
Toggle Recent and forthcoming solar eclipses subsection
See also
Footnotes
Notes
References
External links
Solar eclipse
Article
Talk
Read
View source
View history
Tools
Featured article
Page semi-protected
Listen to this article
From Wikipedia, the free encyclopedia
Not to be confused with Solar Eclipse (video game) or Solar Eclipse (song).
"Eclipse of the Sun" redirects here. For other uses, see Eclipse of the Sun (disambiguation).
Total solar eclipse
A total solar eclipse occurs when the Moon completely covers the Sun's disk, as seen in this 1999 solar eclipse. Solar prominences can be seen along the limb (in red) as well as extensive coronal filaments.
Annular solar eclipsePartial solar eclipse
An annular solar eclipse (left) occurs when the Moon is too far away to completely cover the Sun's disk (May 20, 2012). During a partial solar eclipse (right), the Moon blocks only part of the Sun's disk (October 25, 2022).
A solar eclipse occurs when the Moon passes between Earth and the Sun, thereby obscuring the view of the Sun from a small part of the Earth, totally or partially. Such an alignment occurs approximately every six months, during the eclipse season in its new moon phase, when the Moon's orbital plane is closest to the plane of the Earth's orbit.[1] In a total eclipse, the disk of the Sun is fully obscured by the Moon. In partial and annular eclipses, only part of the Sun is obscured. Unlike a lunar eclipse, which may be viewed from anywhere on the night side of Earth, a solar eclipse can only be viewed from a relatively small area of the world. As such, although total solar eclipses occur somewhere on Earth every 18 months on average, they recur at any given place only once every 360 to 410 years.
If the Moon were in a perfectly circular orbit and in the same orbital plane as Earth, there would be total solar eclipses once a month, at every new moon. Instead, because the Moon's orbit is tilted at about 5 degrees to Earth's orbit, its shadow usually misses Earth. Solar (and lunar) eclipses therefore happen only during eclipse seasons, resulting in at least two, and up to five, solar eclipses each year, no more than two of which can be total.[2][3] Total eclipses are more rare because they require a more precise alignment between the centers of the Sun and Moon, and because the Moon's apparent size in the sky is sometimes too small to fully cover the Sun.
An eclipse is a natural phenomenon. In some ancient and modern cultures, solar eclipses were attributed to supernatural causes or regarded as bad omens. Astronomers' predictions of eclipses began in China as early as the 4th century BC; eclipses hundreds of years into the future may now be predicted with high accuracy.
Looking directly at the Sun can lead to permanent eye damage, so special eye protection or indirect viewing techniques are used when viewing a solar eclipse. Only the total phase of a total solar eclipse is safe to view without protection. Enthusiasts known as eclipse chasers or umbraphiles travel to remote locations to see solar eclipses.[4][5]
Types
Partial and annular phases of the solar eclipse of May 20, 2012
There are four types of solar eclipses:
A total eclipse occurs in average every 18 months[Note 1][6] when the dark silhouette of the Moon completely obscures the intensely bright light of the Sun, allowing the much fainter solar corona to be visible. During any one eclipse, totality occurs at best only in a narrow track on the surface of Earth.[7] This narrow track is called the path of totality.[8]
An annular eclipse occurs once every one or two years[6] when the Sun and Moon are exactly in line with the Earth, but the apparent size of the Moon is smaller than that of the Sun. Hence the Sun appears as a very bright ring, or annulus, surrounding the dark disk of the Moon.[9]
A hybrid eclipse (also called annular/total eclipse) shifts between a total and annular eclipse. At certain points on the surface of Earth, it appears as a total eclipse, whereas at other points it appears as annular. Hybrid eclipses are comparatively rare.[9]
A partial eclipse occurs about twice a year,[6] when the Sun and Moon are not exactly in line with the Earth and the Moon only partially obscures the Sun. This phenomenon can usually be seen from a large part of the Earth outside of the track of an annular or total eclipse. However, some eclipses can be seen only as a partial eclipse, because the umbra passes above the Earth's polar regions and never intersects the Earth's surface.[9] Partial eclipses are virtually unnoticeable in terms of the Sun's brightness, as it takes well over 90% coverage to notice any darkening at all. Even at 99%, it would be no darker than civil twilight.[10]
Comparison of minimum and maximum apparent sizes of the Sun and Moon (and planets). An annular eclipse can occur when the Sun has a larger apparent size than the Moon, whereas a total eclipse can occur when the Moon has a larger apparent size.
The Sun's distance from Earth is about 400 times the Moon's distance, and the Sun's diameter is about 400 times the Moon's diameter. Because these ratios are approximately the same, the Sun and the Moon as seen from Earth appear to be approximately the same size: about 0.5 degree of arc in angular measure.[9]
The Moon's orbit around the Earth is slightly elliptical, as is the Earth's orbit around the Sun. The apparent sizes of the Sun and Moon therefore vary.[11] The magnitude of an eclipse is the ratio of the apparent size of the Moon to the apparent size of the Sun during an eclipse. An eclipse that occurs when the Moon is near its closest distance to Earth (i.e., near its perigee) can be a total eclipse because the Moon will appear to be large enough to completely cover the Sun's bright disk or photosphere; a total eclipse has a magnitude greater than or equal to 1.000. Conversely, an eclipse that occurs when the Moon is near its farthest distance from Earth (i.e., near its apogee) can be only an annular eclipse because the Moon will appear to be slightly smaller than the Sun; the magnitude of an annular eclipse is less than 1.[12]
A hybrid eclipse occurs when the magnitude of an eclipse changes during the event from less to greater than one, so the eclipse appears to be total at locations nearer the midpoint, and annular at other locations nearer the beginning and end, since the sides of the Earth are slightly further away from the Moon. These eclipses are extremely narrow in their path width and relatively short in their duration at any point compared with fully total eclipses; the 2023 April 20 hybrid eclipse's totality is over a minute in duration at various points along the path of totality. Like a focal point, the width and duration of totality and annularity are near zero at the points where the changes between the two occur.[13]
Because the Earth's orbit around the Sun is also elliptical, the Earth's distance from the Sun similarly varies throughout the year. This affects the apparent size of the Sun in the same way, but not as much as does the Moon's varying distance from Earth.[9] When Earth approaches its farthest distance from the Sun in early July, a total eclipse is somewhat more likely, whereas conditions favour an annular eclipse when Earth approaches its closest distance to the Sun in early January.[14]
Terminology for central eclipse
Each icon shows the view from the centre of its black spot, representing the Moon (not to scale)
Diamond ring effect at third contact—the end of totality—with visible prominences
Central eclipse is often used as a generic term for a total, annular, or hybrid eclipse.[15] This is, however, not completely correct: the definition of a central eclipse is an eclipse during which the central line of the umbra touches the Earth's surface. It is possible, though extremely rare, that part of the umbra intersects with the Earth (thus creating an annular or total eclipse), but not its central line. This is then called a non-central total or annular eclipse.[15] Gamma is a measure of how centrally the shadow strikes. The last (umbral yet) non-central solar eclipse was on April 29, 2014. This was an annular eclipse. The next non-central total solar eclipse will be on April 9, 2043.[16]
The visual phases observed during a total eclipse are called:[17]
First contact—when the Moon's limb (edge) is exactly tangential to the Sun's limb.
Second contact—starting with Baily's Beads (caused by light shining through valleys on the Moon's surface) and the diamond ring effect. Almost the entire disk is covered.
Totality—the Moon obscures the entire disk of the Sun and only the solar corona is visible.
Third contact—when the first bright light becomes visible and the Moon's shadow is moving away from the observer. Again a diamond ring may be observed.
Fourth contact—when the trailing edge of the Moon ceases to overlap with the solar disk and the eclipse ends.
Predictions
Geometry
Geometry of a total solar eclipse (not to scale)
The diagrams to the right show the alignment of the Sun, Moon, and Earth during a solar eclipse. The dark gray region between the Moon and Earth is the umbra, where the Sun is completely obscured by the Moon. The small area where the umbra touches Earth's surface is where a total eclipse can be seen. The larger light gray area is the penumbra, in which a partial eclipse can be seen. An observer in the antumbra, the area of shadow beyond the umbra, will see an annular eclipse.[18]
The Moon's orbit around the Earth is inclined at an angle of just over 5 degrees to the plane of the Earth's orbit around the Sun (the ecliptic). Because of this, at the time of a new moon, the Moon will usually pass to the north or south of the Sun. A solar eclipse can occur only when a new moon occurs close to one of the points (known as nodes) where the Moon's orbit crosses the ecliptic.[19]
As noted above, the Moon's orbit is also elliptical. The Moon's distance from the Earth can vary by about 6% from its average value. Therefore, the Moon's apparent size varies with its distance from the Earth, and it is this effect that leads to the difference between total and annular eclipses. The distance of the Earth from the Sun also varies during the year, but this is a smaller effect. On average, the Moon appears to be slightly smaller than the Sun as seen from the Earth, so the majority (about 60%) of central eclipses are annular. It is only when the Moon is closer to the Earth than average (near its perigee) that a total eclipse occurs.[20][21]
Moon Sun
At perigee
(nearest) At apogee
(farthest) At perihelion
(nearest) At aphelion
(farthest)
Mean radius 1,737.10 km
(1,079.38 mi) 696,000 km
(432,000 mi)
Distance 363,104 km
(225,622 mi) 405,696 km
(252,088 mi) 147,098,070 km
(91,402,500 mi) 152,097,700 km
(94,509,100 mi)
Angular
diameter[22] 33' 30"
(0.5583°) 29' 26"
(0.4905°) 32' 42"
(0.5450°) 31' 36"
(0.5267°)
Apparent size
to scale
Order by
decreasing
apparent size 1st 4th 2nd 3rd
The Moon orbits the Earth in approximately 27.3 days, relative to a fixed frame of reference. This is known as the sidereal month. However, during one sidereal month, Earth has revolved part way around the Sun, making the average time between one new moon and the next longer than the sidereal month: it is approximately 29.5 days. This is known as the synodic month and corresponds to what is commonly called the lunar month.[19]
The Moon crosses from south to north of the ecliptic at its ascending node, and vice versa at its descending node.[19] However, the nodes of the Moon's orbit are gradually moving in a retrograde motion, due to the action of the Sun's gravity on the Moon's motion, and they make a complete circuit every 18.6 years. This regression means that the time between each passage of the Moon through the ascending node is slightly shorter than the sidereal month. This period is called the nodical or draconic month.[23]
Finally, the Moon's perigee is moving forwards or precessing in its orbit and makes a complete circuit in 8.85 years. The time between one perigee and the next is slightly longer than the sidereal month and known as the anomalistic month.[24]
The Moon's orbit intersects with the ecliptic at the two nodes that are 180 degrees apart. Therefore, the new moon occurs close to the nodes at two periods of the year approximately six months (173.3 days) apart, known as eclipse seasons, and there will always be at least one solar eclipse during these periods. Sometimes the new moon occurs close enough to a node during two consecutive months to eclipse the Sun on both occasions in two partial eclipses. This means that, in any given year, there will always be at least two solar eclipses, and there can be as many as five.[25]
Eclipses can occur only when the Sun is within about 15 to 18 degrees of a node, (10 to 12 degrees for central eclipses). This is referred to as an eclipse limit, and is given in ranges because the apparent sizes and speeds of the Sun and Moon vary throughout the year. In the time it takes for the Moon to return to a node (draconic month), the apparent position of the Sun has moved about 29 degrees, relative to the nodes.[2] Since the eclipse limit creates a window of opportunity of up to 36 degrees (24 degrees for central eclipses), it is possible for partial eclipses (or rarely a partial and a central eclipse) to occur in consecutive months.[26][27]
Fraction of the Sun's disc covered, f, when the same-sized discs are offset a fraction t of their diameter.[28]
Path
During a central eclipse, the Moon's umbra (or antumbra, in the case of an annular eclipse) moves rapidly from west to east across the Earth. The Earth is also rotating from west to east, at about 28 km/min at the Equator, but as the Moon is moving in the same direction as the Earth's rotation at about 61 km/min, the umbra almost always appears to move in a roughly west–east direction across a map of the Earth at the speed of the Moon's orbital velocity minus the Earth's rotational velocity.[29]
The width of the track of a central eclipse varies according to the relative apparent diameters of the Sun and Moon. In the most favourable circumstances, when a total eclipse occurs very close to perigee, the track can be up to 267 km (166 mi) wide and the duration of totality may be over 7 minutes.[30] Outside of the central track, a partial eclipse is seen over a much larger area of the Earth. Typically, the umbra is 100–160 km wide, while the penumbral diameter is in excess of 6400 km.[31]
Besselian elements are used to predict whether an eclipse will be partial, annular, or total (or annular/total), and what the eclipse circumstances will be at any given location.[32]: Chapter 11
Calculations with Besselian elements can determine the exact shape of the umbra's shadow on the Earth's surface. But at what longitudes on the Earth's surface the shadow will fall, is a function of the Earth's rotation, and on how much that rotation has slowed down over time. A number called ΔT is used in eclipse prediction to take this slowing into account. As the Earth slows, ΔT increases. ΔT for dates in the future can only be roughly estimated because the Earth's rotation is slowing irregularly. This means that, although it is possible to predict that there will be a total eclipse on a certain date in the far future, it is not possible to predict in the far future exactly at what longitudes that eclipse will be total. Historical records of eclipses allow estimates of past values of ΔT and so of the Earth's rotation. [32]: Equation 11.132
Duration
This section is in list format but may read better as prose. You can help by converting this section, if appropriate. Editing help is available. (May 2022)
The following factors determine the duration of a total solar eclipse (in order of decreasing importance):[33][34]
The Moon being almost exactly at perigee (making its angular diameter as large as possible).
The Earth being very near aphelion (furthest away from the Sun in its elliptical orbit, making its angular diameter nearly as small as possible).
The midpoint of the eclipse being very close to the Earth's equator, where the rotational velocity is greatest and is closest to the speed of the lunar shadow moving over Earth's surface.
The vector of the eclipse path at the midpoint of the eclipse aligning with the vector of the Earth's rotation (i.e. not diagonal but due east).
The midpoint of the eclipse being near the subsolar point (the part of the Earth closest to the Sun).
The longest eclipse that has been calculated thus far is the eclipse of July 16, 2186 (with a maximum duration of 7 minutes 29 seconds over northern Guyana).[33]
Occurrence and cycles
Main article: Eclipse cycle
As the Earth revolves around the Sun, approximate axial parallelism of the Moon's orbital plane (tilted five degrees to the Earth's orbital plane) results in the revolution of the lunar nodes relative to the Earth. This causes an eclipse season approximately every six months, in which a solar eclipse can occur at the new moon phase and a lunar eclipse can occur at the full moon phase.
Total solar eclipse paths: 1001–2000, showing that total solar eclipses occur almost everywhere on Earth. This image was merged from 50 separate images from NASA.[35]
Total solar eclipses are rare events. Although they occur somewhere on Earth every 18 months on average,[36] it is estimated that they recur at any given place only once every 360 to 410 years, on average.[37] The total eclipse lasts for only a maximum of a few minutes at any location, because the Moon's umbra moves eastward at over 1700 km/h.[38] Totality currently can never last more than 7 min 32 s. This value changes over the millennia and is currently decreasing. By the 8th millennium, the longest theoretically possible total eclipse will be less than 7 min 2 s.[33] The last time an eclipse longer than 7 minutes occurred was June 30, 1973 (7 min 3 sec). Observers aboard a Concorde supersonic aircraft were able to stretch totality for this eclipse to about 74 minutes by flying along the path of the Moon's umbra.[39] The next total eclipse exceeding seven minutes in duration will not occur until June 25, 2150. The longest total solar eclipse during the 11,000 year period from 3000 BC to at least 8000 AD will occur on July 16, 2186, when totality will last 7 min 29 s.[33][40] For comparison, the longest total eclipse of the 20th century at 7 min 8 s occurred on June 20, 1955, and there will be no total solar eclipses over 7 min in duration in the 21st century.[41]
It is possible to predict other eclipses using eclipse cycles. The saros is probably the best known and one of the most accurate. A saros lasts 6,585.3 days (a little over 18 years), which means that, after this period, a practically identical eclipse will occur. The most notable difference will be a westward shift of about 120° in longitude (due to the 0.3 days) and a little in latitude (north-south for odd-numbered cycles, the reverse for even-numbered ones). A saros series always starts with a partial eclipse near one of Earth's polar regions, then shifts over the globe through a series of annular or total eclipses, and ends with a partial eclipse at the opposite polar region. A saros series lasts 1226 to 1550 years and 69 to 87 eclipses, with about 40 to 60 of them being central.[42]
Frequency per year
Between two and five solar eclipses occur every year, with at least one per eclipse season. Since the Gregorian calendar was instituted in 1582, years that have had five solar eclipses were 1693, 1758, 1805, 1823, 1870, and 1935. The next occurrence will be 2206.[43] On average, there are about 240 solar eclipses each century.[44]
The 5 solar eclipses of 1935
January 5 February 3 June 30 July 30 December 25
Partial
(south) Partial
(north) Partial
(north) Partial
(south) Annular
(south)
Saros 111
Saros 149
Saros 116
Saros 154
Saros 121
Final totality
Total solar eclipses are seen on Earth because of a fortuitous combination of circumstances. Even on Earth, the diversity of eclipses familiar to people today is a temporary (on a geological time scale) phenomenon. Hundreds of millions of years in the past, the Moon was closer to the Earth and therefore apparently larger, so every solar eclipse was total or partial, and there were no annular eclipses. Due to tidal acceleration, the orbit of the Moon around the Earth becomes approximately 3.8 cm more distant each year. Millions of years in the future, the Moon will be too far away to fully occlude the Sun, and no total eclipses will occur. In the same timeframe, the Sun may become brighter, making it appear larger in size.[45] Estimates of the time when the Moon will be unable to occlude the entire Sun when viewed from the Earth range between 650 million[46] and 1.4 billion years in the future.[45]
Historical eclipses
Astronomers Studying an Eclipse painted by Antoine Caron in 1571
Historical eclipses are a very valuable resource for historians, in that they allow a few historical events to be dated precisely, from which other dates and ancient calendars may be deduced.[47] A solar eclipse of June 15, 763 BC mentioned in an Assyrian text is important for the chronology of the ancient Near East.[48] There have been other claims to date earlier eclipses. The legendary Chinese king Zhong Kang supposedly beheaded two astronomers, Hsi and Ho, who failed to predict an eclipse 4,000 years ago.[49] Perhaps the earliest still-unproven claim is that of archaeologist Bruce Masse, who putatively links an eclipse that occurred on May 10, 2807, BC with a possible meteor impact in the Indian Ocean on the basis of several ancient flood myths that mention a total solar eclipse.[50] The earliest preserved depiction of a partial solar eclipse from 1143 BCE might be the one in tomb KV9 of Ramses V and Ramses VI.[citation needed]
Records of the solar eclipses of 993 and 1004 as well as the lunar eclipses of 1001 and 1002 by Ibn Yunus of Cairo (c. 1005).
Eclipses have been interpreted as omens, or portents.[51] The ancient Greek historian Herodotus wrote that Thales of Miletus predicted an eclipse that occurred during a battle between the Medes and the Lydians. Both sides put down their weapons and declared peace as a result of the eclipse.[52] The exact eclipse involved remains uncertain, although the issue has been studied by hundreds of ancient and modern authorities. One likely candidate took place on May 28, 585 BC, probably near the Halys river in Asia Minor.[53] An eclipse recorded by Herodotus before Xerxes departed for his expedition against Greece,[54] which is traditionally dated to 480 BC, was matched by John Russell Hind to an annular eclipse of the Sun at Sardis on February 17, 478 BC.[55] Alternatively, a partial eclipse was visible from Persia on October 2, 480 BC.[56] Herodotus also reports a solar eclipse at Sparta during the Second Persian invasion of Greece.[57] The date of the eclipse (August 1, 477 BC) does not match exactly the conventional dates for the invasion accepted by historians.[58]
Chinese records of eclipses begin at around 720 BC.[59] The 4th century BC astronomer Shi Shen described the prediction of eclipses by using the relative positions of the Moon and Sun.[60]
Attempts have been made to establish the exact date of Good Friday by assuming that the darkness described at Jesus's crucifixion was a solar eclipse. This research has not yielded conclusive results,[61][62] and Good Friday is recorded as being at Passover, which is held at the time of a full moon. Further, the darkness lasted from the sixth hour to the ninth, or three hours, which is much, much longer than the eight-minute upper limit for any solar eclipse's totality. Contemporary chronicles wrote about an eclipse at the beginning of May 664 that coincided with the beginning of the plague of 664 in the British isles.[63] In the Western hemisphere, there are few reliable records of eclipses before AD 800, until the advent of Arab and monastic observations in the early medieval period.[59] The Cairo astronomer Ibn Yunus wrote that the calculation of eclipses was one of the many things that connect astronomy with the Islamic law, because it allowed knowing when a special prayer can be made.[64] The first recorded observation of the corona was made in Constantinople in AD 968.[56][59]
Erhard Weigel, predicted course of moon shadow on 12 August 1654 (O.S. 2 August)
The first known telescopic observation of a total solar eclipse was made in France in 1706.[59] Nine years later, English astronomer Edmund Halley accurately predicted and observed the solar eclipse of May 3, 1715.[56][59] By the mid-19th century, scientific understanding of the Sun was improving through observations of the Sun's corona during solar eclipses. The corona was identified as part of the Sun's atmosphere in 1842, and the first photograph (or daguerreotype) of a total eclipse was taken of the solar eclipse of July 28, 1851.[56] Spectroscope observations were made of the solar eclipse of August 18, 1868, which helped to determine the chemical composition of the Sun.[56] John Fiske summed up myths about the solar eclipse like this in his 1872 book Myth and Myth-Makers,
the myth of Hercules and Cacus, the fundamental idea is the victory of the solar god over the robber who steals the light. Now whether the robber carries off the light in the evening when Indra has gone to sleep, or boldly rears his black form against the sky during the daytime, causing darkness to spread over the earth, would make little difference to the framers of the myth. To a chicken a solar eclipse is the same thing as nightfall, and he goes to roost accordingly. Why, then, should the primitive thinker have made a distinction between the darkening of the sky caused by black clouds and that caused by the rotation of the earth? He had no more conception of the scientific explanation of these phenomena than the chicken has of the scientific explanation of an eclipse. For him it was enough to know that the solar radiance was stolen, in the one case as in the other, and to suspect that the same demon was to blame for both robberies.[65]
Viewing
2017 total solar eclipse viewed in real time with audience reactions
Looking directly at the photosphere of the Sun (the bright disk of the Sun itself), even for just a few seconds, can cause permanent damage to the retina of the eye, because of the intense visible and invisible radiation that the photosphere emits. This damage can result in impairment of vision, up to and including blindness. The retina has no sensitivity to pain, and the effects of retinal damage may not appear for hours, so there is no warning that injury is occurring.[66][67]
Under normal conditions, the Sun is so bright that it is difficult to stare at it directly. However, during an eclipse, with so much of the Sun covered, it is easier and more tempting to stare at it. Looking at the Sun during an eclipse is as dangerous as looking at it outside an eclipse, except during the brief period of totality, when the Sun's disk is completely covered (totality occurs only during a total eclipse and only very briefly; it does not occur during a partial or annular eclipse). Viewing the Sun's disk through any kind of optical aid (binoculars, a telescope, or even an optical camera viewfinder) is extremely hazardous and can cause irreversible eye damage within a fraction of a second.[68][69]
Partial and annular eclipses
Eclipse glasses filter out eye damaging radiation, allowing direct viewing of the Sun during all partial eclipse phases; they are not used during totality, when the Sun is completely eclipsed
Pinhole projection method of observing partial solar eclipse. Insert (upper left): partially eclipsed Sun photographed with a white solar filter. Main image: projections of the partially eclipsed Sun (bottom right)
Viewing the Sun during partial and annular eclipses (and during total eclipses outside the brief period of totality) requires special eye protection, or indirect viewing methods if eye damage is to be avoided. The Sun's disk can be viewed using appropriate filtration to block the harmful part of the Sun's radiation. Sunglasses do not make viewing the Sun safe. Only properly designed and certified solar filters should be used for direct viewing of the Sun's disk.[70] Especially, self-made filters using common objects such as a floppy disk removed from its case, a Compact Disc, a black colour slide film, smoked glass, etc. must be avoided.[71][72]
The safest way to view the Sun's disk is by indirect projection.[73] This can be done by projecting an image of the disk onto a white piece of paper or card using a pair of binoculars (with one of the lenses covered), a telescope, or another piece of cardboard with a small hole in it (about 1 mm diameter), often called a pinhole camera. The projected image of the Sun can then be safely viewed; this technique can be used to observe sunspots, as well as eclipses. Care must be taken, however, to ensure that no one looks through the projector (telescope, pinhole, etc.) directly.[74] A kitchen colander with small holes can also be used to project multiple images of the partially eclipsed Sun onto the ground or a viewing screen. Viewing the Sun's disk on a video display screen (provided by a video camera or digital camera) is safe, although the camera itself may be damaged by direct exposure to the Sun. The optical viewfinders provided with some video and digital cameras are not safe. Securely mounting #14 welder's glass in front of the lens and viewfinder protects the equipment and makes viewing possible.[72] Professional workmanship is essential because of the dire consequences any gaps or detaching mountings will have. In the partial eclipse path, one will not be able to see the corona or nearly complete darkening of the sky. However, depending on how much of the Sun's disk is obscured, some darkening may be noticeable. If three-quarters or more of the Sun is obscured, then an effect can be observed by which the daylight appears to be dim, as if the sky were overcast, yet objects still cast sharp shadows.[75]
Totality
Solar eclipse of August 21, 2017
Baily's beads, sunlight visible through lunar valleys
Composite image with corona, prominences, and diamond ring effect
When the shrinking visible part of the photosphere becomes very small, Baily's beads will occur. These are caused by the sunlight still being able to reach the Earth through lunar valleys. Totality then begins with the diamond ring effect, the last bright flash of sunlight.[76]
It is safe to observe the total phase of a solar eclipse directly only when the Sun's photosphere is completely covered by the Moon, and not before or after totality.[73] During this period, the Sun is too dim to be seen through filters. The Sun's faint corona will be visible, and the chromosphere, solar prominences, and possibly even a solar flare may be seen. At the end of totality, the same effects will occur in reverse order, and on the opposite side of the Moon.[76]
Eclipse chasing
Main article: Eclipse chasing
A dedicated group of eclipse chasers have pursued the observation of solar eclipses when they occur around the Earth.[77] A person who chases eclipses is known as an umbraphile, meaning shadow lover.[78] Umbraphiles travel for eclipses and use various tools to help view the sun including solar viewing glasses, also known as eclipse glasses, as well as telescopes.[79][80]
Photography
The progression of a solar eclipse on August 1, 2008 in Novosibirsk, Russia. All times UTC (local time was UTC+7). The time span between shots is three minutes.
Photographing an eclipse is possible with fairly common camera equipment. In order for the disk of the Sun/Moon to be easily visible, a fairly high magnification long focus lens is needed (at least 200 mm for a 35 mm camera), and for the disk to fill most of the frame, a longer lens is needed (over 500 mm). As with viewing the Sun directly, looking at it through the optical viewfinder of a camera can produce damage to the retina, so care is recommended.[81] Solar filters are required for digital photography even if an optical viewfinder is not used. Using a camera's live view feature or an electronic viewfinder is safe for the human eye, but the Sun's rays could potentially irreparably damage digital image sensors unless the lens is covered by a properly designed solar filter.[82]
Other observations
A total solar eclipse provides a rare opportunity to observe the corona (the outer layer of the Sun's atmosphere). Normally this is not visible because the photosphere is much brighter than the corona. According to the point reached in the solar cycle, the corona may appear small and symmetric, or large and fuzzy. It is very hard to predict this in advance.[83]
Pinholes in shadows during no eclipse (1 & 4), a partial eclipse (2 & 5) and an annular eclipse (3 & 6)
As the light filters through leaves of trees during a partial eclipse, the overlapping leaves create natural pinholes, displaying mini eclipses on the ground.[84]
Phenomena associated with eclipses include shadow bands (also known as flying shadows), which are similar to shadows on the bottom of a swimming pool. They occur only just prior to and after totality, when a narrow solar crescent acts as an anisotropic light source.[85]
1919 observations
See also: Tests of general relativity § Deflection of light by the Sun
Eddington's original photograph of the 1919 eclipse, which provided evidence for Einstein's theory of general relativity.
The observation of a total solar eclipse of May 29, 1919, helped to confirm Einstein's theory of general relativity. By comparing the apparent distance between stars in the constellation Taurus, with and without the Sun between them, Arthur Eddington stated that the theoretical predictions about gravitational lenses were confirmed.[86] The observation with the Sun between the stars was possible only during totality since the stars are then visible. Though Eddington's observations were near the experimental limits of accuracy at the time, work in the later half of the 20th century confirmed his results.[87][88]
Gravity anomalies
There is a long history of observations of gravity-related phenomena during solar eclipses, especially during the period of totality. In 1954, and again in 1959, Maurice Allais reported observations of strange and unexplained movement during solar eclipses.[89] The reality of this phenomenon, named the Allais effect, has remained controversial. Similarly, in 1970, Saxl and Allen observed the sudden change in motion of a torsion pendulum; this phenomenon is called the Saxl effect.[90]
Observation during the 1997 solar eclipse by Wang et al. suggested a possible gravitational shielding effect,[91] which generated debate. In 2002, Wang and a collaborator published detailed data analysis, which suggested that the phenomenon still remains unexplained.[92]
Eclipses and transits
In principle, the simultaneous occurrence of a solar eclipse and a transit of a planet is possible. But these events are extremely rare because of their short durations. The next anticipated simultaneous occurrence of a solar eclipse and a transit of Mercury will be on July 5, 6757, and a solar eclipse and a transit of Venus is expected on April 5, 15232.[93]
More common, but still infrequent, is a conjunction of a planet (especially, but not only, Mercury or Venus) at the time of a total solar eclipse, in which event the planet will be visible very near the eclipsed Sun, when without the eclipse it would have been lost in the Sun's glare. At one time, some scientists hypothesized that there may be a planet (often given the name Vulcan) even closer to the Sun than Mercury; the only way to confirm its existence would have been to observe it in transit or during a total solar eclipse. No such planet was ever found, and general relativity has since explained the observations that led astronomers to suggest that Vulcan might exist.[94]
Artificial satellites
The Moon's shadow over Turkey and Cyprus, seen from the ISS during a 2006 total solar eclipse.
A composite image showing the ISS transit of the Sun while the 2017 solar eclipse was in progress.
Artificial satellites can also pass in front of the Sun as seen from the Earth, but none is large enough to cause an eclipse. At the altitude of the International Space Station, for example, an object would need to be about 3.35 km (2.08 mi) across to blot the Sun out entirely. These transits are difficult to watch because the zone of visibility is very small. The satellite passes over the face of the Sun in about a second, typically. As with a transit of a planet, it will not get dark.[95]
Observations of eclipses from spacecraft or artificial satellites orbiting above the Earth's atmosphere are not subject to weather conditions. The crew of Gemini 12 observed a total solar eclipse from space in 1966.[96] The partial phase of the 1999 total eclipse was visible from Mir.[97]
Impact
The solar eclipse of March 20, 2015, was the first occurrence of an eclipse estimated to potentially have a significant impact on the power system, with the electricity sector taking measures to mitigate any impact. The continental Europe and Great Britain synchronous areas were estimated to have about 90 gigawatts of solar power and it was estimated that production would temporarily decrease by up to 34 GW compared to a clear sky day.[98][99]
Eclipses may cause the temperature to decrease by 3 °C, with wind power potentially decreasing as winds are reduced by 0.7 m/s.[100]
In addition to the drop in light level and air temperature, animals change their behavior during totality. For example, birds and squirrels return to their nests and crickets chirp.[101]
Recent and forthcoming solar eclipses
Main article: List of solar eclipses in the 21st century
Further information: Lists of solar eclipses
Eclipse path for total and hybrid eclipses from 2021 to 2040.
Eclipses occur only in the eclipse season, when the Sun is close to either the ascending or descending node of the Moon. Each eclipse is separated by one, five or six lunations (synodic months), and the midpoint of each season is separated by 173.3 days, which is the mean time for the Sun to travel from one node to the next. The period is a little less than half a calendar year because the lunar nodes slowly regress. Because 223 synodic months is roughly equal to 239 anomalistic months and 242 draconic months, eclipses with similar geometry recur 223 synodic months (about 6,585.3 days) apart. This period (18 years 11.3 days) is a saros. Because 223 synodic months is not identical to 239 anomalistic months or 242 draconic months, saros cycles do not endlessly repeat. Each cycle begins with the Moon's shadow crossing the Earth near the north or south pole, and subsequent events progress toward the other pole until the Moon's shadow misses the Earth and the series ends.[26] Saros cycles are numbered; currently, cycles 117 to 156 are active.[citation needed]
1997–2000
This eclipse is a member of a semester series. An eclipse in a semester series of solar eclipses repeats approximately every 177 days and 4 hours (a semester) at alternating nodes of the Moon's orbit.[102]
Solar eclipse series sets from 1997–2000
Descending node Ascending node
Saros Map Gamma Saros Map Gamma
120
Chita, Russia 1997 March 09
Total 0.91830 125 1997 September 02
Partial (south) −1.03521
130
Total eclipse near Guadeloupe 1998 February 26
Total 0.23909 135 1998 August 22
Annular −0.26441
140 1999 February 16
Annular −0.47260 145
Totality from France 1999 August 11
Total 0.50623
150 2000 February 05
Partial (south) −1.22325 155 2000 July 31
Partial (north) 1.21664
Partial solar eclipses on July 1, 2000 and December 25, 2000 occur in the next lunar year eclipse set.
2000–2003
This eclipse is a member of a semester series. An eclipse in a semester series of solar eclipses repeats approximately every 177 days and 4 hours (a semester) at alternating nodes of the Moon's orbit.[103]
Partial solar eclipses on February 5, 2000 and July 31, 2000 occur in the previous lunar year set.
Solar eclipse series sets from 2000–2003
Ascending node Descending node
Saros Map Gamma Saros Map Gamma
117 2000 July 01
Partial (south) −1.28214 122 2000 December 25
Partial (north) 1.13669
127
Totality from Lusaka, Zambia 2001 June 21
Total −0.57013 132
Partial from Minneapolis, MN 2001 December 14
Annular 0.40885
137
Partial from Los Angeles, CA 2002 June 10
Annular 0.19933 142
Totality from Woomera 2002 December 04
Total −0.30204
147
Culloden, Scotland 2003 May 31
Annular 0.99598 152 2003 November 23
Total −0.96381
2004–2007
This eclipse is a member of a semester series. An eclipse in a semester series of solar eclipses repeats approximately every 177 days and 4 hours (a semester) at alternating nodes of the Moon's orbit.[104]
Solar eclipse series sets from 2004–2007
Ascending node Descending node
Saros Map Gamma Saros Map Gamma
119 2004 April 19
Partial (south) −1.13345 124 2004 October 14
Partial (north) 1.03481
129
Partial from Naiguatá 2005 April 08
Hybrid −0.34733 134
Annular from Madrid, Spain 2005 October 03
Annular 0.33058
139
Total from Side, Turkey 2006 March 29
Total 0.38433 144
Partial from São Paulo, Brazil 2006 September 22
Annular −0.40624
149
From Jaipur, India 2007 March 19
Partial (north) 1.07277 154
From Córdoba, Argentina 2007 September 11
Partial (south) −1.12552
2008–2011
This eclipse is a member of a semester series. An eclipse in a semester series of solar eclipses repeats approximately every 177 days and 4 hours (a semester) at alternating nodes of the Moon's orbit.[105]
Solar eclipse series sets from 2008–2011
Ascending node Descending node
Saros Map Gamma Saros Map Gamma
121
Partial from Christchurch, NZ 2008 February 07
Annular −0.95701 126
Novosibirsk, Russia 2008 August 01
Total 0.83070
131
Palangka Raya, Indonesia 2009 January 26
Annular −0.28197 136
Kurigram, Bangladesh 2009 July 22
Total 0.06977
141
Bangui, Central African Republic 2010 January 15
Annular 0.40016 146
Hao, French Polynesia 2010 July 11
Total −0.67877
151
Partial from Vienna, Austria 2011 January 04
Partial (north) 1.06265 156 2011 July 01
Partial (south) −1.49171
Partial solar eclipses on June 1, 2011, and November 25, 2011, occur on the next lunar year eclipse set.
2011–2014
This eclipse is a member of the 2011–2014 solar eclipse semester series. An eclipse in a semester series of solar eclipses repeats approximately every 177 days and 4 hours (a semester) at alternating nodes of the Moon's orbit.[106][Note 2]
Solar eclipse series sets from 2011–2014
Descending node Ascending node
Saros Map Gamma Saros Map Gamma
118
Partial from Tromsø, Norway 2011 June 01
Partial (north) 1.21300 123
Hinode XRT footage 2011 November 25
Partial (south) −1.05359
128
Middlegate, Nevada 2012 May 20
Annular 0.48279 133
Cairns, Australia 2012 November 13
Total −0.37189
138
Churchills Head, Australia 2013 May 10
Annular −0.26937 143
Partial from Libreville, Gabon 2013 November 03
Hybrid 0.32715
148
Partial from Adelaide, Australia 2014 April 29
Annular (non-central) −0.99996 153
Partial from Minneapolis 2014 October 23
Partial (north) 1.09078
2015–2018
This eclipse is a member of a semester series. An eclipse in a semester series of solar eclipses repeats approximately every 177 days and 4 hours (a semester) at alternating nodes of the Moon's orbit.[107]
Solar eclipse series sets from 2015–2018
Descending node Ascending node
Saros Map Gamma Saros Map Gamma
120
Longyearbyen, Svalbard 2015 March 20
Total 0.94536 125
Solar Dynamics Observatory
2015 September 13
Partial (south) −1.10039
130
Balikpapan, Indonesia 2016 March 9
Total 0.26092 135
L'Étang-Salé, Réunion 2016 September 1
Annular −0.33301
140
Partial from Buenos Aires 2017 February 26
Annular −0.45780 145
Casper, Wyoming 2017 August 21
Total 0.43671
150
Partial from Olivos, Buenos Aires 2018 February 15
Partial (south) −1.21163 155
Partial from Huittinen, Finland 2018 August 11
Partial (north) 1.14758
Partial solar eclipses on July 13, 2018, and January 6, 2019, occur during the next semester series.
2018–2021
This eclipse is a member of a semester series. An eclipse in a semester series of solar eclipses repeats approximately every 177 days and 4 hours (a semester) at alternating nodes of the Moon's orbit.[108]
Note: Partial solar eclipses on February 15, 2018, and August 11, 2018, occurred during the previous semester series.
Solar eclipse series sets from 2018–2021
Ascending node Descending node
Saros Map Gamma Saros Map Gamma
117
Partial from Melbourne, Australia 2018 July 13
Partial −1.35423 122
Partial from Nakhodka, Russia 2019 January 6
Partial 1.14174
127
La Serena, Chile 2019 July 2
Total −0.64656 132
Jaffna, Sri Lanka 2019 December 26
Annular 0.41351
137
Beigang, Yunlin, Taiwan 2020 June 21
Annular 0.12090 142
Gorbea, Chile 2020 December 14
Total −0.29394
147
Partial from Halifax, Canada 2021 June 10