wright-group / WrightTools

Tools for loading, processing, and plotting multidimensional spectroscopy data.
http://wright.tools
MIT License
17 stars 9 forks source link

data `from_text` #153

Closed ksunden closed 7 years ago

ksunden commented 7 years ago

Currently this seems to be a rather specific text format reader for Brunold rRaman files

I feel like this could be made more general to any tab separated file, but think that it needs to be considered exactly what specifications should be there.

If we expand, it should not check for expected filetypes, as any plaintext file will do.

There is also a portion in the verbose output that references datas a variable that does not exist

untzag commented 7 years ago

I have been thinking of getting rid of from_text. I much rather have each from method be entirely separate. I know that this will mean more lines of code, but I think that portability is more important here.

Anyway, there are great tools like np.genfromtext that do most of what we want anyway.

ksunden commented 7 years ago

I can agree to that, regardless, from_text which expects specifically rRaman files is confusing

ksunden commented 7 years ago

@neffmallon has mentioned that from_text is used for files from the raman instrument downstairs

This should likely have its own from method, but should be done concurrently with removing from_text

neffmallon commented 7 years ago

*from the IR instrument downstairs.

ksunden commented 7 years ago

Yeah, sorry, I mistyped that, read it back a little bit ago, and thought that sounded incorrect

untzag commented 7 years ago

which IR instrument? we have from_Tensor27

ksunden commented 7 years ago

I actually think maybe we want to keep from_text in some form, but maybe rename it to something like from_ascii_xy and put some specificity into what we expect

Maybe with support for headers which specify channel/axis names, though I think it would be limited to single axis, potentially with multiple channels though

There is a helpful list provided by Essential FTIR of many common spectroscopy formats: http://www.essentialftir.com/filetypes.html

Here, they do list ascii (x,y) pairs, which seems to be a generic enough format, which we could pretty easily support, but need to be clear that is what it means

ksunden commented 7 years ago

Keeping it around with some flexible options (perhaps kwargs for channel names, etc) would also make it a powerful way to create many of the common formats with minimal effort

untzag commented 7 years ago

I guess that sounds reasonable, but it does worry me. I really don't trust users to remember the details of specific file types, which I why I much prefer dedicated from methods whenever possible. I worry that everyone would just start using from_ascii, never remembering to use the dedicated methods.

I guess I'm OK with such a method existing, as long as it doesn't get advertised for general use.

untzag commented 7 years ago

from_text has been removed (see #233)