Skip to content

Is there a way to add file types to the read_omnic protocol? #455

Answered by atravert
chet-j-ski asked this question in Q&A
Discussion options

You must be logged in to vote

@chet-j-ski, readers have been added en the DEV version and will be included in the next scpy release.

  • scp.read_hdr(), scp.read_ddr(), scp.read_sdr() will read only .hdr, .ddr or .sdr, repectively
  • scp.read_soc() and the generic reader scp.read() will read any of .hdr, .ddr or .sdr single file
  • if several files are present in the same directory the can be read at once with scp.read_dir

For instance, the following are equivalent:

a = scp.read_hdr("Fused Silica0004.HDR")
b = scp.read_soc("Fused Silica0004.HDR")
c = scp.read("Fused Silica0004.HDR")

and if the 3 sample files (hdr, ddr, adn sdr) are present, the following will return a single dataset containing the 3 spectra:

scp.read_dir(".")

Replies: 7 comments 10 replies

Comment options

You must be logged in to vote
1 reply
@chet-j-ski
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@chet-j-ski
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@fernandezc
Comment options

@atravert
Comment options

@fernandezc
Comment options

@atravert
Comment options

Comment options

You must be logged in to vote
2 replies
@chet-j-ski
Comment options

@atravert
Comment options

Comment options

You must be logged in to vote
2 replies
@fernandezc
Comment options

@chet-j-ski
Comment options

Answer selected by chet-j-ski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants