Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implementation for PlanetScope images ? #29

Open
kevin-lievens opened this issue Dec 2, 2020 · 0 comments
Open

implementation for PlanetScope images ? #29

kevin-lievens opened this issue Dec 2, 2020 · 0 comments

Comments

@kevin-lievens
Copy link

Hello,

I’m new to Python and I tried to use this code with 2 Planetscope images (3B_AnalyticMS_SR) but I have difficulties to implement the script.

I changed the full_basename for the 2 images:
full_candidate_basename = ‘20200331_082156_1001_3B_AnalyticMS_SR’
full_reference_basename = ‘20181020_081539_0f3f_3B_AnalyticMS_SR'

I keep the same basename:
candidate_basename = 'candidate'
reference_basename = 'reference'

I changed the coordinates for my AOI in the next lines:
for full_filename, cropped_filename in zip(full_candidate_filenames, candidate_filenames):
subprocess.check_call(['gdal_translate', '-projwin', '278244', '104796', '288288', '110928', full_filename, cropped_filename])
for full_filename, cropped_filename in zip(full_reference_filenames, reference_filenames):
subprocess.check_call(['gdal_translate', '-projwin', '278244', '104796', '288288', '110928', full_filename, cropped_filename])

I also changed the paths to specify the location of the image on disk:
candidate_path =‘D:/Data/20200331_082156_1001_3B_AnalyticMS_SR.tif’
reference_path = ‘D:/Data/20181020_081539_0f3f_3B_AnalyticMS_SR.tif’
result_path = ' D:/Data/normalized.tif'

But when I run the code it seems there is a problem with the command gdal_transalte:
CalledProcessError: Command '['gdal_translate', '-projwin', '278244', '104796', '288288', '110928', '20201015_082258_1040_3B_B2.TIF', 'candidate_blue.TIF']' returned non-zero exit status 1.

I don’t know where I’m wrong.
Would it be possible to give me an example of this code for PlanetScope images?
Thanks for your help.

Best regards,
Kévin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant