Skip to main content

Linea Solar System Portal (lineaSSP)

lineaSSP is a Python package designed to simplify interactions with the Solar System Portal API. The package allows users to retrieve and analyze data related to asteroids, their predictions, occultation events, and more.

Features

  • Prediction Queries: Access detailed occultation prediction events.
  • Asteroid Queries: Retrieve detailed information about asteroids based on various parameters such as name, number, and dynamical class.
  • Map Generation: Create visual maps for occultation events to assist with observation planning.
  • Geographical Filtering: Filter predictions based on visibility from a specific geographic location.

Installation

To install the lineaSSP package, use pip:

pip install lineassp

Usage

Below are detailed examples demonstrating how to use the lineaSSP package.

Initializing the API

Before making any requests, you need to initialize the API with the desired endpoint:

from lineaSSP import Prediction, Asteroid

# Initialize the Prediction API
prediction_api = Prediction()

# Initialize the Asteroid API
asteroid_api = Asteroid()

Fetching Asteroids by Name

To retrieve information about asteroids by their name:

from lineaSSP import Asteroid

# Initialize the Prediction API
asteroid_api = Asteroid()

# Fetch asteroids by name
asteroids = asteroid_api.by_name(name='Ceres')
print(asteroids)

Fetching Asteroids with Predictions

To get a list of asteroids that have prediction data available:

from lineaSSP import Prediction

# Initialize the Prediction API
prediction_api = Prediction()

# Fetch asteroids with predictions
asteroids_with_predictions = prediction_api.asteroids_with_prediction()

# Print the asteroid list
print(asteroids_with_predictions['results'])

Fetching Occultation Predictions by Asteroid Name

To retrieve occultation predictions for a specific asteroid by its name:

from lineaSSP import Prediction
import pandas as pd

# Initialize the Prediction API
prediction_api = Prediction()

# Fetch occultation predictions for a specific asteroid by its name
predictions = prediction_api.by_name('Chariklo', limit='all')

# Print the predictions
df = pd.DataFrame(predictions)
df

IMPORTANT - Queries are paginated by default

Use the parameter limit = 'all' to retrive all predictions returned by the query. Due to pagination, the query is limited to 1000 entries by default.

Fetching Occultations Predictions by Date Range

Retrieve occultation events occurring within a specific date range:

from lineaSSP import Prediction
import pandas as pd

# Initialize the Prediction API
prediction_api = Prediction()
params = {
    'date_time_after': '2024-06-28T00:00:00Z',
    'date_time_before': '2024-06-29T23:59:59Z',
    'magnitude_max': 12,
    'nightside': True,
    'local_solar_time_after': '21:00',
    'local_solar_time_before': '03:00',
}

predictions = prediction_api.get_data(params=params)
df = pd.DataFrame(predictions)
df

Generating a Map for an Occultation Event

Generate a map directly from the results of an occultation prediction query.

Disclaimer: When using maps generated by lineaSSP, please cite the SORA package. To customize maps further, please refer to the detailed documentation available at SORA maps generation documentation.

This allows for easy visualization of where an occultation event will be observable:

from lineaSSP import generate_map, Prediction

# Initialize the Prediction API
prediction_api = Prediction()

# Fetch occultations within a certain date range
params = {
    'date_time_after': '2024-01-01T00:00:00Z',
    'date_time_before': '2024-12-31T23:59:59Z',
    'magnitude_max': 10,
}
occultations = prediction_api.get_data(params=params, limit=10)

# Generate the map using the fetched data
# the fucntion will iterate generation all maps in the list
generate_map(data=occultations, dpi=300, path='./')

You can use the genearte_map function as a wrapper of the original SORA function passing directly *argsand **kwargs. Please follow the SORA maps documentantion, specially docstrings, to check it out.

Filtering Predictions by Geographical Location with geofilter

The geofilter method allows you to filter occultation predictions to see which ones are visible from a specific geographical location. This is particularly useful for planning observations:

from lineaSSP import geofilter, Prediction
import pandas as pd

latitude = -23.55  # Latitude of the location (e.g., São Paulo, Brazil)
longitude = -46.63  # Longitude of the location
radius = 100  # Search radius in kilometers

# Initialize the Prediction API
prediction_api = Prediction()

# Fetch occultations within a certain date range
params = {
    'date_time_after': '2024-01-01T00:00:00Z',
    'date_time_before': '2024-12-31T23:59:59Z'
}
predictions = prediction_api.get_data(params=params)

# Filter these occultations by geographical visibility
filtered_predictions = geofilter(predictions, latitude=latitude, longitude=longitude, radius=radius)

df = pd.DataFrame(filtered_predictions)
df

API Query Parameters

The lineaSSP package allows querying the API with various parameters to retrieve specific data when passing the params dictionary. Below is a detailed table of all the parameters that can be used with the Prediction class.

Occultation Query Parameters

Parameter Description Type
date_time_after Fetch occultations occurring after this date String
date_time_before Fetch occultations occurring before this date String
diameter_max Maximum diameter (km) Double
diameter_min Minimum diameter (km) Double
base_dynclass Object's base dynamical classification (Skybot) String
dynclass Object's dynamical subclass (Skybot) String
event_duration_max Maximum event duration (seconds) Double
event_duration_min Minimum event duration (seconds) Double
jobid Job ID of the occultation event Integer
latitude Latitude for geographical filtering Double
local_solar_time_after Local Solar Time After String
local_solar_time_before Local Solar Time Before String
location_radius Radius around the location to check for visibility Double
longitude Longitude for geographical filtering Double
magnitude_drop_max Maximum expected star's magnitude drop Double
magnitude_drop_min Minimum expected star's magnitude drop Double
magnitude_max Maximum magnitude (Gaia G magnitude) Double
magnitude_min Minimum magnitude (Gaia G magnitude) Double
nightside Filter for occultations on the nightside Boolean
name Object name (multiple values may be separated by commas) String
number Object number (multiple values may be separated by commas) Integer
closest_approach_uncertainty_km_max Closest approach uncertainty in geocentric distance (max, km) Double
closest_approach_uncertainty_km_min Closest approach uncertainty in geocentric distance (min, km) Double
hash_id Hash ID String

Contributing

We welcome contributions to enhance the functionality of lineaSSP. Please submit issues and pull requests on the GitHub repository.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Metadata

Release files for lineaSSP 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lineaSSP 0.1.2
File Size Uploaded Provenance
lineassp-0.1.2.tar.gz 22.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for lineaSSP 0.1.2
File Interpreter ABI Platform
lineaSSP-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 44.4 kB

Release files / lineassp-0.1.2.tar.gz

Download URL lineassp-0.1.2.tar.gz
Size 22.7 kB
Tags Source
SHA-256 checksum
How to use checksums
95212f4d3f4cf1a3a93318053724c40cd00408ba8e0a3828236e2216d687f82e
BLAKE2b-256 checksum
How to use checksums
1ee2840142f5b5d08faaca796881d54f8a9854c00fba6013464f0dec4a93e849
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release files / lineaSSP-0.1.2-py3-none-any.whl

Download URL lineaSSP-0.1.2-py3-none-any.whl
Size 21.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1c1451a35592865922277454521d40ba82f3c253ded44fc09bee57aa38885a01
BLAKE2b-256 checksum
How to use checksums
1354905cabb43c189ae53f641243f0b434d2f56ab5d71f341e2a522bcddd475a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Security for lineaSSP 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page