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

C2L2 Landsat Support #83

Open
khmara-breeze opened this issue Sep 9, 2022 · 2 comments
Open

C2L2 Landsat Support #83

khmara-breeze opened this issue Sep 9, 2022 · 2 comments

Comments

@khmara-breeze
Copy link

I am trying to run pymetric mountain_model on the C2L2 landsat data.

I'm getting an error on the following command line:

python C:\pymetric\code\local\landsat_prep_scene.py -i C:\pymetric\example\landsat_2022.ini

Error traceback:

################################################################################
Run Time Stamp:      2022-09-09 12:13:00.235495
Current Directory:   c:\pymetric
Script:              landsat_prep_scene.py

Preparing Landsat scenes
  INI File:          landsat_2022.ini

################################################################################
Run Time Stamp:      2022-09-09 12:13:03.229206
Current Directory:   C:\pymetric\example\2022\p038r037\LC08_L2SP_038037_20220704_20220707_02_T1
  INI File:          landsat_2022.ini
Traceback (most recent call last):
  File "C:\pymetric\code\prep_functions\landsat_prep_scene_func.py", line 1295, in <module>
    stats_flag=args.stats, overwrite_flag=args.overwrite)
  File "C:\pymetric\code\prep_functions\landsat_prep_scene_func.py", line 172, in main
    image = et_image.Image(image_ws, env)
  File "C:\pymetric\code\support\et_image.py", line 222, in __init__
    self.process_mtl()
  File "C:\pymetric\code\support\et_image.py", line 428, in process_mtl
    logging.debug(log_f.format('Correction:', self.correction))
AttributeError: 'Image' object has no attribute 'correction'

As far as I can see from the code, in the code\support\et_image.py file, on line 302, C2L2 landsat metadata is parsed incorrectly, my C2L2 landsat metadata file does not contain DATA_TYPE or PRODUCT_TYPE keys.

elif ('DATA_TYPE' == mtl_line[0] or
	  'PRODUCT_TYPE' == mtl_line[0]):
	self.correction = mtl_line[1].replace('"', '')

Also I noticed from the code, that pymetric does not understand the C2L2 landsat images name format, so it cannot find the bands it needs.

My question is, does pymetric support C2L2 landsat data, or is there any workaround for this?

@a1t1d1
Copy link

a1t1d1 commented Sep 12, 2022

Any comments on support for C2L2?

@prevelle
Copy link
Collaborator

There are no current plans that I am aware of to add support for Collection 2 Landsat data but will update if that changes.

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

3 participants