nasa / ominas

Opensource Multi-INstrument Analysis Software
15 stars 5 forks source link

Generic kernel detection #2

Open penteado-jpl opened 6 years ago

penteado-jpl commented 6 years ago

From @jnspitale on February 22, 2017 22:1

I incorporated Vance's kernel detectors into ominas last week. Initially they seemed to work suspiciously well, and of course I realized yesterday that I had the SPK auto detection turned off, so I had only been testing the CK detector. The SPK detector had some issues, and in looking at the code I realized that the functionality was almost identical between the two, so I reorganized things so that there's only one kernel database code that works for both.

Another thing I realized is that Vance was reinventing the wheel in some ways, (Paulo is probably doing the same), a symptom of the fact that there is no coding guide. For example, we already have routines that can read and write csv files called read_txt_table and write_txt_table. You just specify a comma as a delimiter. Also, there's a very useful function called append_array that takes care of that annoying thing where you want to add an element to an array and you have to first check whether it exists. I incorporated things like that to simplify the code further, and I added a cache so the db files don't have to be read every time the detectors are used; just the first time in a session. And I have started keeping notes for a coding guide.

The remaining issue with the SPK detector is that it returns way too many kernels. For Cassini images, I'm getting 48 SP kernels. It works nicely, but that's inefficient. We need the minimum set that contains all the bodies of interest. I think that means we need to add body ids to the kernel database. I'll be interested in some discussion on this. I think we just need an additional column that is a space-separated list of naif ids covered in the file.

My overall conclusion on this little project is that it's pretty awesome. While it's never going to be possible to automatically provide the absolute best kernel pool with this general approach, it it possible to put together a kernel pool that works pretty well, and one can always substitute a detector that's specific to a given project. This is a vast improvement over the past.

Copied from original issue: ppenteado/ominas#4