hp.load does not work

Bug #1631150 reported by lindsey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
HoloPy
New
Undecided
Unassigned

Bug Description

my code works with provided images that is preloaded with metadata (i.e.get_example_data('image0001.yaml')

but it doesn't let me load my own images in the directory.

In[2]: import holopy as hp
optics = hp.core.Optics(wavelen=.660, index=1.33,
polarization=[1.0, 0.0])

In[3]: holo = hp.load('1.tif', spacing = .1, optics = optics)

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/IPython/core/interactiveshell.py", line 2820, in run_code
    exec code_obj in self.user_global_ns, self.user_ns
  File "<ipython-input-3-153511853999>", line 1, in <module>
    holo = hp.load('1.tif', spacing = .1, optics = optics)
  File "/usr/local/lib/python2.7/dist-packages/holopy/core/io/io.py", line 94, in load
    loaded = load_image(inf, spacing=spacing, optics=optics, channel=channel)
  File "/usr/local/lib/python2.7/dist-packages/holopy/core/io/image_file_io.py", line 157, in load_image
    metadata = json.loads(description)
  File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
TypeError: expected string or buffer

thank you so much for your help!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.