def test_initialization(self): obj = SysMLObject() obj.getData(self.dbo, 385412) self.assertTrue(385407 in obj.daughters) self.assertTrue(385394 in obj.daughters) self.assertTrue(385385 in obj.daughters) self.assertTrue(385340 in obj.daughters) self.assertTrue(385362 in obj.daughters)
from EADBWrapper import EADBWrapper, SysMLObject if __name__ == "__main__": objectName = 'm1Prescription' dbo = EADBWrapper() objid = dbo.objectIdFromName(objectName) print '\nAvailable Object_IDs for %s: ' % objectName,objid print '\n------------------\n' obj = SysMLObject() obj.getData(dbo, objid[0]) obj.printObject()
id_dict = OrderedDict() # The Object_ID's below were just assembled heuristically by manually # inspecting the sysarch database. Once we have made the schema more # uniform, we ought to be able to find these automatically by searching # for desired component names. id_dict['m1'] = 385259 id_dict['m2'] = 385268 id_dict['m3'] = 385279 id_dict['l1'] = 385271 id_dict['l2'] = 385283 id_dict['filter'] = 385275 id_dict['l3'] = 385276 for ibp, bandpass in enumerate(('u', 'g', 'r', 'i', 'z', 'y')): with open('test_optics_%d.txt' % ibp, 'w') as output_file: for name in id_dict: obj = SysMLObject() obj.getData(dbo, id_dict[name]) surface_list = parseComponents(obj, bandpass) for surface in surface_list: output_file.write('%s %s ' % (surface[0], surface[1])) for ix in range(2, 7): output_file.write('%.3f ' % surface[ix]) for ix in range(7,15): output_file.write('%.4e ' % surface[ix]) output_file.write('%s %s\n' % (surface[15], surface[16]))
dbo = EADBWrapper() id_dict = OrderedDict() # The Object_ID's below were just assembled heuristically by manually # inspecting the sysarch database. Once we have made the schema more # uniform, we ought to be able to find these automatically by searching # for desired component names. id_dict['m1'] = 385259 id_dict['m2'] = 385268 id_dict['m3'] = 385279 id_dict['l1'] = 385271 id_dict['l2'] = 385283 id_dict['filter'] = 385275 id_dict['l3'] = 385276 for ibp, bandpass in enumerate(('u', 'g', 'r', 'i', 'z', 'y')): with open('test_optics_%d.txt' % ibp, 'w') as output_file: for name in id_dict: obj = SysMLObject() obj.getData(dbo, id_dict[name]) surface_list = parseComponents(obj, bandpass) for surface in surface_list: output_file.write('%s %s ' % (surface[0], surface[1])) for ix in range(2, 7): output_file.write('%.3f ' % surface[ix]) for ix in range(7, 15): output_file.write('%.4e ' % surface[ix]) output_file.write('%s %s\n' % (surface[15], surface[16]))