Here is one way to read gantry angle, using a nested loop over beams and control points:
for beam in ds.BeamSequence:
for cp in beam.ControlPointSequence:
print(cp.get("GantryAngle"))
It uses the `.get` method to return None if that control point does not have a GantryAngle data element. If you know they exist, you could just use `cp.GantryAngle`. For setting values, can just use `cp.GantryAngle = 90`, or whatever value.