Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
lbusett committed Jun 8, 2020
1 parent 50cd855 commit 00e59bd
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 150 deletions.
140 changes: 10 additions & 130 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,147 +23,27 @@ Italy (CNR-IREA)*

# Installation

You can install the development version from
[GitHub](https://github.com/) with:
You can install the last stable version of `prismaread` from
[GitHub](https://github.com/) using:

``` r
# install.packages("remotes")
remotes::install_github("lbusett/prismaread")
remotes::install_github("lbusett/prismaread", ref = "v0.2.0")
library(prismaread)
```

# Importing Level 1 Data

The function to be used is `convert_prisma`. It takes as input the full
path of a PRISMA L1 hdf5 image, an output file name and format, and a
series of switches allowing to decide which datasets should be saved.

In particular, the `FULL` argument allows deciding if a complete
VNIR+SWIR cube has to be created alongside the “single” VNIR and SWIR
ones. In that case, the ‘join\_priority’ keyword is used to decide if
keeping bands from the “VNIR” or the “SWIR” data cube in the wavelength
were they overlap.

A “base” georeferincing in Lat/Lon WGS-84 based on the “GLT and Bowtie
Correction” technique used in ENVI, and described in
<https://www.harrisgeospatial.com/docs/backgroundgltbowtiecorrection.html>,
unless the `base_georef` argument is set to FALSE.

For example the following code:
, or the last development version using:

``` r
in_file = "/home/lb/tmp/test/PRS_L1_STD_OFFL_20190825103112_20190825103117_0001.he5"
out_file = "/home/lb/tmp/test/test_1"
out_format = "ENVI"

# Save a full image, prioritizing the VNIR spectrometer and save in EVI format
convert_prisma(in_file = in_file,
out_file = out_file,
out_format = out_format,
join_priority = "VNIR",
FULL = TRUE,
PAN = TRUE,
CLOUD = TRUE)
# install.packages("remotes")
remotes::install_github("lbusett/prismaread")
library(prismaread)
```

accesses the input file and saves both the VNIR and SWIR cubes, as well
as a full hyperspectral cube and the PAN and CLOUD images. **See
[documentation](reference/convert_prisma.html) of the convert\_prisma()
function for info on available arguments**.

The function also saves ancillary data related to wavelengths and fwhms
of the different images, and to hour and sun geometry at acquisition in
ancillary txt files.

### Creation of ATCOR files

Starting `v0.02` the function also allows automatic creation of text
files required to run an ATCOR atmospheric correction. Those files are
saved in the `ATCOR` subfolder of the main output folder.

In “standard” behaviour, only the three “standard” ATCOR files (`.wvl`,
`.dat` and `.cal`) are created, with the `.wvl` file containing nominal
wavelengths and FWHMs derived from the `cw` and `fwhm` attributes of the
*.he5* file- The user can however also choose to generate additional
ATCOR files, containing data about wavelengths and FWHMs related to
different “columns” of the data cube, as derived from the
`KDP_AUX/Cw_Vnir_Matrix`, `KDP_AUX/Cw_Swir_Matrix`,
`KDP_AUX/Cw_Fwhm_Matrix`, `KDP_AUX/Cw_Fwhm_Matrix` HDF layers. This
could allow running different atmospheric corrections for different
columns of the data, potentially allowing compensating “smile” effects
on the retrieved surface reflectances. For example:

``` r
in_file = "/home/lb/tmp/test/PRS_L1_STD_OFFL_20190825103112_20190825103117_0001.he5"
out_file = "/home/lb/tmp/test/test_1"
out_format = "ENVI"

# Save a full image, prioritizing the VNIR spectrometer and save in EVI format
convert_prisma(in_file = in_file,
out_file = out_file,
out_format = out_format,
join_priority = "VNIR",
ATCOR = TRUE,
ATCOR_wls = c(200,800),
FULL = TRUE,
PAN = TRUE,
CLOUD = TRUE)
```
# Usage

**IMPORTANT NOTE**

The latter functionality may be only appliable to “HRC” L1 data cubes.
We are currently investigating this - proceed with caution\!

# Work on Level 2 Data

The function to be used is still `convert_prisma`, with similar syntax.
Only differences are:

1. The “PAN”, “CLOUD”, “LC” and “GLINT” arguments are ignored, because
they are not available in L2 files;
2. The “ATCOR” and “ATCOR\_wls” arguments are ignored, because they are
useless in this case;
3. The output imagery is properly georeferenced, **if level is 2D**.
Otherwise, the same “ballpark” georeferencing as for L1 data is
applied.

# Output Formats

- Outputs are provided as rasters in **ENVI** or **GEOTIFF** format
according to user’s choice.

- Filenames are built starting from the output file name provided by
the user, by adding appropriate suffixes. For example, if the user
specified `out_file = "D:/myoutfolder/myoutfil"`, and `source =
"HCO"`, the output file for the VNIR cube will be
`D:/myoutfolder/myoutfil_HCO_VNIR.envi` (or
`D:/myoutfolder/myoutfil_HCO_VNIR.tif`).

- Measure units of the output hyperspectral data are as follows:

| LEVEL | Variable | Measure Units |
| :---: | :---------: | :-----------------: |
| L1 | Radiance | W / m^2 \* sr \* um |
| L2B | Radiance | W / m^2 \* sr \* um |
| L2C | Reflectance | unitless (ratio) |
| L2D | Reflectance | unitless (ratio) |


- If output format is “ENVI”, the wavelengths of the different bands
for the hyperspectral cubes are properly written in the appropriate
header (.hdr) file.

- Irrespective from output format, info about wavelengths and fwhms of
the hyperspectral cubes are saved in appropriate txt files. For
example, if the output file is
`D:/myoutfolder/myoutfil_HCO_VNIR.envi`, info about the wavelengths
is saved in `D:/myoutfolder/myoutfil_HCO_VNIR_meta.txt`

- Info about acquisition date and angles is saved in a dedicated txt
file. For example, if output file is
`D:/myoutfolder/myoutfil_VNIR.envi`, info about the angles is saved
in `D:/myoutfolder/myoutfil_HCO_VNIR_meta.txt`
See `prismaread` [website](https://lbusett.github.io/prismaread/) for
further instructions and info on output formats.

# Future Work

Expand Down
3 changes: 0 additions & 3 deletions docs/CODE_OF_CONDUCT.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions docs/LICENSE.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 2 additions & 6 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,14 @@ See the **Articles** section of the website for detailed info on usage.

- Instructions for importing PRISMA
[**L1**](articles/Importing-Level-1-Data.html) and
[**L2**](docs/articles/Importing-Level-2-Data.html)
[**L2**](articles/Importing-Level-2-Data.html)

- Info about [Output format and Naming
Conventions](articles/Output-Format-and-Naming.html)

- Info about [Creation of ATCOR input
files](articles/Creation-of-ATCOR-files.html)

- Instructions for extracting PRISMA data over features of a vector
dataset [Extracting Data from PRISMA
images](articles/Extract-Data.html)
images](articles/Extracting-data-over-vector.html)

# Future Work

Expand Down

0 comments on commit 00e59bd

Please sign in to comment.