In this SDK you can choose from different Rovers, Cameras and Sol numbers to return different images and information from the Rovers.
This is a Python implementation of the NASA Mars Rover API.
Download Python for your system https://www.python.org/downloads/
Apply for your key here: https://api.nasa.gov/index.html#apply-for-an-api-key
Mars Rover Documenation: https://api.nasa.gov/api.html#MarsPhotos
Create your config.py
file with the variable my_api_key
. Assign your new API key, save and close that file.
mostRecentSolDateImage - Returns the most recent image from the Rover selected with the camera of choice. (For best results Curiosity has the most image returns.) You will need to pass 2 parameters for the Rover name and the Camera you wish to use. The randomPhoto function is run during photo selection which will return an image from the first 5 place holders in the data.
Example:
mostRecentSolDateImage("curiosity", "rhaz")
In the example above you can see the Curiosity Rover was entered as the rover_name
parameter and rhaz
entered as the camera
parameter.
customSearch - Customize your Search. This function takes 3 parameters. Yyou can set the Rover, Sol, and Camera. The result will show the appropriate image. The randomPhoto function is run during photo selection which will return an image from the first 5 place holders in the data.
Example:
customSearch("curiosity", 797, "navcam")
roverMissionStatus - Returns the Rovers Status. This function takes 1 parameter and is looking for the Rover name.
Example:
roverMissionStatus("opportunity")
missionManifest - Returns the Mission Manifest from the chosen Rover. This function takes 1 parameter and is looking for the Rover name.
Example:
missionManifest("curiosity")
mostRecentSol - Returns the Most Recent Sol from chosen Rover. This function takes 1 parameter and is looking for the Rover name.
Example:
mostRecentSol("curiosity")
missionSol - Returns every mission Sol number. This function takes 1 parameter and is looking for the Rover name.
Example:
missionSol("curiosity")
totalPhotosGreaterThan - Returns the sol missions that contain more than a set number of photos. This function takes 2 parameter and is looking for the Rover name and a number to use as the min number of photos.
Example:
totalPhotosGreaterThan("curiosity", 1000)
These are the Rovers you can choose from:
- Curiousity
- Opportunity
- Spirit
The following is a list of cameras you can use in your search. (Sourced from the Mars Rover Documenation linked above)
Cameras are available for Rovers listed based on: C - Curiosity O - Opportunity S - Spirit
- FHAZ (Front Hazard Avoidance Camera) - Available for: C, O, S
- RHAZ (Rear Hazard Avoidance Camera) - Available for: C, O, S
- MAST (Mast Camera) - Available for: C
- CHEMCAM (Chemistry and Camera Complex) - Available for: C
- MAHLI (Mars Hand Lens Imager) - Available for: C
- MARDI (Mars Descent Imager) - Available for: C
- NAVCAM (Navigation Camera) - Available for: C, O, S
- PANCAM (Panoramic Camera) - Available for: O, S
- MINITES (Miniature Thermal Emission Spectrometer (Mini-TES) - Available for: O, S