Determine the Spectra File Type
Source:R/seasonder_specsHandling.R
seasonder_find_spectra_file_type.Rd
This function identifies the type of a spectra file (either "CS" or "CSSY") by reading its header block based on YAML specifications. It first attempts to read a key size block using the CSSY specifications, and if that fails, it reopens the file and tries to read the CS header block.
Details
The function sets up error handling parameters and uses YAML specifications retrieved via
seasonder_readYAMLSpecs
and seasonder_defaultSpecsFilePath
. It opens the file in binary read mode
and ensures the connection is closed upon exit. If reading the key size block fails, it reopens the file to try
reading the CS header block. The final file type is determined by the key returned from the file block.