I’m currently using the SNAP API, using the Pixel Extraction function. I’m trying to get coordinates from a CSV file, but I’m not sure what the syntax for that is. I currently have it as the code below. But now, I have over 60 coordinates, and I’d rather not type them down. I know in the SNAP application I can get the coordinates from the CSV, but not sure how to do it in python. Any help is appreciated. Thanks!
singleCoor = snappy.jpy.get_type('org.esa.snap.pixex.Coordinate')
coords = jpy.array('org.esa.snap.pixex.Coordinate', len(stations))
for i in range(len(stations)):
coords[i] = singleCoor('MB' + str(i+1),stations[i][1],stations[i][0], None)
#polarization = ['HH1-HH2','HH1-VV2','VV1-VV2','VV1-HH2']
params = HashMap()
params.put('sourceProductPaths', "C:\\Users\\ammar\\Desktop\\csa_cropdisease\\MB_2016\\" + pol + "\\*.tif")
params.put('exportBands', True)
params.put('exportTiePoints',False)
params.put('exportMasks',False)
params.put('coordinates', coords)
params.put('outputDir', 'C:\\Users\\ammar\\Desktop\\pixEx')
params.put('outputFilePrefix', name)
params.put('windowSize',3)
params.put('aggregatorStrategyType','mean')
params.put('extractTimeFromFilename', True)
params.put('dateInterpretationPattern','yyyyMMdd_hhmmss')
params.put('filenameInterpretationPattern','*${startDate}*')
GPF.createProduct('PixEx',params)