Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on opening files from New Horizons MVIC data #79

Open
alemran042 opened this issue May 9, 2021 · 1 comment
Open

Error on opening files from New Horizons MVIC data #79

alemran042 opened this issue May 9, 2021 · 1 comment

Comments

@alemran042
Copy link

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'

@cmillion
Copy link

cmillion commented May 9, 2021

Nobody is actively maintaining this project anymore. I suggest that you try to read the data with pdr.
https://github.com/millionconcepts/pdr

If it doesn't work please file an issue there with the error output and the full URL to the data on the PDS, and I'll try to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants