Using the most updated ancillary data to process Sentinel 2 images with l2gen

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
Posts: 33
Joined: Tue Oct 11, 2016 11:49 am America/New_York
Answers: 0

Using the most updated ancillary data to process Sentinel 2 images with l2gen

by dogun » Mon Sep 10, 2018 3:33 pm America/New_York

Hi All,

Wondering if there's a way to ensure all ancillary data for l2gen processing for Sentinel 2 images are updated for my image (via the command line). I'd like to use ancillary data specific to my image date for a more robust Rrs retrieval.



OB.DAAC - SeanBailey
User Services
User Services
Posts: 1485
Joined: Wed Sep 18, 2019 6:15 pm America/New_York
Answers: 1
Been thanked: 5 times

Using the most updated ancillary data to process Sentinel 2 images with l2gen

by OB.DAAC - SeanBailey » Tue Sep 11, 2018 8:35 am America/New_York

You can use the script.

Sentinel 2 is not a format the script recognizes, so you'll have to use the --start option


      FILE  Input L1A or L1B file

    NOTE: Currently NO2 climatological data is used for OBPG operational
          processing, so to match OBPG distributed data products, the default
          behaviour disables NO2 searching.

    This program queries an OBPG server and optionally downloads the optimal
    ancillary data files for Level-1 to Level-2 processing. If an input file
    is specified the start and end times are determined automatically, otherwise
    a start time must be provided by the user.

    A text file (with the extension '.anc') is created containing parameters
    that can be directly used as input to the l2gen program for optimal Level-1
    to Level-2 processing, e.g.:

         l2gen ifile=<infile> ofile=<outfile> par=<the *.anc text file>

        0  : all optimal ancillary files exist and are present on the locally
        99 : an error was encountered; no .anc parameter text file was created
        31 : no ancillary files currently exist corresponding to the start
             time and therefore no .anc parameter text file was created
      1-30 : bitwise value indicating one or more files are not optimal:

             bit 0 set = missing one or more MET files
             bit 1 set = missing one or more OZONE files
             bit 2 set = no SST file found
             bit 3 set = no NO2 file found
             bit 4 set = no ICE file found

    e.g. STATUS=11 indicates there are missing optimal MET, OZONE, and NO2 files


  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -s START, --start=START
                        Time of the first scanline (if used, no input file is
  -e STOP, --stop=STOP  Time of last scanline
  --ancdir=ANCDIR       Use a custom directory tree for ancillary files
  --ancdb=ANCDB         Use a custom file for ancillary database. If full path
                        not given, ANCDB is assumed to exist (or will be
                        created) under $OCVARROOT/log/. If $OCVARROOT/log/
                        does not exist, ANCDB is assumed (or will be created)
                        under the current working directory
  -c, --curdir          Download ancillary files directly into current working
  -m MISSION, --mission=MISSION
                        Mission name
  -d, --disable-download
                        Disable download of ancillary files not found on hard
  -f, --force-download  Force download of ancillary files, even if found on
                        hard disk
  -r, --refreshDB       Remove existing database records and re-query for
                        ancillary files
  -i, --ice             Do not search for sea-ice ancillary data
  -n, --no2             Search for NO2 ancillary data
  -t, --sst             Do not search for SST ancillary data
  -v, --verbose         print status messages
  --noprint             Suppress printing the resulting list of files to the
  --timeout=TIMEOUT     set the network timeout in seconds

Post Reply