I am trying to save a QTable object which originates from a Isophote list of an elliptical isophote fit, to really any filetype (.txt, .csv, etc.) that allows me to simply just load it back into the script without having to clean it or any of that sorts.
- The QTable is created as follows:
example_isolist = ellipse_example.fit_image(sclip=3., nclip=3) #performing elliptical isophote fit and creating the Isophote list
example_isolist_tab = example_isolist.to_table() #converting to QTable
- My attempt:
import json
with open("example_isolist_tab.txt", 'w') as f:
json.dump(example_isolist_tab, f, indent=2)
Using json here does not work. The following error occurrs:
TypeError: Object of type QTable is not JSON serializable
Anybody here got experience with photutils data handling or saving an isophote fit to a file ? It should be a very simple thing really, just a way so I don't have to rerun my entire script each time I want to work with the results from the isophote fit. My whole data set contains 26 images which would mean roughly 2.5h computation time without saving in between.
Thanks in advance!