Погружение в пучину интерпретатора python. ч1
Содержание:
- Historical observations
- The History of IPython and Jupyter Notebooks
- What are notebook extensions?
- Расширения
- External links
- Orbit and Rotation
- Distance, Size and Mass
- Formation
- Инсталяция
- Общие сведения о Юпитере
- Overview
- Exploration of Jupiter
- Footnotes
- Шаг 2 (необязательный). Запуск Jupiter Notebook на сервере
- Natural satellites
Historical observations
The planet Jupiter has been known since ancient times and is visible to the naked eye in the night sky. The Romans named the planet after the Roman god Jupiter (also called Jove). The astronomical symbol for the planet is a stylized representation of the god’s lightning bolt.
The Chinese, Korean, Japanese, and Vietnamese refer to the planet as the «wood star,» based on the Chinese Five Elements. In Vedic Astrology, Hindu astrologers refer to Jupiter as Brihaspati, or «Guru» which means the «Big One.» In Hindi, Thursday is referred to as Guruvaar (day of Jupiter). In the English language Thursday is rendered as Thor’s day, with Thor being identified with the Roman god Jupiter.
In 1610, Galileo Galilei discovered the four largest moons of Jupiter, Io, Europa, Ganymede, and Callisto (now known as the Galilean moons) using a telescope, the first observation of moons other than Earth’s. This was also the first discovery of a celestial motion not apparently centered on the Earth. It was a major point in favor of Copernicus’ heliocentric theory of the motions of the planets; Galileo’s outspoken support of the Copernican theory placed him under the threat of the Inquisition.
In 1892, E. E. Barnard observed a fifth satellite of Jupiter with the 36-inch refractor at Lick Observatory in California. The discovery, a testament to his extraordinary eyesight, made him quickly famous. The moon was later named Amalthea.
The History of IPython and Jupyter Notebooks
To fully understand what the Jupyter Notebook is and what functionality it has to offer you need to know how it originated.
Let’s back up briefly to the late 1980s. Guido Van Rossum begins to work on Python at the National Research Institute for Mathematics and Computer Science in the Netherlands.
Wait, maybe that’s too far.
Let’s go to late 2001, twenty years later. Fernando Pérez starts developing IPython.
In 2005, both Robert Kern and Fernando Pérez attempted building a notebook system. Unfortunately, the prototype had never become fully usable.
Fast forward two years: the IPython team had kept on working, and in 2007, they formulated another attempt at implementing a notebook-type system. By October 2010, there was a prototype of a web notebook, and in the summer of 2011, this prototype was incorporated, and it was released with 0.12 on December 21, 2011. In subsequent years, the team got awards, such as the Advancement of Free Software for Fernando Pérez on 23 of March 2013 and the Jolt Productivity Award, and funding from the Alfred P. Sloan Foundations, among others.
Lastly, in 2014, Project Jupyter started as a spin-off project from IPython. IPython is now the name of the Python backend, which is also known as the kernel. Recently, the next generation of Jupyter Notebooks has been introduced to the community. It’s called JupyterLab.
After all this, you might wonder where this idea of notebooks originated or how it came about to the creators.
A brief research into the history of these notebooks learns that Fernando Pérez and Robert Kern were working on a notebook just at the same time as the Sage notebook was a work in progress. Since the layout of the Sage notebook was based on the layout of Google notebooks, you can also conclude that also Google used to have a notebook feature around that time.
For what concerns the idea of the notebook, it seems that Fernando Pérez, as well as William Stein, one of the creators of the Sage notebook, have confirmed that they were avid users of the Mathematica notebooks and Maple worksheets. The Mathematica notebooks were created as a front end or GUI in 1988 by Theodore Gray.
The concept of a notebook, which contains ordinary text and calculation and/or graphics, was definitely not new.
Also, the developers had close contact with one another and this, together with other failed attempts at GUIs for IPython and the use of «AJAX» = web applications, which didn’t require users to refresh the whole page every time you do something, were two other motivations for the team of William Stein to start developing the Sage notebooks.
If you want to know more details, check out the personal accounts of Fernando Pérez and about the history of their notebooks. Alternatively, you can read more on the history and evolution from IPython to Jupyter notebooks here.
What are notebook extensions?
Jupyter Notebook extensions are simple add-ons that extend the basic functionality of the notebook environment. Written in JavaScript, they do things like autoformat your code or send a browser notification when a cell has completed. Extensions currently only work in Jupyter Notebooks (not Jupyter Lab).
Why use these extensions? Jupyter Notebooks are great tools for teaching, learning, prototyping, exploring, and trying out new methods (or even in production at Netflix). However, vanilla notebooks are limited in features which can make working in them frustrating. While Jupyter Notebook extensions don’t completely solve the problem, they do add a few benefits that will make your work easier.
Расширения
Поскольку Jupyter Notebook имеет открытый исходный код, для него было разработано множество расширений. Вы можете поработать с официальным списком расширений IPython или посмотреть другие популярные расширения.
Вы можете установить Nbextensions в любое время из командной строки.
С помощью pip:
Или с помощью Anaconda:
Как только они будут установлены, вы увидите вкладку Nbextensions.
В этом репозитории можно узнать больше о расширениях, об их включении в ваш документ и исключении из него.
Для работы просто нажмите «Nbextensions» в верхней части экрана, выберите интересующее вас расширение, а затем прокрутите вниз, чтобы найти нужную информацию.
Популярные расширения
- Scratchpad — позволяет создать временную ячейку для выполнения быстрых вычислений без создания новой ячейки в workbook.
- Hinterland — делает доступным меню автозаполнения кода для каждого нажатия клавиши в ячейке кода, а не только для клавиши Tab.
- Snippets — добавляет раскрывающееся меню для вставки фрагментов в текущий документ.
- Autopep8 — автоматически форматирует код на Python в соответствии со стилевым руководством PEP 8. Убедитесь, что на локальной машине выполнена команда . Это гарантирует, что вы будете следовать правильным соглашениям о написании кода в Python.
- Split Cells Notebook — позволяет разделять ячейки. Войдите в командный режим и используйте , чтобы переключить текущую ячейку между разделённой и полной шириной.
- Table of Contents — позволяет собирать все запущенные заголовки и отображать их в плавающем окне, в виде боковой панели или с помощью меню навигации.
- A Code Prettifier — очищает, форматирует и выравнивает ваш код за вас.
- Notify — отображает уведомление на рабочем столе, когда ядро бездействует. Это удобно, когда вы запускаете код, выполнение которого занимает больше пары секунд.
- Code Folding — в режиме редактирования сбоку появляется треугольник, который позволяет скрывать блоки кода. Удобно, когда есть большие функции, которые вы хотите скрыть.
- Zen mode — делает детали менее загроможденными. Убедитесь, что фоны в настройках отключены.
External links
All links retrieved June 15, 2018.
- NASA’s Jupiter fact sheet.
- Jupiter: As Seen By Voyager 1 Data and photos on Jupiter.
- Planets — Jupiter A kid’s guide to Jupiter.
- Galileo and the Medici Family.
- A simulation of the 62 Jovian moons.
- Observing Jupiter — Position, central meridian and moons.
|
|||
|---|---|---|---|
| The Sun · Mercury · Venus · Earth · Mars · Ceres · Jupiter · Saturn · Uranus · Neptune · Pluto · Eris | |||
| Planets · Dwarf planets · Moons: Terran · Martian · Asteroidal · Jovian · Saturnian · Uranian · Neptunian · Plutonian · Eridian | |||
| SSSBs: Meteoroids · Asteroids (Asteroid belt) · Centaurs · TNOs (Kuiper belt/Scattered disc) · Comets (Oort cloud) | |||
| See also astronomical objects and the solar system’s list of objects, sorted by radius or mass. |
Orbit and Rotation
Jupiter rotates once every 10 hours – A Jovian day — thus it has the shortest day of all the planets in the solar system. A Jovian year, on the other hand, is about 12 Earth years, quite long in comparison to its short days. The orbital period is about two-fifths that of Saturn. The orbit of Jupiter is elliptical, inclined about 1.31 degrees when compared to Earth.

The eccentricity of the orbit is about 0.048. This results in its distance from the Sun varying from its perihelion to aphelion by about 75 million km / 46 mi. Jupiter’s upper atmosphere undergoes differential rotation since it’s made out of gases.
Axial tilt
Since Jupiter has a small axial tilt of only 3.13 degrees, it has little seasonal variations Because of this low tilt the poles constantly receive less solar radiation than at the planet’s equatorial region.
Distance, Size and Mass
It is the fifth most distant from the Sun with an average distance of about 5.2 AU. The closest approach is at 4.9 AU and at its farthest 5.4 AU. Its exact position can be checked online since the planet is constantly tracked.

It is the biggest planet of the Solar System, with a mean radius of 43.440 miles / 69.911 km. Almost 11 times bigger than Earth. Jupiter’s radius is about 1/10 the radius of the Sun, and its mass is 0.001 times the mass of the Sun, so the densities of the two bodies are similar.
The diameter at the equator of about 88.846 mi / 142.984 km, and at the poles, the diameter is only 83.082 mi / 133.708 km. The average density of Jupiter is about 1.326 g/cm3, much smaller than all the terrestrial planets.
Jupiter is also 2.5 times more massive than all the other planets combined, having 318 times the mass of Earth. It has a volume of about 1,321 Earths.
Formation
Throughout the universe, there are many planetary systems similar to ours. Most of them contain terrestrial planets like our own and gas giants like Jupiter. However, they also contain super-Earths – planets that are several times more massive than Earth.
This indicates that our own Solar System should also have these types of planets and it is hypothesized that we did have them but they collided with Jupiter in the early formation of the Solar System. This resulted in Jupiter’s migration from the inner solar system to the outer solar system and thus allowed the inner solar planets to form. This theory is called the Grand Tack Hypothesis.
There are theories that hypothesize the fact that Jupiter may have formed before the Sun while others state that Jupiter formed after the sun about 4.5 billion years ago. Gravity pulled swirling gas and dust and resulted in the creation of Jupiter. Sometime around 4 billion years ago Jupiter settled in its current position in the outer solar system.
Инсталяция
Для новичка проще всего начать работу с Jupyter Notebooks, установив дистрибутив Anaconda. Anaconda является наиболее широко используемым дистрибутивом Python для работы с данными и поставляется с предустановленными наиболее популярными библиотеками и инструментами. Некоторые из крупнейших библиотек Python, включенных в Anaconda, включают NumPy, pandas и Matplotlib, хотя вы можете взглянуть на полный список с более чем 1000+ пакетов. Это позволит вам приступить к работе, без хлопот управления бесчисленными установками или беспокойства о зависимостях и проблемах установки, связанных с ОС.
Чтобы установить Анаконду, просто:
- Загрузите последнюю версию Anaconda для Python 3 (игнорируйте Python 2.7).
- Установите Anaconda, следуя инструкциям на странице загрузки и/или в исполняемом файле.
Если вы более продвинутый пользователь с уже установленным Python и предпочитаете управлять своими пакетами вручную, вы можете просто использовать pip для установки Jupyter Notebooks:
pip3 install jupyter
Общие сведения о Юпитере
Юпитер является пятой планетой от Солнца и относится к группе газовых гигантов. Свое название объект получил в честь древнеримского бога, который правит небом и остальными божествами.
Изображение Юпитера в красном фильтре
За время своего существования планета успела обзавестись большим количеством спутников. На данный момент их число составляет 79. Из-за внушительных размеров Юпитер был замечен еще древними людьми: в греции его называли “Звездой Зевса”, а астрономы из Китая подробно описали траекторию движения гиганта на протяжении двенадцати лет.
Между Юпитером находятся Сатурн и Марс. Строение планеты состоит из атмосферы, нескольких слоев и ядра. А магнитное поле небесного тела имеет форму сплющенного диска.
Интересный факт: на Юпитере имеется повышенный радиационный фон. Находящийся на орбите аппарат Galileo получил дозу излучения, которое в 2500% превышает земную критическую отметку.
В 1979 году с помощью зонда Вояджер-1 было установлено, что Юпитер имеет кольца, просто разглядеть их можно лишь на близком расстоянии.
Overview
Approximate size comparison of Earth and Jupiter, including the Great Red Spot.
Jupiter is usually the fourth brightest object in the sky, after the Sun, the Moon, and Venus. At times, however, Mars appears brighter than Jupiter.
Jupiter is 2.5 times more massive than all the other planets combined, so massive that its center of mass with the Sun actually lies above the Sun’s surface (1.068 solar radii from the Sun’s center). It is 318 times more massive than Earth, with a diameter 11 times that of Earth, and its volume is 1300 times as great as that of Earth. Quite naturally, Jupiter’s gravitational influence probably played a large role in the evolution of the Solar System.
Most planetary orbits lie closer to Jupiter’s orbital plane than the Sun’s equatorial plane. (Mercury is the only planet that is closer to the Sun’s equator in orbital tilt.) The majority of short-period comets belong to Jupiter’s family (a result of Jupiter’s mass and relative speed), the gaps («Kirkwood gaps») in the distribution of asteroids in the main belt are mostly due to Jupiter, and the planet may have been responsible for the Late Heavy Bombardment of the inner Solar System’s history. Jupiter has been called the Solar System’s vacuum cleaner, due to its immense gravity well.
As impressive as Jupiter’s mass is, extrasolar planets have been discovered with much greater masses. There is no clear-cut definition of what distinguishes a large planet such as Jupiter from a brown dwarf star, although the latter possesses rather specific spectral lines. Currently, if an object of solar metallicity—the proportion of its matter made up of chemical elements other than hydrogen and helium—is 13 time Jupiter’s mass or larger, large enough to burn deuterium, it is considered a brown dwarf; below that mass (and orbiting a star or stellar remnant), it is considered a planet.
Jupiter is thought to have about as large a diameter as a planet of its composition can; adding extra mass would cause the planet to shrink due to increased gravitational compression. The process of further shrinkage with increasing mass would continue until stellar ignition would be achieved. This has led some astronomers to term it a «failed star.» Although Jupiter would need to be about 75 times as massive to become a star, the smallest red dwarf is only about 30 percent larger than Jupiter.
It is also interesting to note that Jupiter radiates more heat than it receives from the Sun. This additional heat radiation is produced by the «Kelvin-Helmholtz mechanism:» As the planet’s surface cools, the pressure drops and the planet undergoes compression, which heats up the planet’s core. This mechanism is evident on Jupiter and Saturn. It is estimated that Jupiter radiates more energy through this mechanism than it receives from the Sun. As another symptom of this process, the planet shrinks at the rate of a few millimeters each year.
When they were younger and hotter, Jupiter and the other gas giant planets were much larger than they are today. However, because of its lower mass and weaker gravitational pull, Saturn would expand more rapidly than Jupiter with increasing heat. On that basis, one might argue that Saturn must have formerly been larger than Jupiter.
Aurora borealis on Jupiter.
Jupiter also has the fastest rotation rate of any planet within the Solar System, making a complete rotation on its axis in slightly less than ten hours, which results in an equatorial bulge easily seen through an Earth-based amateur telescope. Jupiter is perpetually covered with a layer of clouds, composed of ammonia crystals and possibly ammonium hydrosulfide. It may not have any solid surface, in that the density may simply increase gradually as one moves toward the core.
Jupiter’s best-known feature is the Great Red Spot, a storm larger than the Earth’s size. Mathematical models suggest that the storm is stable and may be a permanent feature of the planet. It is therefore likely that this spot was first observed by Giovanni Domenico Cassini and Robert Hooke four centuries ago. In 2000, three small spots merged to form a larger spot, named Oval BA, which later acquired a red hue very similar to that of the Great Red Spot.
Exploration of Jupiter
A number of probes have visited Jupiter.
Image of Jupiter by Pioneer 10.
Voyager flyby missions
Voyager 1 flew by in March followed by Voyager 2 in July of the same year. The Voyagers vastly improved the understanding of the Galilean moons and discovered Jupiter’s rings. They also took the first close up images of the planet’s atmosphere.
Ulysses flyby mission
In February , solar probe performed a flyby of Jupiter at a distance of 450,000 km (6.3 Jovian radii). The flyby was required to attain a polar orbit around the Sun. The probe conducted studies on Jupiter’s magnetosphere. Since there are no cameras onboard the probe, no images were taken. In February , the probe came again in the vicinity of Jupiter. This time the distance was much greater, about 240 million km.
Jupiter as seen by the space probe Cassini. This is the most detailed global color portrait of Jupiter ever assembled.
Cassini flyby mission
In , the Cassini probe, en route to Saturn, flew by Jupiter and provided some of the highest-resolution images ever made of the planet.
Footnotes
- Working Group on Extrasolar Planets: Definition of a «Planet,» IAU position statement. Retrieved June 8, 2007.
- J. Sommeria, S.D. Meyers, and H.L. Swinney H.L., «Laboratory simulation of Jupiter’s Great Red Spot,» Nature, 331, (1988): 689-693.
- NASA, Jupiter’s New Red Spot. Retrieved June 8, 2007.
- Ellie Crystal’s Metaphysical and Science Website, Jupiter. Retrieved June 8, 2007.
- D. Gautier, et al, «The helium abundance of Jupiter from Voyager», Journal of Geophysical Research, 86, (1981): 8713-8720 (Abstract).
- S.J. Kim, J. Caldwell, A.R. Rivolo, R. Wagner, «Infrared Polar Brightening on JupiterIII. Spectrometry from the Voyager 1 IRIS Experiment,» Icarus, 64, (1984): 233-248.
- A. Simon-Miller, et al, «Jupiter’s White Oval turns red,» Icarus 185, (2006): 558-562.
- The Astrophysics Spectator, «Jupiter’s Magnetosphere.» Retrieved June 8, 2007.
- Project Galileo Homepage, Galileo FAQ. Retrieved June 8, 2007.
- Rockets and Space Transportation, Delta V in the Solar System. Retrieved June 8, 2007.
- NASA Jet Propulsion Laboratory, Jupiter. Retrieved June 8, 2007.
- K. Chan, E. S. Paredes, M. S. Ryne, «Ulysses Attitude and Orbit Operations: 13+ Years of International Cooperation,» American Institute of Aeronautics and Astronautics, (2004).
- NASA Jet Propulsion Laboratory, Galileo: Journey to Jupiter. Retrieved June 8, 2007.
- Encyclopedia of Astrobiology, Astronomy & Spaceflight [http://www.daviddarling.info/encyclopedia/J/Jupiterlife.html Life On Jupiter. Retrieved June 8, 2007.
- T. Hiroi, M.E. Zolensky, and C.M. Pieters, «The Tagish Lake meteorite: A possible sample from a D-type asteroid,» Science, 293, (2001): 2234-2236.
Шаг 2 (необязательный). Запуск Jupiter Notebook на сервере
Для тех, кто установил Jupyter Notebook на удаленный сервер, нужно подключаться к веб-интерфейсу через SSH-туннель. Приложение использует порт (или же ), а SSH-туннель поможет обезопасить соединение с сервером.
SSH-туннелирование с помощью Mac или Linux
Для тех, кто работает с macOS или Linux, нужно выполнить следующую команду в окне терминала:
Команда создаст SSH-подключение, а флаг перенаправит порт локального или клиентского хоста на хост и порт уделенного сервера. То есть все, что работает на порте с серверной стороны, будет работать на порте вашей локальной машины.
При необходимости можно изменить порт на один из ваших вариантов, чтобы избежать использования порта, который уже используется другим процессом:
- — имя пользователя на сервере (например, );
- — это IP-адрес сервера.
Например, для имени пользователя и адреса сервера команда будет следующей:
Если после запуска команды не появляется ошибка, можно переходить в среду программирования и запустить Jupyter Notebook:
После этого, вы получите результат содержащий URL-адрес. Введите его в окне браузера и перейдите к веб-интерфейсу Jupyter Notebook ().
SSH-туннелирование с помощью Windows и Putty
Пользователи Windows могут создать туннель SSH, используя программу Putty.
Сначала нужно ввести URL-адрес сервера или IP-адрес имени хоста, как показано ниже на скриншоте:
Далее нажимаем SSH внизу левой панели, для раскрытия полного меню и нажимаем на слово Tunnels (туннели). Вводим номер локального порта, который будет использоваться для доступа к Jupyter на локальном компьютере. Выбираем порт или выше, чтобы избежать совпадения портов, используемых другими службами, и указываем назначение как , где: — это номер порта, через который работает Jupyter Notebook.
Теперь нажмите кнопку Add (добавить), и порты должны появиться в списке Forwarded ports (Переадресованные порты):
И после этого переходим по адресу (или любым другим портом, который вы выбрали) в веб-браузере, чтобы подключиться к Jupyter Notebook, работающему на сервере.
Natural satellites
- Main article: Jupiter’s natural satellites
Jupiter’s 4 Galilean moons, in a composite image comparing their sizes and the size of Jupiter (Great Red Spot visible). From the top they are: Callisto, Ganymede, Europa and Io.
Jupiter has at least 79 moons. For a complete listing of these moons, please see Jupiter’s natural satellites. For a timeline of their discovery dates, see Timeline of discovery of Solar System planets and their natural satellites.
The four large moons, known as the «Galilean moons», are Io, Europa, Ganymede and Callisto.
Galilean moons
A picture of Jupiter and its moon Io taken by Hubble. The black spot is Io’s shadow.
The tidal force from Jupiter, on the other hand, works to circularize their orbits. This constant tug of war causes regular flexing of the three moons’ shapes, Jupiter’s gravity stretches the moons more strongly during the portion of their orbits that are closest to it and allowing them to spring back to more spherical shapes when they’re farther away. This flexing causes tidal heating of the three moons’ cores. This is seen most dramatically in Io’s extraordinary volcanic activity, and to a somewhat less dramatic extent in the geologically young surface of Europa indicating recent resurfacing.
| The Galilean moons, compared to Earth’s moon Luna | |||||
|---|---|---|---|---|---|
| Name
(Pronunciation key) |
Diameter(km) | Mass(kg) | Orbital radius (km) | Orbital period (days) | |
| Io | eye’-oeˈaɪəʊ | 3643(105% Luna) | 8.9×1022(120% Luna) | 421 700(110% Luna) | 1.77(6.5% Luna) |
| Europa | ew-roe’-pəjʊˈrəʊpə | 3122(90% Luna) | 4.8×1022(65% Luna) | 671 034(175% Luna) | 3.55(13% Luna) |
| Ganymede | gan’-ə-meedˈgænəmid | 5262(150% Luna) | 14.8×1022(200% Luna) | 1 070 412(280% Luna) | 7.15(26% Luna) |
| Callisto | kə-lis’-toekəˈlɪstəʊ | 4821(140% Luna) | 10.8×1022(150% Luna) | 1 882 709(490% Luna) | 16.69(61% Luna) |
Classification of Jupiter’s moons
Before the discoveries of the Voyager missions, Jupiter’s moons were arranged neatly into four groups of four. Since then, the large number of new small outer moons has complicated this picture. There are now thought to be six main groups, although some are more distinct than others. A basic division is between the eight inner regular moons with nearly circular orbits near the plane of Jupiter’s equator, which are believed to have formed with Jupiter, and an unknown number of small irregular moons, with elliptical and inclined orbits, which are believed to be captured asteroids or fragments of captured asteroids.
Europa, one of Jupiter’s many moons.
- Regular moons
- The inner group of four small moons all have diameters of less than 200 km, orbit at radii less than 200,000 km, and have orbital inclinations of less than half a degree.
- The four Galilean moons were all discovered by Galileo Galilei, orbit between 400,000 and 2,000,000 km, and include some of the largest moons in the solar system.
- Irregular moons
It is thought that the groups of outer moons may each have a common origin, perhaps as a larger moon or captured body that broke up.


