apollo-1845 / 2022-Plankton

Measuring phytoplankton concentration in the oceans and using datasets to determine which factors affect this.
0 stars 0 forks source link

Code to get + save ISS location #6

Closed WebCoder49 closed 1 year ago

WebCoder49 commented 1 year ago
sbottingota commented 1 year ago

Not sure why, but can't seem to get ISS from the orbit library. I'm instead following this tutorial.

WebCoder49 commented 1 year ago

@sbottingota , I think you need to run the code an Astro Pi RPi computer to get the ISS location for the competition; if you're doing this on the ISS I would suggest using the Raspberry Pi tutorial; if not you can use another library such as the one you are looking at.

sbottingota commented 1 year ago

Sorry for not doing this quicker. I wrote a program along the guidelines of the first tutorial here, but as my computer can't seem to find orbit.ISS , I haven't tested it yet.

P.S. Right now it's just meant to get the ISS latetude, longitude and altitude and save them to ISSPositions.json, along with the value from time.time() every 2 seconds, but going forward how should I save the data?

WebCoder49 commented 1 year ago

We want something foolproof, so if Java is built-in it may be a good idea, but Raspberry Pi suggests more compact csv files / png images with metadata.

sbottingota commented 1 year ago

Sorry, I don't really understand. Please could you clarify?

WebCoder49 commented 1 year ago

I meant: We are not completely sure about the format for now. Your use of JSON may be a good setup, but this Raspberry Pi tutorial suggests its own more data-saving setup.

sbottingota commented 1 year ago

I have modified the program to save the ISS position to a .csv file: here

However, at the moment it saves all of the data with the index 0, and at the moment I'm not really sure how to fix that, but I'm working on it.

WebCoder49 commented 1 year ago

I hope you are enjoying the weekend. It appears that you are using pandas but I am not sure whether that is installed on the Astro Pi computer. I would suggest using manual code and file opening method "a" (append) as you will not need to edit existing entries, or use the built-in csv library as shown here. https://projects.raspberrypi.org/en/projects/code-for-your-astro-pi-mission-space-lab-experiment/10

sbottingota commented 1 year ago

Sorry, I didn't realise. I have changed that here.