Forum

Author Topic: bug in copying of CoordinateSystem objects  (Read 1921 times)

daniil.s.nikulin

  • Newbie
  • *
  • Posts: 4
    • View Profile
bug in copying of CoordinateSystem objects
« on: June 19, 2019, 11:54:20 AM »
objects of CoordinateSystem's class create empty other objects in copying

Code: [Select]
crs1 = ps.CoordinateSystem()
crs1.f = 15

crs2 = copy.deepcopy(crs1)
print(crs2.f)
# expected 15, actual 0

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: bug in copying of CoordinateSystem objects
« Reply #1 on: June 19, 2019, 01:07:01 PM »
Hello daniil.s.nikulin,

It does not seem, that CoordinateSystem class has .f method, you should get the AttributeError when trying to make crs1.f assignment.

As for the coordinate system copying in general, have you checked, is regular crs2 = crs1 works properly to get the coordinate system copy?
Best regards,
Alexey Pasumansky,
Agisoft LLC

daniil.s.nikulin

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: bug in copying of CoordinateSystem objects
« Reply #2 on: June 19, 2019, 05:57:17 PM »
sorry... I was wrong about name of class.

CoordinateSystem -> Calibration

Code: [Select]
cal = ps.Calibration()
cal.f = 42
print( copy.deepcopy(cal).f )

in case of direct assign (cal2 = cal1) attributes of cal2 are not empty
« Last Edit: June 19, 2019, 06:05:59 PM by daniil.s.nikulin »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: bug in copying of CoordinateSystem objects
« Reply #3 on: June 19, 2019, 08:48:49 PM »
OK, understood.

Yes, it seems that we are lacking instruments for making a copy of the Calibration class element. We'll consider what would be a proper way of doing that.

Meanwhile I can only suggest two ways of copying the calibration:
- export it to file and import to the new element,
- creating a custom function that will output a copy of the element (copying the attribute values one by one).
Best regards,
Alexey Pasumansky,
Agisoft LLC