Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASTER failing to get Gain Status #199

Closed
LandonTClipp opened this issue Jul 5, 2017 · 12 comments
Closed

ASTER failing to get Gain Status #199

LandonTClipp opened this issue Jul 5, 2017 · 12 comments

Comments

@LandonTClipp
Copy link
Contributor

ASTER retrieves the gain status for each camera from productmetadata.0. It searches for HGH, NOR, LO1, LO2, and OFF. However in the file

/u/sciteam/clipp/scratch/BFDataNew/BFData/ASTER/2013.12.27/AST_L1T_00312272013225732_20150619040038_13845.hdf

Some of the cameras have "LOW" as the status. ASTER does not check for this???

The error that manifests is "There is no valid Unit Conversion Coefficient for this dataset ImageData2". Need to figure out how to fix this problem.

@kyang2014
Copy link
Contributor

According to ASTER user's guide, The HGH, NOR, LO1, LO2, and OFF are all they provided. So this LOW must be an outlier. I will double check the file, hang on.

ASTER-radiance-calculation..pdf

@LandonTClipp
Copy link
Contributor Author

This file path is for Blue waters, FYI

@kyang2014
Copy link
Contributor

Landon, I verified what you said. We need to contact ASTER team on this issue. You should notify Guangyu and ask him to contact LP DAAC how we should interpret the LOW. This is not in their user's guide.

@kyang2014
Copy link
Contributor

From Guangyu:
On page 13 of the ASTER 1T product specification (https://lpdaac.usgs.gov/sites/default/files/public/product_documentation/aster_l1t_product_specification.pdf), you will see the gain markers for VNIR (Bands 1-3) are “HIGH”, “NOR” or “LOW”. But for SWIR, they are “HIGH”, “NOR” , “LO1” or “LO2”.

I’ve looked at the sample ASTER file and found the gain settings for bands 1 and 2 are indeed set to “Low”.
Note that there are no conversion coefficients for “LO2” setting for Bands 1, 2, and 3N in table 2-3. So if the gain setting is “LOW” for these three bands, the conversion coefficients for “LO1" have to be used.

@kyang2014
Copy link
Contributor

Landon, could you provide me the inputfilelist for this at roger?

@LandonTClipp
Copy link
Contributor Author

The input file list for ROGER:

/projects/TDataFus/fusionTesting/input/2013/input74612.txt

@LandonTClipp
Copy link
Contributor Author

I have changed the ASTER code so that any time cameras 1, 2, or 3N are found with a gain label of "LOW", it remaps this internally to the "LO1" label, as per what Dr. Zhao suggested. This seems to have fixed the problem.

Given that no other issues pop up, this should now give us >99% success rate for 2013 processing. I will submit another job to Blue Waters to test everything we have so far.

@kyang2014
Copy link
Contributor

landon, we are duplicating our work :)
I am going to check in the change and my change is simple. Could you revert your ASTER.c and I can check in my change?

@@ -1679,10 +1679,10 @@ short get_band_index(char *band_index_str)
short get_gain_stat(char *gain_stat_str)
{

  • const char *gain_stat_str_list[5] = {"HGH","NOR","LO1","LO2","OFF"};
  • const char *gain_stat_str_list[6] = {"HGH","NOR","LO1","LO2","OFF","LOW"};
    int ret_value = -1;
    int i = 0;
  • for(i= 0; i <5; i++)
  • for(i= 0; i <6; i++)
    {

    if(!strncmp(gain_stat_str,gain_stat_str_list[i],3))
    

@@ -1843,6 +1843,13 @@ int obtain_gain_index(int32 sd_id,short gain_index[15])
strncpy(gain_stat_str,tp,3);
temp_gain_index = get_gain_stat(gain_stat_str);

  •        // https://github.com/TerraFusion/basicFusion/issues/199
    
  •        // On page 13 of the ASTER 1T product specification
    
  •        // (https://lpdaac.usgs.gov/sites/default/files/public/product_documentation/aster_l1t_product_specification.pdf), you will see the gain markers for VNIR (Bands 1-3) are .HIGH., .NOR. or .LOW..
    
  •        // Since There is no Low Gain 2 for band 1-3B, the "LOW" must be "Low Gain 1". Change the index.
    
  •        if(temp_gain_index == 5)
    
  •            temp_gain_index = 2;
    
  •        gain[band_index] = temp_gain_index;
    
       }
    

@LandonTClipp
Copy link
Contributor Author

Okay I will revert my work. Please do not merge to master until I revert the change.

@LandonTClipp
Copy link
Contributor Author

Dr. Yang, go ahead and push your changes to this specific portion of ASTER to a development branch. I made other changes to ASTER, namely adding more robust error checks. I am afraid that if you try to push to master, you will run into conflicts. I will simply copy-paste your version of this bug-fix to ASTER.c

@LandonTClipp LandonTClipp reopened this Jul 6, 2017
kyang2014 added a commit that referenced this issue Jul 6, 2017
@kyang2014
Copy link
Contributor

Done with the branch temp_aster_fix. Note the ASTER.c is based on the version before you reverted. Please just add your error handling code/comments to this file and check it into the master. I've checked it with the ASTER files that have low with my version. The values look correct.

LandonTClipp pushed a commit that referenced this issue Jul 6, 2017
@LandonTClipp
Copy link
Contributor Author

Your changes have been successfully merged. I will begin the next round of BW tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants