diff --git a/lib/siplib.py b/lib/siplib.py
index 3003ab8104989e27e86eafedc39a8f8062b23c66..63904fa0796edfa1893e71e4d515acbb21cb4990 100644
--- a/lib/siplib.py
+++ b/lib/siplib.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+# !/usr/bin/env python3
 
 # This module provides functions for easy creation of a Lofar LTA SIP document.
 # It builds upon a Pyxb-generated API from the schema definition, which is very clever but hard to use, since
@@ -29,22 +29,18 @@ from . import ltasip
 import pyxb
 from . import constants
 import os
-import uuid
-import xml.dom.minidom
-from pyxb.namespace import XMLSchema_instance as xsi
-from pyxb.namespace import XMLNamespaces as xmlns
 from . import query
 
-
 VERSION = "SIPlib 0.4"
 d = os.path.dirname(os.path.realpath(__file__))
-STATION_CONFIG_PATH = d+'/station_coordinates.conf'
+STATION_CONFIG_PATH = d + '/station_coordinates.conf'
 ltasip.Namespace.setPrefix('sip')
 
+
 # todo: create docstrings for everything.
 # specify types and explain purpose of the field (-> ask someone with more astronomical background)
 
-# todo: check what fields can be implicitely set
+# todo: check what fields can be implicitly set
 # (e.g. parameter type in dataproduct may be derived from the specific dataproduct class that is used)
 # Some parameters may also be filled with a reasonable default value. Right now, usually only optional values
 # as per schema definition are optional parameters.
@@ -60,25 +56,27 @@ def print_user_warning():
     print("!!! might break for you without further warning.")
     print("!!! (You may suppress this warning by setting the flag in the pyxb-related getter/setter functions.)")
 
+
 # ===============================
 # Identifier definition (used for LTA entities, i-e- processes and dataproducts):
 
 class Identifier(object):
     """ Identifier for LTA entities. """
+
     def __init__(self,
                  source,
                  userlabel=None,
-    ):
+                 ):
         """
         The default Identifier constructor creates a new unique identifier in the LTA catalog.
         An optional userlabel can be assigned to later query the identifier based on this String.
         Throws an exception if the given label already exists for the given source.
         """
         unique_id = query.create_unique_id(source, userlabel)
-        self.__pyxb_identifier=ltasip.IdentifierType(
+        self.__pyxb_identifier = ltasip.IdentifierType(
             source=str(source),
             identifier=str(unique_id),
-            name = "",
+            name="",
             label=userlabel)
 
     @classmethod
@@ -96,7 +94,7 @@ class Identifier(object):
             ltasip.IdentifierType(
                 source=str(source),
                 identifier=str(unique_id),
-                name = "",
+                name="",
                 label=userlabel),
             suppress_warning=True)
         return identifier
@@ -111,6 +109,7 @@ class Identifier(object):
             print_user_warning()
         return self.__pyxb_identifier
 
+
 # ===============================
 # Station definitions:
 
@@ -120,61 +119,63 @@ class Station():
                  type,
                  antennafield1,
                  antennafield2=None
-                ):
+                 ):
 
-        __afields=[antennafield1._get_pyxb_antennafield(suppress_warning=True)]
+        __afields = [antennafield1._get_pyxb_antennafield(suppress_warning=True)]
         if antennafield2:
             __afields.append(antennafield2._get_pyxb_antennafield(suppress_warning=True))
-        self.__pyxb_station=ltasip.Station(
+        self.__pyxb_station = ltasip.Station(
             name=name,
             stationType=type,
             antennaField=__afields
-            )
+        )
 
     @classmethod
     def preconfigured(cls,
                       name,
                       antennafieldtypes
-    ):
-        if antennafieldtypes is None or len(antennafieldtypes)>2:
-            raise Exception("please specify a list with one or two antennafield types for station:",name)
+                      ):
+        if antennafieldtypes is None or len(antennafieldtypes) > 2:
+            raise Exception("please specify a list with one or two antennafield types for station:", name)
 
-        __afield1=None
-        __afield2=None
+        __afield1 = None
+        __afield2 = None
         with open(STATION_CONFIG_PATH, 'r') as f:
             for line in f.readlines():
                 if line.strip():
-                  field_coords = eval("dict("+line+")")  # literal_eval does not accept dict definition via constructor. Make sure config file is not writable to prevent code execution!
-                  for type in antennafieldtypes:
-                    if field_coords["name"] == name+"_"+type:
-                        __afield=AntennafieldXYZ(
-                            type=type,
-                            coordinate_system=field_coords["coordinate_system"],
-                            coordinate_unit=constants.LENGTHUNIT_M, # Does this make sense? I have to give a lenght unit accoridng to the XSD, but ICRF should be decimal degrees?!
-                            coordinate_x=field_coords["x"],
-                            coordinate_y=field_coords["y"],
-                            coordinate_z=field_coords["z"])
-                        if not __afield1:
-                            __afield1=__afield
-                        elif not __afield2:
-                            __afield2=__afield
+                    field_coords = eval(
+                        "dict(" + line + ")")  # literal_eval does not accept dict definition via constructor. Make sure config file is not writable to prevent code execution!
+                    for type in antennafieldtypes:
+                        if field_coords["name"] == name + "_" + type:
+                            __afield = AntennafieldXYZ(
+                                type=type,
+                                coordinate_system=field_coords["coordinate_system"],
+                                coordinate_unit=constants.LENGTHUNIT_M,
+                                # Does this make sense? I have to give a lenght unit accoridng to the XSD, but ICRF should be decimal degrees?!
+                                coordinate_x=field_coords["x"],
+                                coordinate_y=field_coords["y"],
+                                coordinate_z=field_coords["z"])
+                            if not __afield1:
+                                __afield1 = __afield
+                            elif not __afield2:
+                                __afield2 = __afield
 
         if not __afield1:
-            raise Exception("no matching coordinates found for station:", name,"and fields",str(antennafieldtypes))
+            raise Exception("no matching coordinates found for station:", name, "and fields", str(antennafieldtypes))
 
-        if name.startswith( 'CS' ):
+        if name.startswith('CS'):
             sttype = "Core"
-        elif name.startswith( "RS" ):
+        elif name.startswith("RS"):
             sttype = "Remote"
         else:
             sttype = "International"
 
         return cls(
-                name=name,
-                type=sttype,
-                antennafield1=__afield1,
-                antennafield2=__afield2,
-                )
+            name=name,
+            type=sttype,
+            antennafield1=__afield1,
+            antennafield2=__afield2,
+        )
 
     def _get_pyxb_station(self, suppress_warning=False):
         if not suppress_warning:
@@ -182,7 +183,6 @@ class Station():
         return self.__pyxb_station
 
 
-
 class AntennafieldXYZ():
     def __init__(self,
                  type,
@@ -191,7 +191,7 @@ class AntennafieldXYZ():
                  coordinate_y,
                  coordinate_z,
                  coordinate_unit):
-        self.__pyxb_antennafield=ltasip.AntennaField(
+        self.__pyxb_antennafield = ltasip.AntennaField(
             name=type,
             location=ltasip.Coordinates(
                 coordinateSystem=coordinate_system,
@@ -206,6 +206,7 @@ class AntennafieldXYZ():
             print_user_warning()
         return self.__pyxb_antennafield
 
+
 class AntennafieldRadLonLat():
     def __init__(self,
                  type,
@@ -216,7 +217,7 @@ class AntennafieldRadLonLat():
                  coordinate_latitude,
                  coordinate_lonlatunit,
                  ):
-        self.__pyxb_antennafield=ltasip.AntennaField(
+        self.__pyxb_antennafield = ltasip.AntennaField(
             name=type,
             location=ltasip.Coordinates(
                 coordinateSystem=coordinate_system,
@@ -241,13 +242,12 @@ class PipelineMap():
                  version,
                  sourcedata_identifiers,
                  process_map
-    ):
-
-        __sourcedata=ltasip.DataSources()
+                 ):
+        __sourcedata = ltasip.DataSources()
         for identifier in sourcedata_identifiers:
             __sourcedata.append(identifier._get_pyxb_identifier(suppress_warning=True))
 
-        self.pipeline_map=dict(
+        self.pipeline_map = dict(
             pipelineName=name,
             pipelineVersion=version,
             sourceData=__sourcedata
@@ -260,7 +260,7 @@ class PipelineMap():
 
 class SimplePipeline():
     def __init__(self, pipeline_map):
-        self.__pyxb_pipeline=ltasip.PipelineRun(**pipeline_map.get_dict())
+        self.__pyxb_pipeline = ltasip.PipelineRun(**pipeline_map.get_dict())
 
     def _get_pyxb_pipeline(self, suppress_warning=False):
         if not suppress_warning:
@@ -281,8 +281,7 @@ class ImagingPipeline():
                  timeintegrationstep=None,
                  skymodeldatabase=None,
                  demixing=None):
-
-        self.__pyxb_pipeline=ltasip.ImagingPipeline(
+        self.__pyxb_pipeline = ltasip.ImagingPipeline(
             frequencyIntegrationStep=frequencyintegrationstep,
             timeIntegrationStep=timeintegrationstep,
             skyModelDatabase=skymodeldatabase,
@@ -311,7 +310,7 @@ class CalibrationPipeline():
                  timeintegrationstep=None,
                  flagautocorrelations=None,
                  demixing=None):
-        self.__pyxb_pipeline=ltasip.CalibrationPipeline(
+        self.__pyxb_pipeline = ltasip.CalibrationPipeline(
             frequencyIntegrationStep=frequencyintegrationstep,
             timeIntegrationStep=timeintegrationstep,
             flagAutoCorrelations=flagautocorrelations,
@@ -325,6 +324,7 @@ class CalibrationPipeline():
     def _get_pyxb_pipeline(self, suppress_warning=False):
         return self.__pyxb_pipeline
 
+
 class AveragingPipeline():
     def __init__(self,
                  pipeline_map,
@@ -333,7 +333,7 @@ class AveragingPipeline():
                  timeintegrationstep,
                  flagautocorrelations,
                  demixing):
-        self.__pyxb_pipeline=ltasip.AveragingPipeline(
+        self.__pyxb_pipeline = ltasip.AveragingPipeline(
             frequencyIntegrationStep=frequencyintegrationstep,
             timeIntegrationStep=timeintegrationstep,
             flagAutoCorrelations=flagautocorrelations,
@@ -341,7 +341,7 @@ class AveragingPipeline():
             numberOfCorrelatedDataProducts=numberofcorrelateddataproducts,
             **pipeline_map.get_dict()
         )
-        #self.__pyxb_pipeline._setAttribute("xsi:type","ns1:AveragingPipeline")
+        # self.__pyxb_pipeline._setAttribute("xsi:type","ns1:AveragingPipeline")
 
     def _get_pyxb_pipeline(self, suppress_warning=False):
         if not suppress_warning:
@@ -365,43 +365,45 @@ class PulsarPipeline():
                  runrotationalradiotransientsanalysis,
                  skipdynamicspectrum,
                  skipprefold):
-
-        self.__pyxb_pipeline=ltasip.PulsarPipeline(
+        self.__pyxb_pipeline = ltasip.PulsarPipeline(
             pulsarSelection=pulsarselection,
-	    	pulsars=pulsars,
+            pulsars=pulsars,
             doSinglePulseAnalysis=dosinglepulseanalysis,
             convertRawTo8bit=convertRawTo8bit,
-            subintegrationLength=ltasip.Time(subintegrationlength , units=subintegrationlength_unit),
+            subintegrationLength=ltasip.Time(subintegrationlength, units=subintegrationlength_unit),
             skipRFIExcision=skiprfiexcision,
             skipDataFolding=skipdatafolding,
             skipOptimizePulsarProfile=skipoptimizepulsarprofile,
             skipConvertRawIntoFoldedPSRFITS=skipconvertrawintofoldedpsrfits,
             runRotationalRAdioTransientsAnalysis=runrotationalradiotransientsanalysis,
-			skipDynamicSpectrum=skipdynamicspectrum,
-        	skipPreFold=skipprefold,
+            skipDynamicSpectrum=skipdynamicspectrum,
+            skipPreFold=skipprefold,
             **pipeline_map.get_dict()
         )
+
     def _get_pyxb_pipeline(self, suppress_warning=False):
         if not suppress_warning:
             print_user_warning()
         return self.__pyxb_pipeline
 
+
 class CosmicRayPipeline():
     def __init__(self, pipeline_map):
-        self.__pyxb_pipeline=ltasip.CosmicRayPipeline(**pipeline_map.get_dict())
+        self.__pyxb_pipeline = ltasip.CosmicRayPipeline(**pipeline_map.get_dict())
 
     def _get_pyxb_pipeline(self, suppress_warning=False):
         if not suppress_warning:
             print_user_warning()
         return self.__pyxb_pipeline
 
+
 class LongBaselinePipeline():
     def __init__(self,
                  pipeline_map,
                  subbandspersubbandgroup,
                  subbandgroupspermS
-    ):
-        self.__pyxb_pipeline=ltasip.LongBaselinePipeline(
+                 ):
+        self.__pyxb_pipeline = ltasip.LongBaselinePipeline(
             subbandsPerSubbandGroup=subbandspersubbandgroup,
             subbandGroupsPerMS=subbandgroupspermS,
             **pipeline_map.get_dict())
@@ -411,9 +413,10 @@ class LongBaselinePipeline():
             print_user_warning()
         return self.__pyxb_pipeline
 
+
 class GenericPipeline():
     def __init__(self, pipeline_map):
-        self.__pyxb_pipeline=ltasip.GenericPipeline(**pipeline_map.get_dict())
+        self.__pyxb_pipeline = ltasip.GenericPipeline(**pipeline_map.get_dict())
 
     def _get_pyxb_pipeline(self, suppress_warning=False):
         if not suppress_warning:
@@ -421,8 +424,6 @@ class GenericPipeline():
         return self.__pyxb_pipeline
 
 
-
-
 # ==========
 # Dataproducts:
 
@@ -437,20 +438,20 @@ class DataProductMap():
                  checksum_md5=None,
                  checksum_adler32=None,
                  storageticket=None
-    ):
-        self.dataproduct_map= dict(dataProductType=type,
-                                   dataProductIdentifier=identifier._get_pyxb_identifier(suppress_warning=True),
-                                   size=size,
-                                   fileName=filename, fileFormat=fileformat,
-                                   processIdentifier=process_identifier._get_pyxb_identifier(suppress_warning=True),
-                                   storageTicket=storageticket)
+                 ):
+        self.dataproduct_map = dict(dataProductType=type,
+                                    dataProductIdentifier=identifier._get_pyxb_identifier(suppress_warning=True),
+                                    size=size,
+                                    fileName=filename, fileFormat=fileformat,
+                                    processIdentifier=process_identifier._get_pyxb_identifier(suppress_warning=True),
+                                    storageTicket=storageticket)
 
         checksums = []
         if checksum_md5 is not None:
             checksums = checksums + [ltasip.ChecksumType(algorithm="MD5", value_=checksum_md5)]
         if checksum_adler32 is not None:
             checksums = checksums + [ltasip.ChecksumType(algorithm="Adler32", value_=checksum_adler32)]
-        self.dataproduct_map["checksum"]=checksums
+        self.dataproduct_map["checksum"] = checksums
 
     def get_dict(self):
         return self.dataproduct_map
@@ -459,7 +460,7 @@ class DataProductMap():
 class __DataProduct(object):
 
     def __init__(self, pyxb_dataproduct):
-        self.__pyxb_dataproduct=pyxb_dataproduct
+        self.__pyxb_dataproduct = pyxb_dataproduct
 
     def set_identifier(self, identifier):
         self.__pyxb_dataproduct.dataProductIdentifier = identifier._get_pyxb_identifier(suppress_warning=True)
@@ -479,12 +480,14 @@ class SimpleDataProduct(__DataProduct):
             ltasip.DataProduct(**dataproduct_map.get_dict())
         )
 
+
 class SkyModelDataProduct(__DataProduct):
     def __init__(self, dataproduct_map):
         super(SkyModelDataProduct, self).__init__(
             ltasip.SkyModelDataProduct(**dataproduct_map.get_dict())
         )
 
+
 class GenericDataProduct(__DataProduct):
     def __init__(self, dataproduct_map):
         super(GenericDataProduct, self).__init__(
@@ -505,11 +508,11 @@ class PixelMapDataProduct(__DataProduct):
                  numberofaxes,
                  coordinates):
         super(PixelMapDataProduct, self).__init__(
-          ltasip.PixelMapDataProduct(
-            numberOfAxes=numberofaxes,
-            numberOfCoordinates=len(coordinates),
-            coordinate = [x._get_pyxb_coordinate(suppress_warning=True) for x in coordinates],
-            **dataproduct_map.get_dict())
+            ltasip.PixelMapDataProduct(
+                numberOfAxes=numberofaxes,
+                numberOfCoordinates=len(coordinates),
+                coordinate=[x._get_pyxb_coordinate(suppress_warning=True) for x in coordinates],
+                **dataproduct_map.get_dict())
         )
 
 
@@ -526,22 +529,19 @@ class SkyImageDataProduct(__DataProduct):
                  restoringbeamminor_angle,
                  restoringbeamminor_angleunit,
                  rmsnoise):
-
-
-          super(SkyImageDataProduct, self).__init__(
+        super(SkyImageDataProduct, self).__init__(
             ltasip.SkyImageDataProduct(
-              numberOfAxes=numberofaxes,
-              numberOfCoordinates=len(coordinates),
-              coordinate = [x._get_pyxb_coordinate(suppress_warning=True) for x in coordinates],
-              locationFrame=locationframe,
-              timeFrame=timeframe,
-              observationPointing=observationpointing._get_pyxb_pointing(suppress_warning=True),
-              restoringBeamMajor=ltasip.Angle(restoringbeammajor_angle, units=restoringbeammajor_angleunit),
-              restoringBeamMinor=ltasip.Angle(restoringbeamminor_angle, units=restoringbeamminor_angleunit),
-              rmsNoise=ltasip.Pixel(rmsnoise, units="Jy/beam"),
-              **dataproduct_map.get_dict())
-          )
-
+                numberOfAxes=numberofaxes,
+                numberOfCoordinates=len(coordinates),
+                coordinate=[x._get_pyxb_coordinate(suppress_warning=True) for x in coordinates],
+                locationFrame=locationframe,
+                timeFrame=timeframe,
+                observationPointing=observationpointing._get_pyxb_pointing(suppress_warning=True),
+                restoringBeamMajor=ltasip.Angle(restoringbeammajor_angle, units=restoringbeammajor_angleunit),
+                restoringBeamMinor=ltasip.Angle(restoringbeamminor_angle, units=restoringbeamminor_angleunit),
+                rmsNoise=ltasip.Pixel(rmsnoise, units="Jy/beam"),
+                **dataproduct_map.get_dict())
+        )
 
 
 class CorrelatedDataProduct(__DataProduct):
@@ -560,25 +560,24 @@ class CorrelatedDataProduct(__DataProduct):
                  channelspersubband,
                  stationsubband=None):
         super(CorrelatedDataProduct, self).__init__(
-          ltasip.CorrelatedDataProduct(
-            subArrayPointingIdentifier=subarraypointing_identifier._get_pyxb_identifier(suppress_warning=True),
-            centralFrequency=ltasip.Frequency(central_frequency, units=central_frequencyunit),
-            channelWidth=ltasip.Frequency(channelwidth_frequency, units=channelwidth_frequencyunit),
-            subband=subband,
-            startTime=starttime,
-            duration=duration,
-            integrationInterval=ltasip.Time(integrationinterval,units=integrationintervalunit),
-            channelsPerSubband=channelspersubband,
-            stationSubband=stationsubband,
-            **dataproduct_map.get_dict()
-          )
+            ltasip.CorrelatedDataProduct(
+                subArrayPointingIdentifier=subarraypointing_identifier._get_pyxb_identifier(suppress_warning=True),
+                centralFrequency=ltasip.Frequency(central_frequency, units=central_frequencyunit),
+                channelWidth=ltasip.Frequency(channelwidth_frequency, units=channelwidth_frequencyunit),
+                subband=subband,
+                startTime=starttime,
+                duration=duration,
+                integrationInterval=ltasip.Time(integrationinterval, units=integrationintervalunit),
+                channelsPerSubband=channelspersubband,
+                stationSubband=stationsubband,
+                **dataproduct_map.get_dict()
+            )
         )
 
     def set_subarraypointing_identifier(self, identifier):
         self.__pyxb_dataproduct.subArrayPointingIdentifier = identifier._get_pyxb_identifier(suppress_warning=True)
 
 
-
 class InstrumentModelDataProduct(__DataProduct):
     def __init__(self, dataproduct_map):
         super(InstrumentModelDataProduct, self).__init__(
@@ -594,11 +593,11 @@ class TransientBufferBoardDataProduct(__DataProduct):
                  triggertype,
                  triggervalue):
         super(TransientBufferBoardDataProduct, self).__init__(
-          ltasip.TransientBufferBoardDataProduct(
-            numberOfSamples=numberofsamples,
-            timeStamp=timestamp,
-            triggerParameters=ltasip.TBBTrigger(type=triggertype,value=triggervalue),
-            **dataproduct_map.get_dict())
+            ltasip.TransientBufferBoardDataProduct(
+                numberOfSamples=numberofsamples,
+                timeStamp=timestamp,
+                triggerParameters=ltasip.TBBTrigger(type=triggertype, value=triggervalue),
+                **dataproduct_map.get_dict())
         )
 
 
@@ -607,12 +606,11 @@ class PulpSummaryDataProduct(__DataProduct):
                  dataproduct_map,
                  filecontent,
                  datatype):
-
         super(PulpSummaryDataProduct, self).__init__(
-          ltasip.PulpSummaryDataProduct(
-            fileContent=filecontent,
-            dataType=datatype,
-            **dataproduct_map.get_dict())
+            ltasip.PulpSummaryDataProduct(
+                fileContent=filecontent,
+                dataType=datatype,
+                **dataproduct_map.get_dict())
         )
 
 
@@ -622,39 +620,36 @@ class PulpDataProduct(__DataProduct):
                  filecontent,
                  datatype,
                  arraybeam):
-
         super(PulpDataProduct, self).__init__(
-          ltasip.PulpDataProduct(
-            fileContent=filecontent,
-            dataType=datatype,
-            arrayBeam=arraybeam._get_pyxb_beam(suppress_warning=True),
-            **dataproduct_map.get_dict())
+            ltasip.PulpDataProduct(
+                fileContent=filecontent,
+                dataType=datatype,
+                arrayBeam=arraybeam._get_pyxb_beam(suppress_warning=True),
+                **dataproduct_map.get_dict())
         )
 
 
 class BeamFormedDataProduct(__DataProduct):
     def __init__(self,
                  dataproduct_map,
-                 #numberofbeams,
+                 # numberofbeams,
                  beams=None):
 
-        __beams=None
-        __nbeams=0
+        __beams = None
+        __nbeams = 0
         if beams:
-            __beams=ltasip.ArrayBeams()
+            __beams = ltasip.ArrayBeams()
             __nbeams = len(beams)
             for beam in beams:
                 __beams.append(beam._get_pyxb_beam(suppress_warning=True))
         super(BeamFormedDataProduct, self).__init__(
-          ltasip.BeamFormedDataProduct(
-            numberOfBeams=__nbeams,
-            beams=__beams,
-            **dataproduct_map.get_dict())
+            ltasip.BeamFormedDataProduct(
+                numberOfBeams=__nbeams,
+                beams=__beams,
+                **dataproduct_map.get_dict())
         )
 
 
-
-
 # ============
 # Coordinates:
 
@@ -672,9 +667,9 @@ class SpectralCoordinate():
         elif isinstance(axis, TabularAxis):
             args.update(dict(spectralTabularAxis=axis._get_pyxb_axis(suppress_warning=True)))
         else:
-            print("wrong axis type:",type(axis))
+            print("wrong axis type:", type(axis))
 
-        self.__pyxb_coordinate=ltasip.SpectralCoordinate(**args)
+        self.__pyxb_coordinate = ltasip.SpectralCoordinate(**args)
 
     def _get_pyxb_coordinate(self, suppress_warning=False):
         if not suppress_warning:
@@ -695,10 +690,9 @@ class TimeCoordinate():
         elif isinstance(axis, TabularAxis):
             args.update(dict(timeTabularAxis=axis._get_pyxb_axis(suppress_warning=True)))
         else:
-            print("wrong axis type:",type(axis))
-
-        self.__pyxb_coordinate=ltasip.TimeCoordinate(**args)
+            print("wrong axis type:", type(axis))
 
+        self.__pyxb_coordinate = ltasip.TimeCoordinate(**args)
 
     def _get_pyxb_coordinate(self, suppress_warning=False):
         if not suppress_warning:
@@ -710,8 +704,8 @@ class PolarizationCoordinate():
     def __init__(self,
                  tabularaxis,
                  polarizations
-    ):
-        self.__pyxb_coordinate=ltasip.PolarizationCoordinate(
+                 ):
+        self.__pyxb_coordinate = ltasip.PolarizationCoordinate(
             polarizationTabularAxis=tabularaxis._get_pyxb_axis(suppress_warning=True),
             polarization=polarizations)
 
@@ -737,9 +731,9 @@ class DirectionCoordinate():
                  longitudepole_angleunit,
                  latitudepole_angle,
                  latitudepole_angleunit):
-
-        self.__pyxb_coordinate=ltasip.DirectionCoordinate(
-            directionLinearAxis=[linearaxis_a._get_pyxb_axis(suppress_warning=True), linearaxis_b._get_pyxb_axis(suppress_warning=True)],
+        self.__pyxb_coordinate = ltasip.DirectionCoordinate(
+            directionLinearAxis=[linearaxis_a._get_pyxb_axis(suppress_warning=True),
+                                 linearaxis_b._get_pyxb_axis(suppress_warning=True)],
             PC0_0=pc0_0,
             PC0_1=pc0_1,
             PC1_0=pc1_0,
@@ -757,6 +751,7 @@ class DirectionCoordinate():
             print_user_warning()
         return self.__pyxb_coordinate
 
+
 # ###########
 # ArrayBeams:
 
@@ -775,7 +770,7 @@ class ArrayBeamMap():
                  channelwidth_frequencyunit,
                  channelspersubband,
                  stokes):
-        self.arraybeam_map=dict(
+        self.arraybeam_map = dict(
             subArrayPointingIdentifier=subarraypointing_identifier._get_pyxb_identifier(suppress_warning=True),
             beamNumber=beamnumber,
             dispersionMeasure=dispersionmeasure,
@@ -791,9 +786,10 @@ class ArrayBeamMap():
     def get_dict(self):
         return self.arraybeam_map
 
+
 class SimpleArrayBeam():
     def __init__(self, arraybeam_map):
-        self.__pyxb_beam=ltasip.ArrayBeam(**arraybeam_map.get_dict())
+        self.__pyxb_beam = ltasip.ArrayBeam(**arraybeam_map.get_dict())
 
     def _get_pyxb_beam(self, suppress_warning=False):
         if not suppress_warning:
@@ -806,7 +802,7 @@ class CoherentStokesBeam():
                  arraybeam_map,
                  pointing,
                  offset):
-        self.__pyxb_beam=ltasip.CoherentStokesBeam(
+        self.__pyxb_beam = ltasip.CoherentStokesBeam(
             pointing=pointing,
             offset=offset,
             **arraybeam_map.get_dict())
@@ -819,7 +815,7 @@ class CoherentStokesBeam():
 
 class IncoherentStokesBeam():
     def __init__(self, arraybeam_map):
-        self.__pyxb_beam=ltasip.IncoherentStokesBeam(**arraybeam_map.get_dict())
+        self.__pyxb_beam = ltasip.IncoherentStokesBeam(**arraybeam_map.get_dict())
 
     def _get_pyxb_beam(self, suppress_warning=False):
         if not suppress_warning:
@@ -831,7 +827,7 @@ class FlysEyeBeam():
     def __init__(self,
                  arraybeam_map,
                  station):
-        self.__pyxb_beam=ltasip.FlysEyeBeam(
+        self.__pyxb_beam = ltasip.FlysEyeBeam(
             station=station._get_pyxb_station(suppress_warning=True),
             **arraybeam_map.get_dict())
 
@@ -854,25 +850,26 @@ class CorrelatorProcessing():
                  processingtype="Correlator",
                  ):
 
-        __channelwidth=None
+        __channelwidth = None
         if channelwidth_frequency and channelwidth_frequencyunit:
-            __channelwidth=ltasip.Frequency(channelwidth_frequency, units=channelwidth_frequencyunit),
+            __channelwidth = ltasip.Frequency(channelwidth_frequency, units=channelwidth_frequencyunit),
 
-        self.__pyxb_rtprocessing=ltasip.Correlator(
-            integrationInterval=ltasip.Time(integrationinterval,units=integrationinterval_unit),
+        self.__pyxb_rtprocessing = ltasip.Correlator(
+            integrationInterval=ltasip.Time(integrationinterval, units=integrationinterval_unit),
             processingType=processingtype,
-        #    channelWidth=__channelwidth,
+            #    channelWidth=__channelwidth,
             channelsPerSubband=channelspersubband
         )
 
         # Somehow this does not work in the constructor:
-        self.__pyxb_rtprocessing.channelwidth=__channelwidth
+        self.__pyxb_rtprocessing.channelwidth = __channelwidth
 
     def _get_pyxb_rtprocessing(self, suppress_warning=False):
         if not suppress_warning:
             print_user_warning()
         return self.__pyxb_rtprocessing
 
+
 class CoherentStokesProcessing():
     def __init__(self,
                  rawsamplingtime,
@@ -895,32 +892,33 @@ class CoherentStokesProcessing():
         for station in stations:
             __stations.append(station._get_pyxb_station(suppress_warning=True))
 
-        __channelwidth=None
+        __channelwidth = None
         if channelwidth_frequency and channelwidth_frequencyunit:
-            __channelwidth=ltasip.Frequency(channelwidth_frequency, units=channelwidth_frequencyunit)
+            __channelwidth = ltasip.Frequency(channelwidth_frequency, units=channelwidth_frequencyunit)
 
-        self.__pyxb_rtprocessing=ltasip.CoherentStokes(
+        self.__pyxb_rtprocessing = ltasip.CoherentStokes(
             rawSamplingTime=ltasip.Time(rawsamplingtime, units=rawsamplingtime_unit),
-			timeDownsamplingFactor=timesamplingdownfactor,
-			samplingTime=ltasip.Time(samplingtime, units=samplingtime_unit),
+            timeDownsamplingFactor=timesamplingdownfactor,
+            samplingTime=ltasip.Time(samplingtime, units=samplingtime_unit),
             frequencyDownsamplingFactor=frequencydownsamplingfactor,
-			numberOfCollapsedChannels=numberofcollapsedchannels,
+            numberOfCollapsedChannels=numberofcollapsedchannels,
             stokes=stokes,
-		    numberOfStations=numberofstations,
+            numberOfStations=numberofstations,
             stations=__stations,
-            #channelWidth=__channelwidth,
+            # channelWidth=__channelwidth,
             channelsPerSubband=channelspersubband,
             processingType=processingtype
-            )
+        )
 
         # Somehow this does not work in the constructor:
-        self.__pyxb_rtprocessing.channelwidth=__channelwidth
+        self.__pyxb_rtprocessing.channelwidth = __channelwidth
 
     def _get_pyxb_rtprocessing(self, suppress_warning=False):
         if not suppress_warning:
             print_user_warning()
         return self.__pyxb_rtprocessing
 
+
 # This is identical to coherent stokes. Redundancy already in the SIP schema...
 class IncoherentStokesProcessing():
     def __init__(self,
@@ -943,31 +941,32 @@ class IncoherentStokesProcessing():
         for station in stations:
             __stations.append(station._get_pyxb_station(suppress_warning=True))
 
-        __channelwidth=None
+        __channelwidth = None
         if channelwidth_frequency and channelwidth_frequencyunit:
-            __channelwidth=ltasip.Frequency(channelwidth_frequency, units=channelwidth_frequencyunit),
+            __channelwidth = ltasip.Frequency(channelwidth_frequency, units=channelwidth_frequencyunit),
 
-        self.__pyxb_rtprocessing=ltasip.IncoherentStokes(
+        self.__pyxb_rtprocessing = ltasip.IncoherentStokes(
             rawSamplingTime=ltasip.Time(rawsamplingtime, units=rawsamplingtime_unit),
-			timeDownsamplingFactor=timesamplingdownfactor,
-			samplingTime=ltasip.Time(samplingtime, units=samplingtime_unit),
+            timeDownsamplingFactor=timesamplingdownfactor,
+            samplingTime=ltasip.Time(samplingtime, units=samplingtime_unit),
             frequencyDownsamplingFactor=frequencydownsamplingfactor,
-			numberOfCollapsedChannels=numberofcollapsedchannels,
+            numberOfCollapsedChannels=numberofcollapsedchannels,
             stokes=stokes,
-		    numberOfStations=numberofstations,
+            numberOfStations=numberofstations,
             stations=__stations,
-            #channelWidth=__channelwidth,
+            # channelWidth=__channelwidth,
             channelsPerSubband=channelspersubband,
             processingType=processingtype
-            )
+        )
         # Somehow this does not work in the constructor:
-        self.__pyxb_rtprocessing.channelwidth=__channelwidth
+        self.__pyxb_rtprocessing.channelwidth = __channelwidth
 
     def _get_pyxb_rtprocessing(self, suppress_warning=False):
         if not suppress_warning:
             print_user_warning()
         return self.__pyxb_rtprocessing
 
+
 class FlysEyeProcessing():
     def __init__(self,
                  rawsamplingtime,
@@ -982,40 +981,38 @@ class FlysEyeProcessing():
                  processingtype="Fly's Eye",
                  ):
 
-
-        __channelwidth=None
+        __channelwidth = None
         if channelwidth_frequency and channelwidth_frequencyunit:
-             __channelwidth=ltasip.Frequency(channelwidth_frequency, units=channelwidth_frequencyunit)
-
-        self.__pyxb_rtprocessing=ltasip.FlysEye(
-                rawSamplingTime=ltasip.Time(rawsamplingtime, units=rawsamplingtime_unit),
-                timeDownsamplingFactor=timesamplingdownfactor,
-                samplingTime=ltasip.Time(samplingtime, units=samplingtime_unit),
-                stokes=stokes,
-               # channelWidth=__channelwidth,
-                channelsPerSubband=channelspersubband,
-                processingType=processingtype)
+            __channelwidth = ltasip.Frequency(channelwidth_frequency, units=channelwidth_frequencyunit)
 
-         # Somehow this does not work in the constructor:
-        self.__pyxb_rtprocessing.channelwidth=__channelwidth
+        self.__pyxb_rtprocessing = ltasip.FlysEye(
+            rawSamplingTime=ltasip.Time(rawsamplingtime, units=rawsamplingtime_unit),
+            timeDownsamplingFactor=timesamplingdownfactor,
+            samplingTime=ltasip.Time(samplingtime, units=samplingtime_unit),
+            stokes=stokes,
+            # channelWidth=__channelwidth,
+            channelsPerSubband=channelspersubband,
+            processingType=processingtype)
 
+        # Somehow this does not work in the constructor:
+        self.__pyxb_rtprocessing.channelwidth = __channelwidth
 
     def _get_pyxb_rtprocessing(self, suppress_warning=False):
         if not suppress_warning:
             print_user_warning()
         return self.__pyxb_rtprocessing
 
+
 class NonStandardProcessing():
     def __init__(self,
                  channelwidth_frequency,
                  channelwidth_frequencyunit,
                  channelspersubband,
                  processingtype="Non Standard"):
-
-        self.__pyxb_rtprocessing=ltasip.NonStandard(
-                channelsPerSubband=channelspersubband,
-                processingType=processingtype,
-                channelWidth=ltasip.Frequency(channelwidth_frequency, units=channelwidth_frequencyunit)
+        self.__pyxb_rtprocessing = ltasip.NonStandard(
+            channelsPerSubband=channelspersubband,
+            processingType=processingtype,
+            channelWidth=ltasip.Frequency(channelwidth_frequency, units=channelwidth_frequencyunit)
         )
 
     def _get_pyxb_rtprocessing(self, suppress_warning=False):
@@ -1039,7 +1036,7 @@ class ProcessMap():
                  parset_identifier=None
                  ):
 
-        __relations=ltasip.ProcessRelations()
+        __relations = ltasip.ProcessRelations()
         for rel in relations:
             __relations.append(rel._get_pyxb_processrelation(suppress_warning=True))
         self.process_map = dict(processIdentifier=identifier._get_pyxb_identifier(suppress_warning=True),
@@ -1049,18 +1046,18 @@ class ProcessMap():
                                 duration=duration)
 
         if parset_identifier:
-            self.process_map["parset"]=parset_identifier._get_pyxb_identifier(suppress_warning=True)
+            self.process_map["parset"] = parset_identifier._get_pyxb_identifier(suppress_warning=True)
 
     def get_dict(self):
         return self.process_map
 
+
 class ProcessRelation():
     def __init__(self,
                  identifier,
                  type="GroupID"
-    ):
-
-        self.__pyxb_processrelation=ltasip.ProcessRelation(
+                 ):
+        self.__pyxb_processrelation = ltasip.ProcessRelation(
             relationType=ltasip.ProcessRelationType(type),
             identifier=identifier._get_pyxb_identifier(suppress_warning=True)
         )
@@ -1081,7 +1078,6 @@ class SimpleProcess():
         return self.pyxb_process
 
 
-
 # ########
 # Others:
 
@@ -1093,8 +1089,7 @@ class PointingRaDec():
                  dec_angle,
                  dec_angleunit,
                  equinox):
-
-        self.__pyxb_pointing=ltasip.Pointing(
+        self.__pyxb_pointing = ltasip.Pointing(
             rightAscension=ltasip.Angle(ra_angle, units=ra_angleunit),
             declination=ltasip.Angle(dec_angle, units=dec_angleunit),
             equinox=equinox)
@@ -1113,8 +1108,7 @@ class PointingAltAz():
                  alt_angle,
                  alt_angleunit,
                  equinox):
-
-        self.__pyxb_pointing=ltasip.Pointing(
+        self.__pyxb_pointing = ltasip.Pointing(
             azimuth=ltasip.Angle(az_angle, units=az_angleunit),
             altitude=ltasip.Angle(alt_angle, units=alt_angleunit),
             equinox=equinox)
@@ -1134,8 +1128,7 @@ class LinearAxis():
                  increment,
                  referencepixel,
                  referencevalue):
-
-        self.__pyxb_axis= ltasip.LinearAxis(
+        self.__pyxb_axis = ltasip.LinearAxis(
             number=number,
             name=name,
             units=units,
@@ -1144,6 +1137,7 @@ class LinearAxis():
             referencePixel=referencepixel,
             referenceValue=referencevalue
         )
+
     def _get_pyxb_axis(self, suppress_warning=False):
         if not suppress_warning:
             print_user_warning()
@@ -1156,14 +1150,13 @@ class TabularAxis():
                  name,
                  units,
                  length
-    ):
-
-        self.__pyxb_axis=ltasip.TabularAxis(
+                 ):
+        self.__pyxb_axis = ltasip.TabularAxis(
             number=number,
             name=name,
             units=units,
             length=length,
-            )
+        )
 
     def _get_pyxb_axis(self, suppress_warning=False):
         if not suppress_warning:
@@ -1191,18 +1184,18 @@ class SubArrayPointing():
                  nonstandardprocessing=None,
                  measurementdescription=None):
 
-        __relations=ltasip.ProcessRelations()
+        __relations = ltasip.ProcessRelations()
         for rel in relations:
             __relations.append(rel._get_pyxb_processrelation(suppress_warning=True))
 
-        __processing=None
-        for processing in [correlatorprocessing, coherentstokesprocessing, incoherentstokesprocessing, flyseyeprocessing, nonstandardprocessing]:
+        __processing = None
+        for processing in [correlatorprocessing, coherentstokesprocessing, incoherentstokesprocessing,
+                           flyseyeprocessing, nonstandardprocessing]:
             if processing:
                 if __processing is None:
-                    __processing=ltasip.Processing()
+                    __processing = ltasip.Processing()
                 __processing.append(processing._get_pyxb_rtprocessing(suppress_warning=True)
-                )
-
+                                    )
 
         self.__pyxb_subarraypointing = ltasip.SubArrayPointing(
             pointing=pointing._get_pyxb_pointing(suppress_warning=True),
@@ -1248,20 +1241,20 @@ class Observation():
                  channelspersubband=None,
                  subarraypointings=None,
                  transientbufferboardevents=None
-    ):
+                 ):
 
         __stations = ltasip.Stations()
         for station in stations:
             __stations.append(station._get_pyxb_station(suppress_warning=True))
 
-        __tbbevents=None
-        if(transientbufferboardevents):
+        __tbbevents = None
+        if (transientbufferboardevents):
             __tbbevents = ltasip.TransientBufferBoardEvents()
             for source in transientbufferboardevents:
                 __tbbevents.append(ltasip.TransientBufferBoardEvent(eventSource=source))
 
-        __pointings=None
-        if(subarraypointings):
+        __pointings = None
+        if (subarraypointings):
             __pointings = ltasip.SubArrayPointings()
             for point in subarraypointings:
                 __pointings.append(point._get_pyxb_subarraypointing(suppress_warning=True))
@@ -1281,7 +1274,7 @@ class Observation():
             numberOfBeamFormedDataProducts=numberofbeamformeddataproducts,
             numberOfBitsPerSample=numberofbitspersample,
             observationDescription=observationdescription,
-            #channelWidth=ltasip.Frequency(channelwidth_frequency, units=channelwidth_frequencyunit),
+            # channelWidth=ltasip.Frequency(channelwidth_frequency, units=channelwidth_frequencyunit),
             channelsPerSubband=channelspersubband,
             subArrayPointings=__pointings,
             transientBufferBoardEvents=__tbbevents,
@@ -1290,7 +1283,8 @@ class Observation():
 
         # Somehow this does not work in the constructor:
         if channelwidth_frequency and channelwidth_frequencyunit:
-            self.__pyxb_observation.channelwidth=ltasip.Frequency(channelwidth_frequency, units=channelwidth_frequencyunit),
+            self.__pyxb_observation.channelwidth = ltasip.Frequency(channelwidth_frequency,
+                                                                    units=channelwidth_frequencyunit),
 
     def _get_pyxb_observation(self, suppress_warning=False):
         if not suppress_warning:
@@ -1298,8 +1292,6 @@ class Observation():
         return self.__pyxb_observation
 
 
-
-
 # #############################################################################################
 
 # ============
@@ -1314,15 +1306,15 @@ class Sip(object):
     print(VERSION)
     print("################\n")
 
-    #-----------
+    # -----------
     # Base document
-    #---
+    # ---
 
     def __init__(self,
                  project_code,
                  project_primaryinvestigator,
                  project_contactauthor,
-                 #project_telescope,
+                 # project_telescope,
                  project_description,
                  dataproduct,
                  project_coinvestigators=None,
@@ -1336,14 +1328,14 @@ class Sip(object):
             projectCode=project_code,
             primaryInvestigator=project_primaryinvestigator,
             contactAuthor=project_contactauthor,
-            telescope="LOFAR",#project_telescope,
+            telescope="LOFAR",  # project_telescope,
             projectDescription=project_description,
             coInvestigator=project_coinvestigators,
-            )
+        )
 
-        self.__sip.dataProduct=dataproduct._get_pyxb_dataproduct(suppress_warning=True)
+        self.__sip.dataProduct = dataproduct._get_pyxb_dataproduct(suppress_warning=True)
 
-        self.get_prettyxml() # for validation
+        self.get_prettyxml()  # for validation
 
     @classmethod
     def from_xml(cls, xml):
@@ -1356,7 +1348,7 @@ class Sip(object):
         """
         newsip = Sip.__new__(Sip)
         newsip._set_pyxb_sip(ltasip.CreateFromDocument(xml), suppress_warning=True)
-        newsip.get_prettyxml() # for validation
+        newsip.get_prettyxml()  # for validation
         return newsip
 
     def _get_pyxb_sip(self, suppress_warning=False):
@@ -1369,10 +1361,9 @@ class Sip(object):
             print_user_warning()
         self.__sip = pyxb_sip
 
-
-    #-------------
+    # -------------
     # Optional additions
-    #---
+    # ---
 
     def add_related_dataproduct(self, dataproduct):
         self.__sip.relatedDataProduct.append(dataproduct._get_pyxb_dataproduct(suppress_warning=True))
@@ -1382,12 +1373,10 @@ class Sip(object):
         self.__sip.observation.append(observation._get_pyxb_observation(suppress_warning=True))
         return self.get_prettyxml()
 
-
     def add_pipelinerun(self, pipeline):
         self.__sip.pipelineRun.append(pipeline._get_pyxb_pipeline(suppress_warning=True))
         return self.get_prettyxml()
 
-
     def add_unspecifiedprocess(self,
                                observingmode,
                                description,
@@ -1403,7 +1392,6 @@ class Sip(object):
 
         return self.get_prettyxml()
 
-
     def add_parset(self,
                    identifier,
                    contents):
@@ -1417,29 +1405,37 @@ class Sip(object):
 
     def add_related_dataproduct_with_history(self, relateddataproduct_sip):
         # add the dataproduct described by the SIP (if not there)
-        if not any(x.dataProductIdentifier.identifier == relateddataproduct_sip.__sip.dataProduct.dataProductIdentifier.identifier for x in self.__sip.relatedDataProduct):
+        if not any(
+                x.dataProductIdentifier.identifier == relateddataproduct_sip.__sip.dataProduct.dataProductIdentifier.identifier
+                for x in self.__sip.relatedDataProduct):
             self.__sip.relatedDataProduct.append(relateddataproduct_sip.__sip.dataProduct)
         else:
-            print("WARNING: There already exists a dataproduct with id", relateddataproduct_sip.__sip.dataProduct.dataProductIdentifier.identifier," - Will try to add any new related items anyway.")
+            print("WARNING: There already exists a dataproduct with id",
+                  relateddataproduct_sip.__sip.dataProduct.dataProductIdentifier.identifier,
+                  " - Will try to add any new related items anyway.")
         if relateddataproduct_sip.__sip.relatedDataProduct:
             # add related dataproducts (if not there already)
             for dp in relateddataproduct_sip.__sip.relatedDataProduct:
-                if not any(x.dataProductIdentifier.identifier == dp.dataProductIdentifier.identifier for x in self.__sip.relatedDataProduct):
+                if not any(x.dataProductIdentifier.identifier == dp.dataProductIdentifier.identifier for x in
+                           self.__sip.relatedDataProduct):
                     self.__sip.relatedDataProduct.append(dp)
         if relateddataproduct_sip.__sip.observation:
             # add related dataproducts (if not there already)
             for obs in relateddataproduct_sip.__sip.observation:
-                if not any(x.processIdentifier.identifier == obs.processIdentifier.identifier for x in self.__sip.observation):
+                if not any(x.processIdentifier.identifier == obs.processIdentifier.identifier for x in
+                           self.__sip.observation):
                     self.__sip.observation.append(obs)
         if relateddataproduct_sip.__sip.pipelineRun:
             # add related pipelineruns (if not there already)
             for pipe in relateddataproduct_sip.__sip.pipelineRun:
-                if not any(x.processIdentifier.identifier == pipe.processIdentifier.identifier for x in self.__sip.pipelineRun):
+                if not any(x.processIdentifier.identifier == pipe.processIdentifier.identifier for x in
+                           self.__sip.pipelineRun):
                     self.__sip.pipelineRun.append(pipe)
         if relateddataproduct_sip.__sip.unspecifiedProcess:
             # add related unspecified processes (if not there already)
             for unspec in relateddataproduct_sip.__sip.unspecifiedProcess:
-                if not any(x.processIdentifier.identifier == unspec.processIdentifier.identifier for x in self.__sip.unspecifiedProcess):
+                if not any(x.processIdentifier.identifier == unspec.processIdentifier.identifier for x in
+                           self.__sip.unspecifiedProcess):
                     self.__sip.unspecifiedProcess.append(unspec)
         if relateddataproduct_sip.__sip.parset:
             # add related parsets (if not there already)
@@ -1448,7 +1444,6 @@ class Sip(object):
                     self.__sip.parset.append(par)
         return self.get_prettyxml()
 
-
     def get_dataproduct_identifier(self):
         """
         Get the identifier of the dataproduct that is described by this Sip, e.g. for reference by your pipeline run..
@@ -1470,22 +1465,20 @@ class Sip(object):
     def get_prettyxml(self):
         try:
             dom = self.__sip.toDOM()
-            #print "1) "+dom.toprettyxml()
+            # print "1) "+dom.toprettyxml()
             dom.documentElement.setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance")
             dom.documentElement.setAttribute('xsi:schemaLocation', "http://www.astron.nl/SIP-Lofar LTA-SIP-2.7.0.xsd")
-            #print "2) "+dom.toprettyxml()
+            # print "2) "+dom.toprettyxml()
             return dom.toprettyxml()
         except pyxb.ValidationError as err:
-            #print str(err)
+            # print str(err)
             print(err.details())
             raise err
 
     def prettyprint(self):
         print(self.get_prettyxml())
 
-
     def save_to_file(self, path):
         path = os.path.expanduser(path)
         with open(path, 'w+') as f:
             f.write(self.get_prettyxml())
-