-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Curiosity Scraper Fix #200
base: master
Are you sure you want to change the base?
Conversation
@AidanPowers I came across this issue as well and did some digging into it. Are you sure that the URL you're using will only return Curiosity images? There doesn't seem to be any filtering by the rover name? That being said, the perseverance scraper uses this URL, which doesn't reference perseverance by name either: Is there some documentation around |
@adamjcolvin Unfortunately I was not able to find any documentation on this API, but here was my thought process: In the Perseverance scraper link there is a category for "mars2020" which is assuredly the internal name for the rover. However I did not get any returns when looking at "mars2009", "mars2010", and so on. This is the webpage for viewing the latest images downloaded from Curiosity: However, it uses some different tags at the end of the URL as compared to the old API. Given that this is a newer API, it should be more similar to the Perseverance API, so I based my scraper off that code. I think that this is a Curiosity exclusive API for a few reasons: Also feel free to improve/replace of my code or API stuff, this project is my first experience with Ruby or API development, so bugs are highly likely. |
It looks like the old CuriosityScraper was broken sometime early this year.
The good news is the PerseveranceScraper is a newer version with some similarity.
After working through the website, it looks like this is the new link for the raw image json
https://mars.nasa.gov/api/v1/raw_image_items/?order=sol%20desc,instrument_sort%20asc,sample_type_sort%20asc,%20date_taken%20desc&per_page=200&page=0&condition_1=msl:mission&condition_2=4327:sol:in
I have implemented this new link, and attempted to merge it with the Perseverance logic
As a warning, this is my first project like this so please carefully review code before merge.
If an instrument name is not found in the database, it will add it. I am not sure if this is necessary as I may have not properly set up my database with the instrument names initially.
Here it is working on local host through my docker container for latest images, I am unsure if it will work for the older images on the main instance.