def xml_prefix(self, project_name): preamble = '' if self.mom_id: preamble = ('<lofar:folder mom2Id="%s" topology_parent="%s">' % (self.mom_id, lower_case(self.grouping_parent))) else: preamble = ('<lofar:folder topology_parent="%s" update_folder="%s">' % (lower_case(self.grouping_parent), lower_case(self.update_folder))) preamble += '\n <topology>%s</topology>' % self.label() preamble += '\n <name>'+self.name+'</name>' if self.description: preamble += '\n <description>'+self.description+'</description>''' return preamble
def xml(self): r''' Produce an xml representation of demixing settings. ''' template = ''' <demixingParameters> <averagingFreqStep>%(avg_freq_step)d</averagingFreqStep> <averagingTimeStep>%(avg_time_step)d</averagingTimeStep> <demixFreqStep>%(demix_freq_step)d</demixFreqStep> <demixTimeStep>%(demix_time_step)d</demixTimeStep> <demixAlways>%(demix_always)s</demixAlways> <demixIfNeeded>%(demix_if_needed)s</demixIfNeeded> <ignoreTarget>%(ignore_target)s</ignoreTarget> </demixingParameters>''' args = {'avg_freq_step' : self.avg_freq_step, 'avg_time_step' : self.avg_time_step, 'demix_freq_step' : self.demix_freq_step, 'demix_time_step' : self.demix_time_step, 'demix_always' : '', 'demix_if_needed' : '', 'ignore_target' : ''} if self.demix_always is not None: args['demix_always'] = '['+','.join(self.demix_always)+']' if self.demix_if_needed is not None: args['demix_if_needed'] = '['+','.join(self.demix_if_needed)+']' if self.ignore_target is not None: args['ignore_target'] = lower_case(self.ignore_target) return template % args
def xml(self): r''' Produce an xml representation of demixing settings. ''' template = ''' <demixingParameters> <averagingFreqStep>%(avg_freq_step)d</averagingFreqStep> <averagingTimeStep>%(avg_time_step)d</averagingTimeStep> <demixFreqStep>%(demix_freq_step)d</demixFreqStep> <demixTimeStep>%(demix_time_step)d</demixTimeStep> <demixAlways>%(demix_always)s</demixAlways> <demixIfNeeded>%(demix_if_needed)s</demixIfNeeded> <ignoreTarget>%(ignore_target)s</ignoreTarget> </demixingParameters>''' args = { 'avg_freq_step': self.avg_freq_step, 'avg_time_step': self.avg_time_step, 'demix_freq_step': self.demix_freq_step, 'demix_time_step': self.demix_time_step, 'demix_always': '', 'demix_if_needed': '', 'ignore_target': '' } if self.demix_always is not None: args['demix_always'] = '[' + ','.join(self.demix_always) + ']' if self.demix_if_needed is not None: args['demix_if_needed'] = '[' + ','.join( self.demix_if_needed) + ']' if self.ignore_target is not None: args['ignore_target'] = lower_case(self.ignore_target) return template % args
def xml(self, project_name=None, child_id=None, parent_label=None): r''' ''' def lower_case(bool): return repr(bool).lower() incoherent_stokes = self.incoherent_stokes_data is not None coherent_stokes = self.coherent_stokes_data is not None flyseye = False if coherent_stokes: flyseye = self.tied_array_beams.flyseye output = '''<correlatedData>'''+lower_case(self.correlated_data)+'''</correlatedData> <filteredData>'''+lower_case(self.filtered_data)+'''</filteredData> <beamformedData>'''+lower_case(self.beamformed_data)+'''</beamformedData> <coherentStokesData>'''+lower_case(coherent_stokes)+'''</coherentStokesData> <incoherentStokesData>'''+lower_case(incoherent_stokes)+'''</incoherentStokesData>''' if self.correlated_data: output += ''' <integrationInterval>'''+str(self.integration_time_seconds)+'''</integrationInterval>''' output += ''' <channelsPerSubband>'''+str(self.channels_per_subband)+'''</channelsPerSubband> <pencilBeams> <flyseye>'''+lower_case(flyseye)+'''</flyseye> <pencilBeamList/> </pencilBeams>''' + self.tied_array_beams.xml()+''' <stokes> <integrateChannels>'''+lower_case(self.stokes_integrate_channels)+'''</integrateChannels>''' # If number_collapsed_channels is not set, default to # correlator settings. if self.incoherent_stokes_data: if self.incoherent_stokes_data.number_collapsed_channels is None: self.incoherent_stokes_data.number_collapsed_channels = self.channels_per_subband output += '\n'+indent(self.incoherent_stokes_data.xml(), 2) if self.coherent_stokes_data: if self.coherent_stokes_data.number_collapsed_channels is None: self.coherent_stokes_data.number_collapsed_channels = self.channels_per_subband output += '\n'+indent(self.coherent_stokes_data.xml(), 2) output += ''' </stokes> <bypassPff>'''+lower_case(self.bypass_pff)+'''</bypassPff> <enableSuperterp>'''+lower_case(self.enable_superterp)+'''</enableSuperterp> ''' return output
def xml(self, project_name = None): output = (''' <tiedArrayBeams> <flyseye>%s</flyseye> <nrTabRings>%d</nrTabRings> <tabRingSize>%f</tabRingSize>''' % (lower_case(self.flyseye), self.nr_tab_rings, self.tab_ring_size)) if self.beams_ra_dec_rad and len(self.beams_ra_dec_rad) > 0: output += (''' <tiedArrayBeamList> %s </tiedArrayBeamList>''' % '\n '.join( ['<tiedArrayBeam><coherent>true</coherent><angle1>%f</angle1><angle2>%f</angle2></tiedArrayBeam>' % (angle_1, angle_2) for angle_1, angle_2 in self.beams_ra_dec_rad])) else: output += ''' <tiedArrayBeamList/>''' return output+'\n</tiedArrayBeams>'