---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
File ~/work/code/python/ctdproc/ctdproc/io.py:436, in CTDHex.read_xml_config(self)
435 try:
--> 436 with open(self.xmlfile) as fd:
437 tmp = xmltodict.parse(fd.read())
FileNotFoundError: [Errno 2] No such file or directory: 'data/sta0001.XMLCON'
During handling of the above exception, another exception occurred:
FileNotFoundError Traceback (most recent call last)
Cell In[10], line 3
1 import ctdproc as ctd
2 hexfile = Path('./data/Sta0001.hex')
----> 3 c = ctd.io.CTDHex(hexfile)
File ~/work/code/python/ctdproc/ctdproc/io.py:82, in CTDHex.__init__(self, filename)
73 self._mapunits_freq = dict(
74 t1="°C",
75 t2="°C",
(...)
78 p="dbar",
79 )
81 # extract all data and metadata and convert to physical units
---> 82 self._extract_physical_data()
File ~/work/code/python/ctdproc/ctdproc/io.py:85, in CTDHex._extract_physical_data(self)
84 def _extract_physical_data(self):
---> 85 self.read_xml_config()
86 self.parse_hex()
87 self.physicalunits()
File ~/work/code/python/ctdproc/ctdproc/io.py:439, in CTDHex.read_xml_config(self)
437 tmp = xmltodict.parse(fd.read())
438 except OSError as e:
--> 439 raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), e.filename)
440 sa = tmp["SBE_InstrumentConfiguration"]["Instrument"]["SensorArray"]["Sensor"]
441 # parse only valid sensors
FileNotFoundError: [Errno 2] No such file or directory: 'data/sta0001.XMLCON'
io.read_xml_config <- io.hexfilecrashes for file names with mixed case (a laSta001.hex,Sta001.XMLCOM)Sta001.hexis specified; function looks forSTA001.XMLCONalternativelysta001.XMLCON.---> Should modify
io.read_xml_configbe case agnostic..Example:
This works if I rename
Sta0001.XMLCONtoSTA0001.XMLCONorsta0001.XMLCON. If not, I get the error below.Resulting output
<\details>