NRC-Research / SNAP-issues

This repository was created to provide a public location to record and display the status of "issues" for the SNAP application. The SNAP developers will acknowledge, provide (and maybe request) feedback on the reported issues, and in general use the information to improve SNAP code.
3 stars 0 forks source link

SNAP Python Example Error for "Write an Output File" #25

Closed AndrewIrelandNRC closed 2 years ago

AndrewIrelandNRC commented 2 years ago

If you add a python script job stream and select “Insert Example” > “Write an Output File” you get:

# Retrieve the name and location of an output file by its label
outFileName = get_output_file('output1')
# Open the file
outFile = open(outFileName, 'w')
# TODO: Insert your output code here.
# Close the file
outFile.close()

But this doesn’t work. You’d need to change the ‘open’ command to:

outFile = open(outFileName.get_location(), 'w')

wrd-apt commented 2 years ago

This issue has been addressed, and the corrected sample text will be included with SNAP 4.0.3.