Page 1 of 1

Bypassing an Optional Input

Posted: Thu May 28, 2015 10:11 am
by JeffVI
Dear All,
I will appreciate an urgent help on the matter.
For the VI Algorithm, we are getting AOT IP as an optional input. Therefore, we will need to Audit the existence of the AOT IP input and if it is not available, the following reading in portion of the code will be bypassed, and the aeroQuality should be FILLVALUE:

Code: Select all

/New, additional QF bits being copied from Aerosol IP
   aeroQuality = viData->aot->qf1[modRow][modCol] &
                               PRO_AEROS_AOT_QUALITY_MASK;
I am not very familiar with the Audit module and will sincerely appreciate any kind and timely help on the matter. The Calculate_VegIndex.cpp is provided in the zip file attached. Thank you very much!

Re: Bypassing an Optional Input

Posted: Mon Jun 01, 2015 11:20 am
by tsimpson
There are three files you would need to change to make AOT IP an input. You might have done some of them already, but I'll just mention them here on the forum.

1. Make the AOT IP an input by adding it to the config guide, ProEdrViirsVI_CFG.xml. In the input group, add these lines as a new 'group' element:

<group name="VIIRS-AOT-IP">
<config>
<name>Mode</name>
<configValue>Optional</configValue>
</config>
<config>
<name>DataEndianType</name>
<configValue>Big</configValue>
</config>
<config>
<name>OfficialShortName_1</name>
<configValue>VIIRS-Aeros-Opt-Thick-IP</configValue>
</config>
<config>
<name>SubstituteShortName_1</name>
<configValue>VIIRS-Aeros-Opt-Thick-IP-SUB</configValue>
</config>
</group>

The first config element in the group makes this input optional.

2. In ProEdrViirsVIStruct.h, add the following to the VVI_DATA_TYPE structure:

ViirsAotIpType* aot;

3. In ProEdrViirsVI.cpp, add the following to the doProcessing() function:

viDataType_.aot = inputVIIRS_AOT_IP_.start_Ptr;

This line would go near the beginning of the function where there are similar lines for the other inputs.

After making these changes, you would use the following in Calculate_VegIndex.cpp to check if the AOT input was available:

if (viData->aot == DM_BADADDRESS)
{
// the AOT is not available
}
else
{
// the AOT is available
}

Run 'make clean library' in the $ADL_HOME/EDR/VIIRS/land/VegIndex/src directory to rebuild the code.

Hope this helps ... please let me know if you have more questions or comments.

Thanks,
Todd

Re: Bypassing an Optional Input

Posted: Mon Jun 01, 2015 4:27 pm
by tsimpson
Just wanted to correct my last post ... I should have said to run 'make clean library program' not 'make clean library'.

Re: Bypassing an Optional Input

Posted: Wed Jun 10, 2015 9:10 am
by JeffVI
Thanks a lot, Todd,
That was very very helpful!
Appreciate all your kind and timely help!