dlilien / ImpDAR

An impulse radar processor
GNU General Public License v3.0
27 stars 19 forks source link

Consistent handling of PulseEkko Project files #16

Closed dlilien closed 4 years ago

dlilien commented 4 years ago

These PE files are not handled in a consistent way between the load and load_and_exit methods in lib/load/init.py, and I think it will fail on API loads of GPZ files (I do not have data for testing).

I think the solution is to move all PE the complexity to the load method, set an fn attribute, and then have load_and_exit write based on the fn attribute. This would simplify Gecko files as well. @benhills can you take a look at the PulseEkko aspect of this? While we are at it, maybe there is a better way to handle the user specifying a mix of project and non-project files?

I'll deal with going through and making sure we set fn on load for each filetype, so that load_and_exit can safely just use this for saving.

benhills commented 4 years ago

I think the solution is to move all PE the complexity to the load method, set an fn attribute, and then have load_and_exit write based on the fn attribute.

I moved the partitioning into the load function. I tested with some practice data from Hercules Dome. The updated functionality is that it partitions the lines into a new directory and loads them all as .mat files within that directory.

While we are at it, maybe there is a better way to handle the user specifying a mix of project and non-project files?

I simplified the loop so that it asks what type of file it is looking at and then asks appropriately. The dat list needs to be initialized (i.e. dat=[]) and then appended one-by-one. I don't see that as a problem right now.