diff --git a/lib/siplib.py b/lib/siplib.py index 079e8ec466d2e79aa2ad5e23b1332f8636585db5..2d17ade5728e90e3aa59eabae5d0368c021b75f7 100644 --- a/lib/siplib.py +++ b/lib/siplib.py @@ -28,10 +28,9 @@ import ltasip import pyxb import constants -import stations - VERSION = "SIPlib 0.1" +STATION_CONFIG_PATH = "station_coordinates.conf" # todo: find a nice way to define the different stations # -> how to define a full set of existing stations and their different antennafield options without redundancy? @@ -66,10 +65,58 @@ class Station(): 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) + + __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+")") + 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)) + + if name.startswith( 'CS' ): + sttype = "Core" + elif name.startswith( "RS" ): + sttype = "Remote" + else: + sttype = "International" + + return cls( + name=name, + type=sttype, + antennafield1=__afield1, + antennafield2=__afield2, + ) + + def get_pyxb_station(self): return self.__pyxb_station + + class AntennafieldXYZ(): def __init__(self, type, @@ -115,39 +162,6 @@ class AntennafieldRadLonLat(): return self.__pyxb_antennafield -# todo: This is preliminary! (see above) -# STATION_1 = Station( -# name="station1", -# type="Core", -# antennafield1=AntennafieldXYZ( -# type="HBA0", -# coordinate_system="ITRF2005", -# coordinate_x=2,coordinate_y=2,coordinate_z=3.0,coordinate_unit="m"), -# antennafield2=AntennafieldRadLonLat( -# type="HBA1", -# coordinate_system="ITRF2005", -# coordinate_radius=2, -# coordinate_radiusunit="m", -# coordinate_longitude=5, -# coordinate_latitude=6, -# coordinate_lonlatunit="degrees") -# ) -# -# STATION_2 = Station( -# name="station2", -# type="Remote", -# antennafield1=AntennafieldXYZ( -# type="HBA", -# coordinate_system="ITRF2005", -# coordinate_x=2,coordinate_y=2,coordinate_z=3.0,coordinate_unit="m"), -# ) - - - -# ############################################################################################# - - - # ============ # PipelineRuns: @@ -1399,7 +1413,7 @@ def main(): channelwidth_frequencyunit="MHz", channelspersubband=5, stokes=["I","Q"]), - station=stations.compose_station("station1",["HBA0","HBA1"]) + station=Station.preconfigured("CS001",["HBA0","HBA1"]) )] ) ) @@ -1578,8 +1592,8 @@ def main(): stationselection="Core", antennaset="HBA Zero", timesystem="UTC", - stations=[stations.compose_station("station1",["HBA0","HBA1"]), - stations.compose_station("station2",["HBA"])], + stations=[Station.preconfigured("RS106",["LBA"]), + Station.preconfigured("DE609",["HBA"])], numberofstations=5, numberofsubarraypointings=5, numberoftbbevents=5, @@ -1641,7 +1655,7 @@ def main(): samplingtime_unit="ns", stokes=["XX"], numberofstations=1, - stations=[stations.compose_station("station1",["HBA0","HBA1"])], + stations=[Station.preconfigured("CS002",["HBA0","HBA1"])], frequencydownsamplingfactor=2, numberofcollapsedchannels=2, channelwidth_frequency=160, @@ -1656,7 +1670,7 @@ def main(): samplingtime_unit="ns", stokes=["XX"], numberofstations=1, - stations=[stations.compose_station("station1",["HBA0","HBA1"])], + stations=[Station.preconfigured("CS003",["HBA0","HBA1"])], frequencydownsamplingfactor=2, numberofcollapsedchannels=2, channelwidth_frequency=160, diff --git a/lib/station_coordinates.conf b/lib/station_coordinates.conf new file mode 100644 index 0000000000000000000000000000000000000000..07e488f9a72ccf960c6e6f30c9bc39823e3c7613 --- /dev/null +++ b/lib/station_coordinates.conf @@ -0,0 +1,156 @@ +coordinate_system='ITRF2005', x='3826923.546', y='460915.441', z='5064643.489' , name='CS001_LBA' +coordinate_system='ITRF2005', x='3826937.810', y='460938.526', z='5064630.696' , name='CS001_HBA' +coordinate_system='ITRF2005', x='3826896.235', y='460979.455', z='5064658.203' , name='CS001_HBA0' +coordinate_system='ITRF2005', x='3826979.384', y='460897.597', z='5064603.189' , name='CS001_HBA1' +coordinate_system='ITRF2005', x='3826577.066', y='461022.948', z='5064892.786' , name='CS002_LBA' +coordinate_system='ITRF2005', x='3826583.278', y='460955.756', z='5064894.197' , name='CS002_HBA' +coordinate_system='ITRF2005', x='3826600.961', y='460953.402', z='5064881.136' , name='CS002_HBA0' +coordinate_system='ITRF2005', x='3826565.594', y='460958.110', z='5064907.258' , name='CS002_HBA1' +coordinate_system='ITRF2005', x='3826516.748', y='460930.066', z='5064946.457' , name='CS003_LBA' +coordinate_system='ITRF2005', x='3826494.580', y='461017.698', z='5064955.176' , name='CS003_HBA' +coordinate_system='ITRF2005', x='3826471.348', y='461000.138', z='5064974.201' , name='CS003_HBA0' +coordinate_system='ITRF2005', x='3826517.812', y='461035.258', z='5064936.150' , name='CS003_HBA1' +coordinate_system='ITRF2005', x='3826654.197', y='460939.576', z='5064842.426' , name='CS004_LBA' +coordinate_system='ITRF2005', x='3826582.556', y='460891.662', z='5064900.532' , name='CS004_HBA' +coordinate_system='ITRF2005', x='3826585.626', y='460865.844', z='5064900.561' , name='CS004_HBA0' +coordinate_system='ITRF2005', x='3826579.486', y='460917.480', z='5064900.502' , name='CS004_HBA1' +coordinate_system='ITRF2005', x='3826668.750', y='461069.550', z='5064819.754' , name='CS005_LBA' +coordinate_system='ITRF2005', x='3826666.177', y='461005.533', z='5064827.472' , name='CS005_HBA' +coordinate_system='ITRF2005', x='3826701.160', y='460989.250', z='5064802.685' , name='CS005_HBA0' +coordinate_system='ITRF2005', x='3826631.194', y='461021.815', z='5064852.259' , name='CS005_HBA1' +coordinate_system='ITRF2005', x='3826596.730', y='461145.178', z='5064866.978' , name='CS006_LBA' +coordinate_system='ITRF2005', x='3826633.141', y='461108.369', z='5064842.975' , name='CS006_HBA' +coordinate_system='ITRF2005', x='3826653.783', y='461136.440', z='5064824.943' , name='CS006_HBA0' +coordinate_system='ITRF2005', x='3826612.499', y='461080.298', z='5064861.006' , name='CS006_HBA1' +coordinate_system='ITRF2005', x='3826533.361', y='461098.966', z='5064918.721' , name='CS007_LBA' +coordinate_system='ITRF2005', x='3826508.368', y='461126.726', z='5064934.972' , name='CS007_HBA' +coordinate_system='ITRF2005', x='3826478.715', y='461083.720', z='5064961.117' , name='CS007_HBA0' +coordinate_system='ITRF2005', x='3826538.021', y='461169.731', z='5064908.827' , name='CS007_HBA1' +coordinate_system='ITRF2005', x='3826667.069', y='461285.849', z='5064801.592' , name='CS011_LBA' +coordinate_system='ITRF2005', x='3826643.191', y='461290.793', z='5064819.069' , name='CS011_HBA' +coordinate_system='ITRF2005', x='3826637.421', y='461227.345', z='5064829.134' , name='CS011_HBA0' +coordinate_system='ITRF2005', x='3826648.961', y='461354.241', z='5064809.003' , name='CS011_HBA1' +coordinate_system='ITRF2005', x='3826346.265', y='460792.111', z='5065087.136' , name='CS013_LBA' +coordinate_system='ITRF2005', x='3826360.529', y='460815.196', z='5065074.343' , name='CS013_HBA' +coordinate_system='ITRF2005', x='3826318.954', y='460856.125', z='5065101.850' , name='CS013_HBA0' +coordinate_system='ITRF2005', x='3826402.103', y='460774.267', z='5065046.836' , name='CS013_HBA1' +coordinate_system='ITRF2005', x='3826462.054', y='461501.950', z='5064935.827' , name='CS017_LBA' +coordinate_system='ITRF2005', x='3826452.439', y='461529.979', z='5064940.511' , name='CS017_HBA' +coordinate_system='ITRF2005', x='3826405.095', y='461507.460', z='5064978.083' , name='CS017_HBA0' +coordinate_system='ITRF2005', x='3826499.783', y='461552.498', z='5064902.938' , name='CS017_HBA1' +coordinate_system='ITRF2005', x='3826406.543', y='460538.604', z='5065064.870' , name='CS021_LBA' +coordinate_system='ITRF2005', x='3826416.158', y='460510.576', z='5065060.187' , name='CS021_HBA' +coordinate_system='ITRF2005', x='3826463.502', y='460533.094', z='5065022.614' , name='CS021_HBA0' +coordinate_system='ITRF2005', x='3826368.813', y='460488.057', z='5065097.759' , name='CS021_HBA1' +coordinate_system='ITRF2005', x='3827161.234', y='461409.408', z='5064421.046' , name='CS024_LBA' +coordinate_system='ITRF2005', x='3827170.849', y='461381.379', z='5064416.362' , name='CS024_HBA' +coordinate_system='ITRF2005', x='3827218.193', y='461403.898', z='5064378.790' , name='CS024_HBA0' +coordinate_system='ITRF2005', x='3827123.504', y='461358.861', z='5064453.935' , name='CS024_HBA1' +coordinate_system='ITRF2005', x='3826390.916', y='461869.852', z='5064955.913' , name='CS026_LBA' +coordinate_system='ITRF2005', x='3826376.653', y='461846.767', z='5064968.706' , name='CS026_HBA' +coordinate_system='ITRF2005', x='3826418.227', y='461805.837', z='5064941.199' , name='CS026_HBA0' +coordinate_system='ITRF2005', x='3826335.078', y='461887.696', z='5064996.213' , name='CS026_HBA1' +coordinate_system='ITRF2005', x='3825600.445', y='461260.593', z='5065604.325' , name='CS028_LBA' +coordinate_system='ITRF2005', x='3825614.709', y='461283.678', z='5065591.532' , name='CS028_HBA' +coordinate_system='ITRF2005', x='3825573.134', y='461324.607', z='5065619.039' , name='CS028_HBA0' +coordinate_system='ITRF2005', x='3825656.283', y='461242.749', z='5065564.025' , name='CS028_HBA1' +coordinate_system='ITRF2005', x='3826014.266', y='460387.389', z='5065372.328' , name='CS030_LBA' +coordinate_system='ITRF2005', x='3826000.003', y='460364.303', z='5065385.121' , name='CS030_HBA' +coordinate_system='ITRF2005', x='3826041.577', y='460323.374', z='5065357.614' , name='CS030_HBA0' +coordinate_system='ITRF2005', x='3825958.428', y='460405.233', z='5065412.628' , name='CS030_HBA1' +coordinate_system='ITRF2005', x='3826439.996', y='460273.833', z='5065063.594' , name='CS031_LBA' +coordinate_system='ITRF2005', x='3826430.381', y='460301.862', z='5065068.278' , name='CS031_HBA' +coordinate_system='ITRF2005', x='3826383.037', y='460279.343', z='5065105.850' , name='CS031_HBA0' +coordinate_system='ITRF2005', x='3826477.725', y='460324.381', z='5065030.705' , name='CS031_HBA1' +coordinate_system='ITRF2005', x='3826891.573', y='460387.910', z='5064715.292' , name='CS032_LBA' +coordinate_system='ITRF2005', x='3826905.837', y='460410.995', z='5064702.499' , name='CS032_HBA' +coordinate_system='ITRF2005', x='3826864.262', y='460451.924', z='5064730.006' , name='CS032_HBA0' +coordinate_system='ITRF2005', x='3826947.411', y='460370.066', z='5064674.992' , name='CS032_HBA1' +coordinate_system='ITRF2005', x='3825842.966', y='461704.449', z='5065381.473' , name='CS101_LBA' +coordinate_system='ITRF2005', x='3825852.581', y='461676.421', z='5065376.790' , name='CS101_HBA' +coordinate_system='ITRF2005', x='3825899.925', y='461698.939', z='5065339.217' , name='CS101_HBA0' +coordinate_system='ITRF2005', x='3825805.236', y='461653.902', z='5065414.362' , name='CS101_HBA1' +coordinate_system='ITRF2005', x='3826304.279', y='462823.089', z='5064934.334' , name='CS103_LBA' +coordinate_system='ITRF2005', x='3826290.016', y='462800.003', z='5064947.127' , name='CS103_HBA' +coordinate_system='ITRF2005', x='3826331.590', y='462759.074', z='5064919.620' , name='CS103_HBA0' +coordinate_system='ITRF2005', x='3826248.441', y='462840.933', z='5064974.634' , name='CS103_HBA1' +coordinate_system='ITRF2005', x='3826708.929', y='461913.747', z='5064713.838' , name='CS201_LBA' +coordinate_system='ITRF2005', x='3826685.051', y='461918.691', z='5064731.315' , name='CS201_HBA' +coordinate_system='ITRF2005', x='3826679.281', y='461855.243', z='5064741.380' , name='CS201_HBA0' +coordinate_system='ITRF2005', x='3826690.821', y='461982.139', z='5064721.249' , name='CS201_HBA1' +coordinate_system='ITRF2005', x='3827412.865', y='460992.343', z='5064269.944' , name='CS301_LBA' +coordinate_system='ITRF2005', x='3827436.743', y='460987.400', z='5064252.468' , name='CS301_HBA' +coordinate_system='ITRF2005', x='3827442.512', y='461050.847', z='5064242.403' , name='CS301_HBA0' +coordinate_system='ITRF2005', x='3827430.973', y='460923.952', z='5064262.533' , name='CS301_HBA1' +coordinate_system='ITRF2005', x='3827945.916', y='459792.639', z='5063990.016' , name='CS302_LBA' +coordinate_system='ITRF2005', x='3827931.652', y='459769.554', z='5064002.807' , name='CS302_HBA' +coordinate_system='ITRF2005', x='3827973.226', y='459728.624', z='5063975.300' , name='CS302_HBA0' +coordinate_system='ITRF2005', x='3827890.077', y='459810.483', z='5064030.313' , name='CS302_HBA1' +coordinate_system='ITRF2005', x='3826766.106', y='460100.388', z='5064836.470' , name='CS401_LBA' +coordinate_system='ITRF2005', x='3826789.982', y='460095.444', z='5064818.996' , name='CS401_HBA' +coordinate_system='ITRF2005', x='3826795.752', y='460158.894', z='5064808.929' , name='CS401_HBA0' +coordinate_system='ITRF2005', x='3826784.211', y='460031.993', z='5064829.062' , name='CS401_HBA1' +coordinate_system='ITRF2005', x='3825625.779', y='460642.110', z='5065640.772' , name='CS501_LBA' +coordinate_system='ITRF2005', x='3825616.164', y='460670.139', z='5065645.456' , name='CS501_HBA' +coordinate_system='ITRF2005', x='3825568.820', y='460647.620', z='5065683.028' , name='CS501_HBA0' +coordinate_system='ITRF2005', x='3825663.508', y='460692.658', z='5065607.883' , name='CS501_HBA1' +coordinate_system='ITRF2005', x='4034036.396', y='487026.791', z='4900279.047' , name='DE601_LBA' +coordinate_system='ITRF2005', x='4034100.755', y='487013.454', z='4900231.061' , name='DE601_HBA' +coordinate_system='ITRF2005', x='4152560.658', y='828869.076', z='4754357.155' , name='DE602_LBA' +coordinate_system='ITRF2005', x='4152568.006', y='828789.153', z='4754362.203' , name='DE602_HBA' +coordinate_system='ITRF2005', x='3940284.908', y='816802.334', z='4932393.021' , name='DE603_LBA' +coordinate_system='ITRF2005', x='3940295.706', y='816722.865', z='4932394.416' , name='DE603_HBA' +coordinate_system='ITRF2005', x='3796327.178', y='877591.636', z='5032757.508' , name='DE604_LBA' +coordinate_system='ITRF2005', x='3796379.823', y='877614.130', z='5032712.528' , name='DE604_HBA' +coordinate_system='ITRF2005', x='4005681.355', y='450968.621', z='4926457.941' , name='DE605_LBA' +coordinate_system='ITRF2005', x='4005681.020', y='450968.643', z='4926458.211' , name='DE605_HBA' + +coordinate_system='ITRF2005', x='3727207.32344', y='655185.253748', z='5117000.901' , name='DE609_LBA' +coordinate_system='ITRF2005', x='3727217.67345', y='655109.174749', z='5117003.123' , name='DE609_HBA' + +coordinate_system='ITRF2005', x='2136832.729', y='810088.928', z='5935285.442' , name='FI609_LBA' +coordinate_system='ITRF2005', x='2136818.698', y='810039.764', z='5935299.217' , name='FI609_HBA' +coordinate_system='ITRF2005', x='4323979.809', y='165608.773', z='4670303.094' , name='FR606_LBA' +coordinate_system='ITRF2005', x='4324016.708', y='165545.525', z='4670271.363' , name='FR606_HBA' +coordinate_system='ITRF2005', x='3829261.425', y='469162.285', z='5062137.310' , name='RS106_LBA' +coordinate_system='ITRF2005', x='3829205.598', y='469142.533', z='5062181.002' , name='RS106_HBA' +coordinate_system='ITRF2005', x='3831438.563', y='463435.440', z='5061025.466' , name='RS205_LBA' +coordinate_system='ITRF2005', x='3831479.670', y='463487.529', z='5060989.903' , name='RS205_HBA' +coordinate_system='ITRF2005', x='3847810.051', y='466929.706', z='5048357.222' , name='RS208_LBA' +coordinate_system='ITRF2005', x='3847753.310', y='466962.809', z='5048397.244' , name='RS208_HBA' + +coordinate_system='ITRF2005', x='3877847.446870000', y='467456.926958000', z='5025437.607', name ="RS210_LBA" +coordinate_system='ITRF2005', x='3877827.561860000', y='467536.604956000', z='5025445.584', name ="RS210_HBA" + + +coordinate_system='ITRF2005', x='3828720.759', y='454781.411', z='5063851.082' , name='RS305_LBA' +coordinate_system='ITRF2005', x='3828732.712', y='454692.404', z='5063850.315' , name='RS305_HBA' +coordinate_system='ITRF2005', x='3829791.808', y='452829.848', z='5063221.590' , name='RS306_LBA' +coordinate_system='ITRF2005', x='3829771.249', y='452761.702', z='5063243.181' , name='RS306_HBA' +coordinate_system='ITRF2005', x='3837940.949', y='449560.756', z='5057381.288' , name='RS307_LBA' +coordinate_system='ITRF2005', x='3837964.520', y='449627.261', z='5057357.585' , name='RS307_HBA' +coordinate_system='ITRF2005', x='3845433.052', y='413580.888', z='5054756.170' , name='RS310_LBA' +coordinate_system='ITRF2005', x='3845376.290', y='413616.564', z='5054796.341' , name='RS310_HBA' +coordinate_system='ITRF2005', x='3818467.634', y='451974.601', z='5071790.597' , name='RS406_LBA' +coordinate_system='ITRF2005', x='3818424.939', y='452020.269', z='5071817.644' , name='RS406_HBA' +coordinate_system='ITRF2005', x='3811595.861', y='453444.681', z='5076770.429' , name='RS407_LBA' +coordinate_system='ITRF2005', x='3811649.455', y='453459.894', z='5076728.952' , name='RS407_HBA' +coordinate_system='ITRF2005', x='3824755.853', y='426178.847', z='5069289.868' , name='RS409_LBA' +coordinate_system='ITRF2005', x='3824812.621', y='426130.330', z='5069251.754' , name='RS409_HBA' +coordinate_system='ITRF2005', x='3824090.452', y='459438.282', z='5066898.190' , name='RS503_LBA' +coordinate_system='ITRF2005', x='3824138.566', y='459476.972', z='5066858.578' , name='RS503_HBA' +coordinate_system='ITRF2005', x='3797202.116', y='463087.509', z='5086605.037' , name='RS508_LBA' +coordinate_system='ITRF2005', x='3797136.484', y='463114.447', z='5086651.286' , name='RS508_HBA' +coordinate_system='ITRF2005', x='3783579.131', y='450178.882', z='5097830.835' , name='RS509_LBA' +coordinate_system='ITRF2005', x='3783537.525', y='450130.064', z='5097866.146' , name='RS509_HBA' +coordinate_system='ITRF2005', x='3370286.931', y='712053.871', z='5349991.459' , name='SE607_LBA' +coordinate_system='ITRF2005', x='3370271.657', y='712125.881', z='5349991.165' , name='SE607_HBA' +coordinate_system='ITRF2005', x='4008438.457', y='-100309.725', z='4943735.828' , name='UK608_LBA' +coordinate_system='ITRF2005', x='4008461.941', y='-100376.609', z='4943716.874' , name='UK608_HBA' + +coordinate_system='ITRF2005', x='3738425.93165', y='1148187.17594', z='5021750.597' , name='PL610_LBA' +coordinate_system='ITRF2005', x='3738462.41565', y='1148244.31594', z='5021710.658' , name='PL610_HBA' +coordinate_system='ITRF2005', x='3850973.9872', y='1439061.04111', z='4860478.994' , name='PL611_LBA' +coordinate_system='ITRF2005', x='3850980.8812', y='1438994.87911', z='4860498.993' , name='PL611_HBA' +coordinate_system='ITRF2005', x='3551478.64311', y='1334128.4928', z='5110179.160' , name='PL612_LBA' +coordinate_system='ITRF2005', x='3551481.8171', y='1334203.5728', z='5110157.410' , name='PL612_HBA' diff --git a/lib/stations.py b/lib/stations.py deleted file mode 100755 index a1e737d1406cc5fc023cd16280dc6584c7f8eb0d..0000000000000000000000000000000000000000 --- a/lib/stations.py +++ /dev/null @@ -1,83 +0,0 @@ -# This module provides preconfigured station metadata and a function to conveniently create a station object with it. -# Station objects are required when composing SIP files. - -from siplib import Station, AntennafieldXYZ -import constants - - -# todo fill in real station names and coordinates. - -stationmetadata = dict( - station1=dict( - stationtype="Core", - HBA0=AntennafieldXYZ( - type="HBA0", - coordinate_system=constants.COORDINATESYSTEM_ITRF2000, - coordinate_unit=constants.LENGTHUNIT_M, - coordinate_x=1.0, - coordinate_y=1.0, - coordinate_z=1.0), - HBA1=AntennafieldXYZ( - type="HBA1", - coordinate_system=constants.COORDINATESYSTEM_ITRF2000, - coordinate_unit=constants.LENGTHUNIT_M, - coordinate_x=1.0, - coordinate_y=1.0, - coordinate_z=1.0), - LBA=AntennafieldXYZ( - type="LBA", - coordinate_system=constants.COORDINATESYSTEM_ITRF2000, - coordinate_unit=constants.LENGTHUNIT_M, - coordinate_x=1.0, - coordinate_y=1.0, - coordinate_z=1.0) - ), - station2=dict( - stationtype="International", - HBA=AntennafieldXYZ( - type="HBA", - coordinate_system=constants.COORDINATESYSTEM_ITRF2000, - coordinate_unit=constants.LENGTHUNIT_M, - coordinate_x=2.0, - coordinate_y=2.0, - coordinate_z=2.0), - LBA=AntennafieldXYZ( - type="LBA", - coordinate_system=constants.COORDINATESYSTEM_ITRF2000, - coordinate_unit=constants.LENGTHUNIT_M, - coordinate_x=2.0, - coordinate_y=2.0, - coordinate_z=2.0), - ) - ) - - -def compose_station( - name, - antennafieldtypes - ): - if name not in stationmetadata: - raise Exception("unknown station: "+ name+" (known stations:"+ str(stationmetadata.keys())+")") - else: - __afield1=None - __afield2=None - for type in antennafieldtypes: - if type not in stationmetadata.get(name): - raise Exception("antenna field type",type,"not defined for stations",name) - else: - if not __afield1: - __afield1=stationmetadata.get(name).get(type) - elif not __afield2: - __afield2=stationmetadata.get(name).get(type) - else: - raise Exception("maximum of two antennafields exceeded for station:",name) - - return Station( - name=name, - type=stationmetadata.get(name).get("stationtype"), - antennafield1=__afield1, - antennafield2=__afield2, - ) - - -