Hello DCWang,
If you wish to load the coordinates to the markers, you can use chunk.importReference() function (it will act similar to Import CSV option from the GUI), or you can assign the value manually for each marker instance:
marker.reference.location = PhotoScan.Vector([x, y, z])