Py6S - advanced techniques

On this section you will find how to run the Py6S to:

  • Plot sepectra for only one flightline in a directory with several ones. Or a specific flightline with different names on IGM, NAV and level1b.
    • Chose a pixel by its given (lat,lon) or by its position on the grid (x,y).
    • Use in situ reflectance instead of the predefined by Py6S.

Let's assume that you are doing the delivery check for hyperspectral data. Go to delivery project directory that you want to check. Example: ~arsf/arsf_data/2015/flight_data/spain/EUFAR15_38-2015_170_Mallorca/processing/delivery/EUFAR15_38-170-hyperspectral-20151014

Create a new folder:

output_folder=/tmp/fenix_vs_py6s-`date +%s`
mkdir $output_folder

In this case, the script to run is You will need to specify for the same flightline the .bil on level1b, the .igm and the postprocessed .nav file. Be careful not to take the mask files and the same flightline for every file (the script will exit if not). Run the model as the example: -i ./flightlines/level1b/f169b141b.bil -m ../../../processing/hyperspectral/flightlines/georeferencing/igm/f169b143b_p_sct20.37.igm \
                   -n ./flightlines/navigation/f169b141b_nav_post_processed.bil --plot $output_folder/test -v

On the example above a pixel is not specified and the script will look for a ramdom vegetation pixel at nadir and create a plot called test.png on the given folder.

You can however specify:

  -s INGROUND, --inground INGROUND
                        Input ground spectra to run on Py6S (ground measures:
                        .sig, .txt)
  --lat LAT             If you want a specific pixel instead of a random one
  --lon LON             If you want a specific pixel instead of a random one
  -x X                  Sample number
  -y Y                  Line number

If you want to look for a specific pixel, you can select it by its position (lat,lon) or by its coordinates (x,y) on the flightline's grid. Note that the script with only accept (lat, lon) inputs within the range of latitude and longitude of the flightline to prevent human errors.

Verbose mode is recommended when running this script and will print on screen information about the given pixel and the viewing angles needed to run the Py6S model if the pixel is not a Nadir.

This will plot the Fenix spectra against the at-sensor Py6S vegetation model. In this case, both figures will only match if the pixel given as input is a vegetation one and therefore, some caution is recomended when interpreting the plot.

In situ Reflectance

If an in situ spectra has been measured and is available, you can provide this to Py6S rather than using the built in vegetation spectra.

You will need to add -s when running the script: -v -s ./GROUND_SPECTRA_PATH ...

(-i -m. -n, --plot are still required)

Currently, suported formats for ground spectra are .text and .sig files, new formats should be added to the open source PySpectra library

  • If a .sig file is given, the script will take the latitude and longitude from the file.
  • If a text file is given, you need to specify lat, lon or otherwise the script will look for a ramdom vegetation pixel that could not have the same reflectance features that your ground reflectance values.
Last modified 2 months ago Last modified on Aug 24, 2017 11:15:44 AM