-
Notifications
You must be signed in to change notification settings - Fork 18
Description
I have been trying to read images from New Horizons MVIC data on a Linux OS (Ubuntu 20.04.2 LTS). I tried both adding .img and .lbl file but neither worked. Below the error:
from planetaryimage import PDS3Image
image = PDS3Image.open('....\mvic_0299178092_0x536_sci_pl.img')
or
image = PDS3Image.open('....\mvic_0299178092_0x536_sci_pl.lbl')
----------------------------for img file--------------------------------
KeyError Traceback (most recent call last)
in
1 from planetaryimage import PDS3Image
----> 2 image = PDS3Image.open('mvic_0299178092_0x536_sci_pl.img')
~/anaconda3/lib/python3.7/site-packages/planetaryimage/image.py in open(cls, filename)
35 else:
36 with open(filename, 'rb') as fp:
---> 37 return cls(fp, filename)
38
39 def init(self, stream_string_or_array, filename=None, compression=None):
~/anaconda3/lib/python3.7/site-packages/planetaryimage/image.py in init(self, stream_string_or_array, filename, compression)
75
76 #: A numpy array representing the image
---> 77 self.data = self._load_data(stream_string_or_array)
78
79 def repr(self):
~/anaconda3/lib/python3.7/site-packages/planetaryimage/image.py in _load_data(self, stream)
156
157 def _load_data(self, stream):
--> 158 if self.data_filename is not None:
159 return self._load_detached_data()
160
~/anaconda3/lib/python3.7/site-packages/planetaryimage/image.py in data_filename(self)
130 def data_filename(self):
131 """Return detached filename else None."""
--> 132 return self._data_filename
133
134 @Property
~/anaconda3/lib/python3.7/site-packages/planetaryimage/pds3image.py in _data_filename(self)
300 @Property
301 def _data_filename(self):
--> 302 return self._image_pointer.filename
303
304 @Property
~/anaconda3/lib/python3.7/site-packages/planetaryimage/pds3image.py in _image_pointer(self)
313 @Property
314 def _image_pointer(self):
--> 315 return Pointer.parse(self.label['^IMAGE'], self.record_bytes)
316
317 @Property
~/anaconda3/lib/python3.7/site-packages/pvl/collections.py in getitem(self, key)
173 if isinstance(key, (int, slice)):
174 return self.__items[key]
--> 175 return dict_getitem(self, key)[0]
176
177 def delitem(self, key):
KeyError: '^IMAGE'
----------------------------for lbl file------------------------------------
FileNotFoundError Traceback (most recent call last)
in
1 from planetaryimage import PDS3Image
----> 2 image = PDS3Image.open('mvic_0299178092_0x536_sci_pl.lbl')
~/anaconda3/lib/python3.7/site-packages/planetaryimage/image.py in open(cls, filename)
35 else:
36 with open(filename, 'rb') as fp:
---> 37 return cls(fp, filename)
38
39 def init(self, stream_string_or_array, filename=None, compression=None):
~/anaconda3/lib/python3.7/site-packages/planetaryimage/image.py in init(self, stream_string_or_array, filename, compression)
75
76 #: A numpy array representing the image
---> 77 self.data = self._load_data(stream_string_or_array)
78
79 def repr(self):
~/anaconda3/lib/python3.7/site-packages/planetaryimage/image.py in _load_data(self, stream)
157 def _load_data(self, stream):
158 if self.data_filename is not None:
--> 159 return self._load_detached_data()
160
161 stream.seek(self.start_byte)
~/anaconda3/lib/python3.7/site-packages/planetaryimage/image.py in _load_detached_data(self)
172 filename = os.path.abspath(os.path.join(dirpath, self.data_filename))
173
--> 174 with open(filename, 'rb') as stream:
175 return self._decode(stream)
FileNotFoundError: [Errno 2] No such file or directory: '/home/emran/SPAC/Pluto/New Horizons/copied file/Pluto Encounter Surface Composition/data/color/MVIC_0299178092_0X536_SCI_PL.IMG'