EMIT Atmospheric Correction with Acolite¶
Acolite can perform atmospheric correction on a variety of satellite sensors, including Landsat, Sentinel-2, PACE, EMIT, AVIRIS, among others. For more information on how to use Acolite, please refer to the Acolite manual
In this example, we will use Acolite to perform atmospheric correction on an EMIT image.
In [ ]:
Copied!
# %pip install "hypercoast[extra]"
# %pip install "hypercoast[extra]"
Import libraries¶
In [ ]:
Copied!
import os
import hypercoast
import os
import hypercoast
Specify input data¶
We will use the following input data:
- EMIT_L1B_RAD_001_20230220T181144_2305112_013.nc
- EMIT_L1B_OBS_001_20230220T181144_2305112_013.nc
Put the input data in the data
folder.
In [ ]:
Copied!
work_dir = os.path.expanduser("~/Downloads")
input_dir = os.path.join(work_dir, "data")
work_dir = os.path.expanduser("~/Downloads")
input_dir = os.path.join(work_dir, "data")
In [ ]:
Copied!
filepath = os.path.join(input_dir, "EMIT_L1B_RAD_001_20230220T181144_2305112_013.nc")
filepath = os.path.join(input_dir, "EMIT_L1B_RAD_001_20230220T181144_2305112_013.nc")
Download Acolite software¶
In [ ]:
Copied!
acolite_dir = hypercoast.download_acolite(work_dir)
print(f"Acolite directory: {acolite_dir}")
acolite_dir = hypercoast.download_acolite(work_dir)
print(f"Acolite directory: {acolite_dir}")
Run Acolite¶
In [ ]:
Copied!
out_dir = os.path.join(work_dir, "output")
out_dir = os.path.join(work_dir, "output")
In [ ]:
Copied!
hypercoast.run_acolite(
acolite_dir=acolite_dir,
input_file=filepath,
out_dir=out_dir,
l2w_parameters="Rrs_*",
rgb_rhot=True,
rgb_rhos=True,
map_l2w=True,
)
hypercoast.run_acolite(
acolite_dir=acolite_dir,
input_file=filepath,
out_dir=out_dir,
l2w_parameters="Rrs_*",
rgb_rhot=True,
rgb_rhos=True,
map_l2w=True,
)
Batch processing¶
To process multiple images, put all the images in a folder. For example, unzip all the images in the data
folder. Then, run the following code to make sure that all image folders are listed.
In [ ]:
Copied!
input_files = [os.path.join(input_dir, f) for f in os.listdir(input_dir) if "RAD" in f]
input_files
input_files = [os.path.join(input_dir, f) for f in os.listdir(input_dir) if "RAD" in f]
input_files
Run the following code to process all images in the data
folder.
In [ ]:
Copied!
hypercoast.run_acolite(
acolite_dir=acolite_dir,
input_file=input_files,
out_dir=out_dir,
l2w_parameters="Rrs_*",
rgb_rhot=True,
rgb_rhos=True,
map_l2w=True,
)
hypercoast.run_acolite(
acolite_dir=acolite_dir,
input_file=input_files,
out_dir=out_dir,
l2w_parameters="Rrs_*",
rgb_rhot=True,
rgb_rhos=True,
map_l2w=True,
)