Space Science with Python - Space Maps

In our last tutorials we computed the position and velocity vectors of different celestial objects. We determined the apparent angular distance between objects (so called phase-angle) and worked on some small projects using Python and the NASA library SPICE (using the SPICE wrapper spiceypy).

#space-science-with-python #science #space #programming #pyhton

What is GEEK

Buddha Community

Space Science with Python - Space Maps
Ray  Patel

Ray Patel


Lambda, Map, Filter functions in python

Welcome to my Blog, In this article, we will learn python lambda function, Map function, and filter function.

Lambda function in python: Lambda is a one line anonymous function and lambda takes any number of arguments but can only have one expression and python lambda syntax is

Syntax: x = lambda arguments : expression

Now i will show you some python lambda function examples:

#python #anonymous function python #filter function in python #lambda #lambda python 3 #map python #python filter #python filter lambda #python lambda #python lambda examples #python map

Ray  Patel

Ray Patel


top 30 Python Tips and Tricks for Beginners

Welcome to my Blog , In this article, you are going to learn the top 10 python tips and tricks.

1) swap two numbers.

2) Reversing a string in Python.

3) Create a single string from all the elements in list.

4) Chaining Of Comparison Operators.

5) Print The File Path Of Imported Modules.

6) Return Multiple Values From Functions.

7) Find The Most Frequent Value In A List.

8) Check The Memory Usage Of An Object.

#python #python hacks tricks #python learning tips #python programming tricks #python tips #python tips and tricks #python tips and tricks advanced #python tips and tricks for beginners #python tips tricks and techniques #python tutorial #tips and tricks in python #tips to learn python #top 30 python tips and tricks for beginners

Teresa  Jerde

Teresa Jerde


Space Science with Python — A very bright Opposition


This is the 19th part of my Python tutorial series “Space Science with Python”. All codes that are shown here are uploaded on GitHub. Enjoy!


Today, we will cover another brightness related topic: the computation and determination of the apparent magnitude of asteroids. We cover some more conceptual topics in the next article and then we will start with an asteroid related science project, coming with tutorial #20! If you need some information about the magnitude scale in astronomy, I would recommend to go first with my previous article:

Space Science with Python — Bright Dots in the Dark Sky

Part 16 of the tutorial series describes another important basic concept in Space Science: the brightness of objects.

The complex nature of reflections

Did you take a look in the mirror this morning? Probably. But this space science article is not about your perception of yourself; it is about the laws of physics behind it. Plane mirrors and their reflective properties can easily be explained: Entrance Angle of the light = Exit Angle of the light. Done.But in space we do not have mirrors or simple geometries that allow us to compute the brightness of e.g., comets, meteors or asteroids. Most equations in this regard are empirically determined and are only valid within a certain solution space. In this article, we will continue with the topic that started some sessions ago: Asteroids.

#python #space #science #data-science #space-science-with-python

Space Science with Python - Uncertain Movements of an Asteroid

Tunguska 1908

It’s the 30th June 1908. A huge explosion devastated in a short period of time hundreds of square-kilometres in the Russian region of Tunguska. Millions of trees were bend and burnt down in this Siberian region. For the researchers and people who live there, this so-called Tunguska Event was a mystery of unknown cause.

This coloured photo was taken 21 years after the Tunguska Event. The logs point away from a theoretical shock wave direction (right to left). Image from Wikipedia; Credit: Vokrug Sveta

_What happened? _Well, there are several explanations:

  • A gas explosion. A large amount of methane or other gases ignited and caused this event.Another geophysical explanation: A volcanic-like eruption was mistaken for an explosion and devastated everything around the eruption centreAn asteroid or comet entered the Earth’s atmosphere and exploded on its way to the surface. Similar as the Meteor of Chelyabinsk in the year 2013 that had a diameter of only 20 m

Dash cam footage of the Chelyabinsk meteor in Russia. An explosion, several km above the surface caused a shock wave that destroyed doors, gates and windows. Hundreds of people have been injured, but luckily no one died.

The last option is currently the most accepted theory. One assumes that the diameter of this asteroid was between 30 and 70 metres. It shows that even small celestial objects can have a catastrophic environmental impact on our home planet .
To remind us of cosmic hazards the Asteroid Day was introduced a few years ago. The date: 30th June — The day of the Tunguska Event.

#python #data-science #space-science-with-python #science #space

Space Science with Python — Density Estimators in the Sky

Last time

Last week was Asteroid Day! A day that was introduced to remind us that cosmic threats are real … not only for the Dinosaurs, but also in recent decades like the Tunguska event in 1908 or the Meteor of Chelyabinsk in the year 2013.

Observation surveys, follow up measurements, simulations, and so on are required to catalogue and understand our very cosmic vicinity. Currently, there are no larger objects on a direct collision course with our blue planet. However, observational errors propagate through to data and do not allow us to determine the position of an object with 100 % accuracy. The error-bars depend on the number of observations, observational conditions, total observation time, the distance to the object, its movement and brightness and other factors. It is a multi-dimensional error that can only be faced with more and more and even more data.Luckily, 2020 JX1 is a “good” asteroid and the error-bars during the recent fly-by were quite small (considering cosmic scales).But X, Y and Z coordinates do not help us at all … we need to set ecliptic, equatorial or azimuthal coordinates for our telescopes. Further, we have a solution space of Cartesian coordinates. _How can we translate this solution space to a proper ecliptic coordinate system function? _Let’s find out!

Space Science with Python — Space maps

Part 5 of the tutorial series shows how to calculate and understand coordinate systems that are used for all upcoming…

Multidimensional Kernel Density Estimators

scikit-learnis a great resource for data science and machine learning algorithms. The library covers classifications, dimension reduction, as well as feature engineering and also clustering methods. The sophisticated documentation provides examples for miscellaneous use cases: One example covers the application of Kernel Density Estimators (KDEs) in spherical coordinates. Instead of the Euclidean metric, this example uses the so-called Haversine metric that is applied on the longitude and latitude values in radians:

A KDE for ecliptic longitude and latitude coordinates appears suitable: Let’s go.For this tutorial, we use the already introduced libraries numpypandastqdm and maptlotlib. We then load the data that were created last time (the file is also part of the GitHub repository).

#data-science #science #space #space-science-with-python #python