Skip to content

No files -> should have helpful error #3

Description

@lionfish0

Currently if no files provided, alignment.firstpass() will break with a confusing message:

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
Cell In[6], line 1
----> 1 alignment.firstpass()
      2 alignment.secondpass()
      3 alignment.addmissingobs()

File ~/Documents/Research/alignment/alignment/__init__.py:347, in Alignment.firstpass(self, method)
    346 def firstpass(self,method='BFGS'):
--> 347     self.cameras[0].loc = np.zeros(3)
    348     self.cameras[0].orientation = np.zeros(3)
    350     params = np.random.randn(6*(len(self.cameras)-1))

IndexError: list index out of range

this happens as no cameras have been added to the cameras list (as no images have been taken) -- the code above fixes camera 0 to the origin etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions