Is there life in space?

The International Space Station
The ISS-International Space Station

Here we are again, facing a new incoming red-area-lockdown month(s). We have no choice, the damn virus is spreading faster than ever, so…

What can I do?

image-1

l decided to take it easy and thus went today for a relaxed “hilly” run session at the Monte Stella in Milan.

Once back, I read an article about the ISS-International Space Station, how it produced innovation -in addition to the exploration of the universe- in the fields of pharmaceuticals, disaster response capabilities,  improved material for manufacturing, robotics, bioprinting of human tissues.

I read that ISS has been in space for 20 years, but I wonder where is it now? And what about the Mother of all Questions, is there life in space, flying right over my head in this actual moment? Believe it or not, I think I could code an answer to those questions with Python and open API services. Thus, I decided to blow away dust from my rusty coding skills, and give it a try.

The International Space Station

The ISS – International Space Station is the largest spacecraft in the history of Mankind and spaceflight. They also say it can be visible from the earth, but where is it right now? To answer the question, I am going to code the following user story:

As a terrestrial
I want to be informed where the ISS is
So I can find out if I can see it with the naked eye

The story is implemented with three tasks:

  1. Access data: retrieve the actual longitude/latitude of the ISS from an open API
  2. Manage data: convert the API response  into an easily manageable format (pandas dataframe)
  3. Visualize the dataframe into a graphical object representing the globe and the ISS position
import pandas as pd
import plotly.express as px
#setting the API url
urlAPI= 'http://api.open-notify.org/iss-now.json'
#Query the API and create the dataframe
dIss = pd.read_json(urlAPI)
#populate the dataframe
dIss['latitude'] = dIss.loc['latitude', 'iss_position']
dIss['longitude'] = dIss.loc['longitude', 'iss_position']
dIss.reset_index(inplace=True)
#plotting with plotly
fig=px.scatter_geo(dIss, lat='latitude', lon='longitude')
fig.show()

Et voilà,  here is the position of the ISS. At the moment I am executing the code, the ISS is hovering over South Africa, the opposite side of the world.

Is there life in the space?

Samantha Cristoforetti, Luca Parmitano, and Paolo Nespoli are three Italian Astronauts who have been orbiting and living in the ISS during the last years. Are they into the ISS right now?

Without further ado, here’s the answer. No Italian Astronauts into the ISS right now, but yes, there is life in space. At the moment I am writing these lines, there are seven Humans in space. They are all in the ISS –engaged in Expedition64-, and you can find their actual names, as well as the code to obtain them, here:

# the API service
urlApi = 'http://api.open-notify.org/astros.json'
#call the API and populate the dataframe
dH = pd.read_json(urlApi)
#output the humans in space right now
print(dH)

C:\Python\ISS\venv\Scripts\python.exe C:/Python/ISS/ISS.py
message number people
0 success 7 {‘craft’: ‘ISS’, ‘name’: ‘Sergey Ryzhikov’}
1 success 7 {‘craft’: ‘ISS’, ‘name’: ‘Kate Rubins’}
2 success 7 {‘craft’: ‘ISS’, ‘name’: ‘Sergey Kud-Sverchkov’}
3 success 7 {‘craft’: ‘ISS’, ‘name’: ‘Mike Hopkins’}
4 success 7 {‘craft’: ‘ISS’, ‘name’: ‘Victor Glover’}
5 success 7 {‘craft’: ‘ISS’, ‘name’: ‘Shannon Walker’}
6 success 7 {‘craft’: ‘ISS’, ‘name’: ‘Soichi Noguchi’}

Process finished with exit code 0

So, big KUDOS to these Space Explorers. Only a mindset of relentless Improvement brought Humankind from caves to this point. But we don’t need to fly in space to adopt the same mindset and creating a habit of continuous improvement. Indeed, the lockdown itself can be an opportunity for improvement if we use it to reinforce our agile mindset and improve our skills. So, let’s become a better version of ourselves: let’s study, run, train, improve.

C’è vita nello spazio?

The International Space Station
La ISS-International Space Station

Eccoci di nuovo, passato un anno, in red-area lockdown.
Del resto non c’è scelta tra virus e varianti che hanno ripreso a diffondersi più veloci che mai.

Per sfruttare al meglio la situazione, ho deciso di prenderla con calma e ho cominciato con una corsa “collinare” facile da 7km al Monte Stella di Milano.

Una volta tornato a casa ho letto un interessante articolo su come la ISS, la stazione spaziale internazionale, abbia già prodotto innovazione nei campi più svariati, dal pharma alla prevenzione/risposta dei disastri naturali, manufacturing, robotica e bioprinting di tessuti umani.

L’ISS è nello spazio da 20 anni ma dove si trova in questo esatto momento? C’è qualcuno al suo interno? C’è vita nello spazio? Ho quindi deciso di provare a rispondere a queste domande rispolverando le mie arrugginite coding skills in Python.

LA ISS – International Space Station

La ISS Stazione Spaziale Internazionale è il più grande veicolo spaziale mai costruito nella storia dell’umanità e del volo spaziale. Dicono che sia addirittura visibile da terra quando orbita sulle nostre teste, ma dove si trova in questo esatto momento? Per rispondere, scriverò del codice per sviluppare la seguente user story:

Come terrestre
Voglio sapere dove si trova la ISS in questo esatto momento
Per capire se la posso vedere a occhio nudo

I task collegati alla user story sono i seguenti:

  • Access data: caricamento dell’attuale longitutidine/latitudine della ISS con chiamata ad una Open API che fornisce il servizio di localizzazione
  • Manage data: convertire la risposta dell’API in un formato facilmete gestibile. Userò per questo un dataframe pandas
  • Visualize: decodifica e visualizzazione della posizione dell’ISS su una mappa

Ed ecco il codice:

import pandas as pd
import plotly.express as px
#setting the API url
urlAPI= 'http://api.open-notify.org/iss-now.json'
#Query the API and create the dataframe
dIss = pd.read_json(urlAPI)
#populate the dataframe
dIss['latitude'] = dIss.loc['latitude', 'iss_position']
dIss['longitude'] = dIss.loc['longitude', 'iss_position']
dIss.reset_index(inplace=True)
#plotting with plotly
fig=px.scatter_geo(dIss, lat='latitude', lon='longitude')
fig.show()

Et voilà,  ecco la posizione dell’ISS. Al momento in cui ho eseguito il codice, l’ISS orbitava sopra al Sud Africa, dall’altra parte del mondo.

C’è vita nello spazio?

Samantha Cristoforetti, Luca Parmitano, and Paolo Nespoli sono i tre astronauti italiani che hanno vissuto nello spazio negli ultimi 20 anni. C’è qualcuno di loro nella ISS in questo momento?

Ecco la risposta. IN quest omomento non ci sono astronauti italiani nella ISS ma c’è vita nello spazio, con ben sette umani in orbita, e tutti ospitati dalla ISS nel contesto della –Expedition64. Possiamo verificare e scoprire i loro nomi con una semplice chiamata API:

# the API service
urlApi = 'http://api.open-notify.org/astros.json'
#call the API and populate the dataframe
dH = pd.read_json(urlApi)
#output the humans in space right now
print(dH)

C:\Python\ISS\venv\Scripts\python.exe C:/Python/ISS/ISS.py
message number people
0 success 7 {‘craft’: ‘ISS’, ‘name’: ‘Sergey Ryzhikov’}
1 success 7 {‘craft’: ‘ISS’, ‘name’: ‘Kate Rubins’}
2 success 7 {‘craft’: ‘ISS’, ‘name’: ‘Sergey Kud-Sverchkov’}
3 success 7 {‘craft’: ‘ISS’, ‘name’: ‘Mike Hopkins’}
4 success 7 {‘craft’: ‘ISS’, ‘name’: ‘Victor Glover’}
5 success 7 {‘craft’: ‘ISS’, ‘name’: ‘Shannon Walker’}
6 success 7 {‘craft’: ‘ISS’, ‘name’: ‘Soichi Noguchi’}

Process finished with exit code 0

Tanto di cappello a questi esploratori dello spazio. Solo un mindset di continuo miglioramento ha portato l’umanità dalle caverne alle orbite spaziali. Ma non serve essere astronauti per coltivare lo stesso mindset, e il lockdown/area rossa può essere l’opportunità per dedicare maggior tempo a diventare una versione migliore di noi stessi: studiamo, alleniamoci, corriamo, miglioriamo.

Tu cosa stai facendo per migliorarti?