Common Adjacency Software/Module in ADL?

Issues related to VIIRS EDR algorithms and data
Post Reply
jhuangadl
Posts: 142
Joined: Fri Apr 29, 2011 7:57 am

Common Adjacency Software/Module in ADL?

Post by jhuangadl »

Dear all,
Any one please know more about a Common Adjacency module in ADL?
It is a common adjacency software for finding the closest pixels for any adjacency tests or calculating standard deviation within nearby pixels. Comments we received are: "Because of the earth rotation between scans, when working with rows 1 and 16, one needs to shift the adjacent row by one or two pixels before calculating the standard deviation. The system provides to the using algorithm the necessary shifts to account for the rotation and will provide the pixel with the closest distance."
Any more information about this module is sincerely appreciated!
Sincerely,
Jingfeng
tsimpson
Posts: 23
Joined: Wed Apr 02, 2014 9:23 am
Location: Riverdale, MD, USA

Re: Common Adjacency Software/Module in ADL?

Post by tsimpson »

The comments you received are a pretty good two-sentence description of what Common Adjacency is for. Here is a little more detail:

The Common Adjacency algorithm is used to find pixels close to a given pixel in VIIRS imagery or moderate resolution bands. One of its uses is to find replacements for "bow-tie deleted" pixels in a given scan. These pixels get their name because the footprint of a VIIRS scan on earth resembles a bow tie, as it gets wider the farther you are from nadir. This means that adjacent scans have some overlap at the ends, and to reduce the amount of data, some of the pixels at the ends are "bow-tie deleted." This process is also known as pixel trim.

The software is meant to take the earth's rotation and the variation in VIIRS telescope speed into account. It uses either the grid-row-column (GRC) or the geolocation (GEO) product produced by the ProSdrViirsGeo algorithm, which is run within the ProSdrViirsController process. Another required input is the pixel trim configuration file, $ADL_HOME/cfg/PRO_CMN_ADJ_CFG.xml.

Common Adjacency is currently used by the VIIRS Active Fires, Cloud Mask and Bright Pixel algorithms.

The Common Adjacency software itself doesn't calculate standard deviations, but it would help find the nearby pixels on which you might want to do such a calculation.

There is an Operational Algorithm Description (OAD) document for Common Adjacency available on the JPSS MIS server (https://jpssmis.gsfc.nasa.gov/). The document number is 474-00097.
Todd Simpson
Raytheon Company
jhuangadl
Posts: 142
Joined: Fri Apr 29, 2011 7:57 am

Re: Common Adjacency Software/Module in ADL?

Post by jhuangadl »

Thanks, Todd,
Any chance you can let us know what is the name of the routine for this Common Adjacency Algorithm?
And how we can make use of this algorithm in the aerosol code?
Is it possible that I can send you over the aerosol code that we are currently running for our standard deviation calculation, and you can give us some hints how to make use of this routine? Not testing the code your self, but any hints/advices will do.
We are in a hard timeline to get this resolved, and we truly appreciate your kind help!
Thanks!
Jingfeng
tsimpson
Posts: 23
Joined: Wed Apr 02, 2014 9:23 am
Location: Riverdale, MD, USA

Re: Common Adjacency Software/Module in ADL?

Post by tsimpson »

The source code for the Common Adjacency algorithm is in $ADL_HOME/CMN/Utilities/Adjacency/src, with header files in $ADL_HOME/include.

I don't know that sending me the aerosol code at this point would be the best way to proceed. But I do have some suggestions about how to use Common Adjacency:

(1) Look at the code in $ADL_HOME/EDR/VIIRS/land/ActiveFires/src/ProEdrViirsActiveFires.cpp to see how common adjacency can be used. Here are some examples:
  • ProCmnAdjFactory::getTable() returns a pointer to a ProCmnAdjTable object, which lets you specify a pixel and then get nearby pixels within a specified 'radius' (for instance, if the radius is 1 then you can get pixels in a 3x3 neighborhood centered at your specified pixel, if the radius is 2 then the neighborhood is 5x5, and so on)

    ProCmnAdjTable::setCurrentPixel() takes the row and column of your specified pixel, the radius and a flag that says which nearby pixels you want (for instance, you can say ProCmnAdjTable::NO_CENTER, which means you are interested in the nearby pixels but not the pixel you specified)

    ProCmnAdjTable::getNextAdjPixel() takes a reference to a ProCmnAdjPixel and fills in the row and column of the next nearby pixel; it returns true if there are more nearby pixels or false to say that you've gone through them all

    ProCmnAdjPixel has getRow() and getCol() functions to return the row and column of the pixel found by ProCmnAdjTable::getNextAdjPixel()
(2) In order to compile and run the aerosol code with Common Adjacency, you will need to change some config files, such as the following:
  • Add PRO_CMN_ADJ_CFG.xml to the guide list $ADL_HOME/cfg/ProEdrViirsAerosolController_GuideList.cfg.

    Add an input for VIIRS-MOD-GRC-TC to the Inputs group in the config file $ADL_HOME/cfg/ProEdrViirsAerosol_CFG.xml. See $ADL_HOME/cfg/ProEdrViirsActiveFires_CFG.xml for an example.

    Add "-lProCmnAdj" to the list of libraries in the SYSLIB macro in $ADL_HOME/EDR/VIIRS/aerosol/src/Imakefile, then rebuild the Makefile in this directory (one way to do this is to run the command "$ADL_HOME/script/build_adl.pl -makefiles").
Hope this helps to get you started ... feel free to ask if you have questions.
Todd Simpson
Raytheon Company
jhuangadl
Posts: 142
Joined: Fri Apr 29, 2011 7:57 am

Re: Common Adjacency Software/Module in ADL?

Post by jhuangadl »

Thanks a lot, Todd,
I am giving it a try now.
Appreciate all your help!
Jingfeng
Post Reply