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

sen2cor version #79

Open
usamahzaheer6 opened this issue Jul 22, 2021 · 4 comments
Open

sen2cor version #79

usamahzaheer6 opened this issue Jul 22, 2021 · 4 comments

Comments

@usamahzaheer6
Copy link
Contributor

The issue with sen2cor v2.8 for processing new images from S2 which are dated after 30th March 2021.

sen2cor should be upgraded to a higher version v2.9 in order to be working with new images.

I figured out there is s part of the code in raster_manipulation.py (#def get_sen2cor_version), which may need some edit regarding acquiring the version of sen2cor being used (if upgraded to v2.9) .

See below (modified),

`version_regex = r"Version: (\d+.\d+.\d+)"
match = re.search(version_regex, help_string)
if match:
return match.group(1)
else:
version_regex = r"Sen2Cor (\d+.\d+.\d+)"
match = re.search(version_regex, help_string)
if match:
return match.group(1)
else:
raise FileNotFoundError("Version information not found; please check your sen2cor path.")

`

@Thingus
Copy link
Contributor

Thingus commented Jul 22, 2021

Hi usamahzaheer6, I don't have access to Sen2Cor 2.9 right now; could you post a copy of the help string (run sen2cor --help) so I can update the regex?

@usamahzaheer6
Copy link
Contributor Author

(pyeo_env) [uz6@spectre12 bin]$ /scratch/satburn/uz6/scratch_new/Sen2Cor-02.09.00-Linux64/bin/L2A_Process --help
usage: L2A_Process.py [-h] [--mode MODE] [--resolution {10,20,60}]
[--datastrip DATASTRIP] [--tile TILE]
[--output_dir OUTPUT_DIR] [--work_dir WORK_DIR]
[--img_database_dir IMG_DATABASE_DIR]
[--res_database_dir RES_DATABASE_DIR]
[--processing_centre PROCESSING_CENTRE]
[--archiving_centre ARCHIVING_CENTRE]
[--processing_baseline PROCESSING_BASELINE] [--raw]
[--tif] [--sc_only] [--cr_only] [--debug]
[--GIP_L2A GIP_L2A] [--GIP_L2A_SC GIP_L2A_SC]
[--GIP_L2A_AC GIP_L2A_AC] [--GIP_L2A_PB GIP_L2A_PB]
input_dir

Sen2Cor 2.9.0, created: 2020.11.30, supporting Level-1C product version 14.2 -
14.6.

positional arguments:
input_dir Directory of Level-1C input

optional arguments:
-h, --help show this help message and exit
--mode MODE Mode: generate_datastrip, process_tile
--resolution {10,20,60}
Target resolution, can be 10, 20 or 60m. If omitted,
only 20 and 10m resolutions will be processed
--datastrip DATASTRIP
Datastrip folder
--tile TILE Tile folder
--output_dir OUTPUT_DIR
Output directory
--work_dir WORK_DIR Work directory
--img_database_dir IMG_DATABASE_DIR
Database directory for L1C input images
--res_database_dir RES_DATABASE_DIR
Database directory for results and temporary products
--processing_centre PROCESSING_CENTRE
Processing centre as regex: ^[A-Z_]{4}$, e.g "SGS_"
--archiving_centre ARCHIVING_CENTRE
Archiving centre as regex: ^[A-Z_]{4}$, e.g. "SGS_"
--processing_baseline PROCESSING_BASELINE
Processing baseline in the format: "dd.dd", where
d=[0:9]
--raw Export raw images in rawl format with ENVI hdr
--tif Export raw images in TIFF format instead of JPEG-2000
--sc_only Performs only the scene classification at 60 or 20m
resolution
--cr_only Performs only the creation of the L2A product tree, no
processing
--debug Performs in debug mode
--GIP_L2A GIP_L2A Select the user GIPP
--GIP_L2A_SC GIP_L2A_SC
Select the scene classification GIPP
--GIP_L2A_AC GIP_L2A_AC
Select the atmospheric correction GIPP
--GIP_L2A_PB GIP_L2A_PB
Select the processing baseline GIPP

@Thingus
Copy link
Contributor

Thingus commented Jul 23, 2021

OK; your patch looks good, can you compose it into a pull request?

@usamahzaheer6
Copy link
Contributor Author

Thanks. Pull request created.

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

2 participants