示例#1
0
def test_record_from_name(mock_record_from_name, mock_orbit_from_record):
    name = "example_name"
    mock_orbit_from_record.return_value = iss
    mock_record_from_name.return_value = [1]

    assert dastcom5.orbit_from_name(name) == [iss]
    mock_record_from_name.assert_called_with(name)
示例#2
0
def test_record_from_name(mock_record_from_name, mock_orbit_from_record):
    name = "example_name"
    mock_orbit_from_record.return_value = iss
    mock_record_from_name.return_value = [1]

    assert dastcom5.orbit_from_name(name) == [iss]
    mock_record_from_name.assert_called_with(name)
示例#3
0
# ```Python
# dastcom5.download_dastcom5()
# ```

# The main DASTCOM5 advantage over NeoWs is that you can use it to search not only NEOs, but any asteroid or comet. The easiest function is `orbit_from_name()`:

# In[7]:


from poliastro.neos import dastcom5


# In[8]:


atira = dastcom5.orbit_from_name("atira")[0]  # NEO
wikipedia = dastcom5.orbit_from_name("wikipedia")[0]  # Asteroid, but not NEO.

frame = StaticOrbitPlotter()
frame.plot(atira, label="Atira (NEO)")
frame.plot(wikipedia, label="Wikipedia (asteroid)");


# Keep in mind that this function returns a list of orbits matching your string. This is made on purpose given that there are comets which have several records in the database (one for each orbit determination in history) what allow plots like this one:

# In[9]:


halleys = dastcom5.orbit_from_name("1P")

frame = StaticOrbitPlotter()