HDF-EOS V2 MODIS daily L3 1km Surface Reflectance Aggregation Product
SCF Revision 5.1.1, July 2005, by K. Didan


Product ID(s): MODAGAGG L3 daily 

Description:
	MODIS Level 3 1km Land Surface Reflectance Aggregation (SRAGG) - The L3
	SRAGG product contains surface reflectance at 1km resolution for bands
	1 - 7. Multiple observations at any 250m or 500m grid cells read from 
	L2G input files are first aggregated (only good observations are used)
	to produce a single reflectance value (for each band) for the grid by 
	computing weighted average of the observations. Observations are 
	weighted by the observation coverage. Observations from different 
	orbits are aggregated separately. All 250m or 500m observations that 
	fall into a 1km grid cell are then averaged to give the aggregated 
	reflectance value for that 1km grid.

	Depending on the number of orbits present in the input L2G, for each
	1km grid cell there will be one or more aggregated output. An aggregated
	output observation for a 1km grid cell in the output tile contains four
	angles (viewing and solar angles), seven reflectance values (bands 1-7),
	seven band qa (bands 1-7) and a 1km state QA. For each pixel a maximum 
	of four aggregateed observations (from four different orbits) are 
	output. The observation that is closest to the nadir view is stored as
	the first observation. Whenever more than one output observation is 
	present observations with diverse viewing geometry are selected for
	output.
	
	For pratical reasons, the Aggregation process will omitt all reflectances 
	below -100, emanating from the atmospheric correction process. Hence, all
	surface reflectances will be within range -100 to 16000. Moreover, aggregation 
	takes place only on SHALLOW_OCEAN, LAND, OCEAN_COASTLINES, SHALLOW_INLAND_WATER, 
	EPHEMERAL_WATER pixels only. 
	
	The algorithm also implements a disk saving feature, where the number of output orbits 
	will depend on the latitude (Run time flag), with a maximum of 4 output orbits.  

	
Point of Contact:
	Kamel Didan
	Terrestrial Biophysics & Remote Sensing.
	1110 E. South Campus Drive, FCR Bldg#33, Room 313
	University of Arizona, 
	Tucson, AZ 85721
  (520) 621-8514
	kamel@ag.arizona.edu 

Principal Investigator(s):
	Chris Justice 
	Univeristy of Maryland, College Park
  NASA's Goddard Space Flight Center, Code 923
  Greenbelt, MD 20771
  (301) 286-7372
  justice@kratmos.gsfc.nasa.gov

===========================================================================

Generic Constructs

ECS Metadata Strings:

   Notes:
      1. "FR" is an abbreviation for "FREE_RANGE".
      2. "D/T" is an abbreviation for "DATE/TIME"
      3. (A) means that multiple values are stored within a single array.
      4. A value of "Variable" indicates that this value will vary
         according to the granule being processed.
      5. "M" means class M.
      6. (C) means that multiple values are stored as class members.

CoreMetadata.0
    This string will contain the following PVL fields:
                                                     #
        Field Name                        Data      of   Value
                                          Type    Values
  GROUP = INVENTORYMETADATA
    GROUP = CollectionDescriptionClass
        SHORTNAME                         STRING     1   "MODAGAGG"
        VERSIONID                         INTEGER/ST 1   variable
    END_GROUP = CollectionDescriptionClass

    GROUP = ECSDataGranule
        SIZEMBECSDATAGRANULE              DOUBLE     1   Variable
        REPROCESSINGPLANNED               STRING     1   "no further update anticipated"
        REPROCESSINGACTUAL                STRING     1   "processed once"
        LOCALGRANULEID                    STRING     1   Variable
        DAYNIGHTFLAG                      STIRNG     1   Variable
        PRODUCTIONDATETIME                D/T        1   Variable
    END_GROUP = ECSDataGranule

    GROUP = PGEVersionClass
        PGEVERSION                        STRING     1   "2"
    END_GROUP = PGEVersionClass

    GROUP = InputGranule
        INPUTPOINTER                      STRING   FR(A) Variable
    END_GROUP = InputGranule

    GROUP = RangeDateTime
        RANGEBEGINNINGDATE                DATE       1   Variable
        RANGEBEGINNINGTIME                TIME       1   Variable
        RANGEENDINGDATE                   DATE       1   Variable
        RANGEENDINGTIME                   TIME       1   Variable
    END_GROUP = RangeDateTime

    GROUP = SpatialDomainContainer
      GROUP = HorizontalSpatialDomainContainer
        GROUP = GPolygon
          GROUP = GRing
              EXCLUSIONGRINGFLAG          STRING     1   "N"
          END_GROUP = GRing

          GROUP = GRingPoint
              GRINGPOINTLATITUDE          DOUBLE   4(A)  Variable
              GRINGPOINTLONGITUDE         DOUBLE   4(A)  Variable
              GRINGPOINTSEQUENCENO        INTEGER  4(A)  Variable
          END_GROUP = GRingPoint
        END_GROUP = GPolygon
      END_GROUP = HorizontalSpatialDomainContainer
    END_GROUP = SpatialDomainContainer

    GROUP = OrbitCalculatedSpatialDomain
        ORBITNUMBER                       INTEGER  FR(C) Variable
        EQUATORCROSSINGLONGITUDE          DOUBLE   FR(C) Variable
        EQUATORCROSSINGDATE               DATE     FR(C) Variable
        EQUATORCROSSINGTIME               TIME     FR(C) Variable
    END_GROUP = OrbitCalculatedSpatialDomain


    GROUP = MeasuredParameter
        PARAMETERNAME                     STRING     1   "Surface_Refl"

        GROUP = QAFlags
            AUTOMATICQUALITYFLAG          STRING     1    Variable
            AUTOMATICQUALITYFLAGEXPLANATION
                                          STRING     1    Variable
            OPERATIONALQUALITYFLAG        STRING     1    variable
            OPERATIONALQUALITYFLAGEXPLANATION
                                          STRING     1    Variable
            SCIENCEQUALITYFLAG            STRING     1    variable
            SCIENCEQUALITYFLAGEXPLANATION STRING     1    Variable
        END_GROUP = QAFlags

        GROUP = QAStats
            QAPERCENTINTERPOLATEDDATA      INTEGER    1   Variable
            QAPERCENTMISSINGDATA           INTEGER    1   Variable
            QAPERCENTOUTOFBOUNDSDATA       INTEGER    1   Variable
        END_GROUP = QAStats
    ENDGROUP = MeasuredParameter

    GROUP = AdditionalAttributes
        ADDITIONALATTRIBUTENAME          STRING   FR(C) Variable
        PARAMETERVALUE                   STRING   FR(C) Variable

        ADDITIONALATTRIBUTENAME.1  = QAPERCENTGOODQUALITY
        ADDITIONALATTRIBUTENAME.2  = QAPERCENTOTHERQUALITY
        ADDITIONALATTRIBUTENAME.3  = QAPERCENTNOTPRODUCEDCLOUD
        ADDITIONALATTRIBUTENAME.4  = QAPERCENTNOTPRODUCEDOTHER
        ADDITIONALATTRIBUTENAME.5  = HORIZONTALTILENUMBER
        ADDITIONALATTRIBUTENAME.6  = VERTICALTILENUMBER
				ADDITIONALATTRIBUTENAME.7  = Tile_ID
				ADDITIONALATTRIBUTENAME.7	 = INPUTFILESRESOLUTION

    END_GROUP = AdditionalAttributes

    GROUP = AssociatedPlatformInstrumentSensor
        ASSOCIATEDINSTRUMENTSHORTNAME              STRING     1   "MODIS"
        ASSOCIATEDPLATFORMSHORTNAME                STRING     1   "Teraa"/"Aqua"
        ASSOCIATEDSENSORSHORTNAME                  STRING     1   "MODIS"
    END_GROUP = SensorCharacteristic

  ENDGROUP = INVENTORYMETADATA

ProductMetadata.0

    This string will contain the following PVL fields:

                                                     #
        Field Name                        Data      of   Value
                                          Type     Valu
                                                    es
GROUP = ARCHIVEDMETADATA

    GROUP = BoundingRectangle
        NORTHBOUNDINGCOORDINATE           DOUBLE     1   Variable
        SOUTHBOUNDINGCOORDINATE           DOUBLE     1   Variable
        EASTBOUNDINGCOORDINATE            DOUBLE     1   Variable
        WESTBOUNDINGCOORDINATE            DOUBLE     1   Variable
    END_GROUP = BoundingRectangle


    ALGORITHMPACKAGEACCEPTANCEDATE        STRING     1   "2004-10-01"
    ALGORITHMPACKAGEMATURITYCODE          STRING     1   "Normal"
    ALGORITHMPACKAGENAME                  STRING     1   "MODPRAGG"
    ALGORITHMPACKAGEVERSION               STRING     1   "5"
    GEOANYABNORMAL                        STRING     1   Variable
    GEOESTMAXRMSERROR                     DOUBLE     1   Variable
    LONGNAME                              STRING     1  "MODIS 1km Aggregated Surface Reflectance"
    PROCESSINGCENTER                      STRING     1   "MODAPS"
    SYSTEMFILENAME                        STRING     1   Variable
    NUMBEROFGRANULES                      INTEGER    1   Variable
    GRANULEDAYNIGHTFLAG                   STRING   FR(A) Variable
    GRANULEBEGINNINGDATETIME              D/T      FR(A) Variable
    GRANULEENDINGDATETIME                 D/T      FR(A) Variable
    NUMBEROFORBITS                        INTEGER    1   Variable
    CHARACTERISTICBINANGULARSIZE          DOUBLE     1   Variable
    CHARACTERISTICBINSIZE                 DOUBLE     1   Variable
    DATACOLUMNS                           INTEGER    1   Variable
    DATAROWS                              INTEGER    1   Variable
    GLOBALGRIDCOLUMNS                     INTEGER    1   Variable
    GLOBALGRIDROWS                        INTEGER    1   Variable
    NADIRDATARESOLUTION                   STRING     1   "1km"
    REDUCEDVOLUME                  				STRING     1   "YES or NO"
    MAXIMUMNUMLAYERS                  		INTEGER    1   Variable
    MAXIMUMOBSERVATIONS			              INTEGER    1   Variable
    COVERAGECALCULATIONMETHOD		          STRING     1   "area"
    SPSOPARAMETERS			                  STRING     1   "2015"
	  DESCRrevision                         STRING     1    Variable
    ProductionHistory                     STRING     1    Variable


ENDGROUP = ARCHIVEDMETADATA

StructuralMetadata.0
    This string will be populated automatically by HDF-EOS.

Grid Structure: MOD_Grid_Aggregation

    Data Fields:
	Angles, Surface_Refl, Band_QC, Aggregate_QC.

    Dimensions:

	Dimension 	Dimension Name			Value
	
	Dimension_0     YDim:MOD_Grid_Aggregation	"DataRows"
	Dimension_1	XDim:MOD_Grid_Aggregation	"DataColumns"
	Dimension_2	Num_Obs_Max		 	"Num_Obs_Max"	
	Dimension_3	Num_Angles			"Num_Angles"
	Dimension_4	Num_Land_Bands		"Num_Land_Bands"	
	Dimension_5	Num_Band_QC			"Num_Band_QC"	
	Dimension_6	Num_Aggregate_QC	"Num_Aggregated_QC"

    Corner Locations:

        Corner                Values

        UpperLeftPointMtrs    (Variable, Variable)

        LowerRightPointMtrs   (Variable, Variable)

    Geographic Grid Projection Parameters:

        Integrized Sinusoidal Projection
            Projection        GCTP_ISINUS
            ProjParam[0]          6371007.181
            ProjParam[1 to 7]     0.0
            ProjParam[8]          21600
            ProjParam[9]          0.0
            ProjParam[10]         1.0
            ProjParam[11 to 12]   0.0
            Spherecode            -1
            GridOrigin            HDFE_GD_UL

        Interrupted Goodes Homolosine Projection
            Projection            GCTP_GOOD
            ProjParam[0 to 12]    0.0
            Spherecode            19
            GridOrigin            HDFE_GD_UL

        Lambert Azimuthal Equal Area Projection
            Projection            GCTP_LAMAZ
            ProjParam[0]          6371228.0
            ProjParam[1 to 5]     0.0
            ProjParam[6]          Variable
            ProjParam[7 to 12]    0.0
            Spherecode            19
            GridOrigin            HDFE_GD_UL

===========================================================================

Description of SDS Data Fields
-------------------------------

Data Field_1
------------

	Data Field Name: Angles

	Description: Viewing and illumination angles
		Note:
		Num_Angles #1 view zenith angle
		Num_Angles #2 view azimuth angle
		Num_Angles #3 solar zenith angle
		Num_Angles #4 solar azimuthh angle

	Type: HDF-int16

	Dimensions:

		Dimension Name		Value

		YDim			DataRows
		XDim			DataColumns
		Num_Obs_Max		"Num_Obs_Max"
		Num_Angles		"Num_Angles"
		
	HDF Attributes:

                                  Number of
                                  Values or
                                    Max.
        Attribute        Data      String    Value
                         Type      Length

        long_name        STRING      19      "View and Sun Angles" 
        units            STRING      8       degrees 
        valid_range      INT16       2       -18000 18000 
        _FillValue       INT16       1       -32767
				Num_Obs_Max	 			INT8       1	     Variale (1,2,3, or 4)
				Num_Angles	 			INT8       1	     4 
        scale_factor     FLOAT64     1       0.01 
        add_offset       FLOAT64     1       0.0
        scale_factor_err FLOAT64     1       0.0
        add_offset_err   FLOAT64     1       0.0
        calibrated_nt    INT32       1       5

Data Field_2
------------

        Data Field Name: Surface_Refl 

        Description: Surface Reflectance in bands 1-7 

        Type: HDF-int16

        Dimensions:

                Dimension Name          Value

                YDim                    DataRows
                XDim                    DataColumns
                Num_Obs_Max             "Num_Obs_Max"           
                Num_Land_Bands          "Num_Land_Bands"            

        HDF Attributes:

                                  Number of
                                  Values or
                                    Max.
        Attribute        Data      String    Value
                         Type      Length

        long_name        STRING      19      "Surface Reflectance"
        units            STRING      11      reflectance 
        valid_range      INT16       2       -100, 16000 
        _FillValue       INT16       1       -1000
					Num_Obs_Max	 	 INT8        1	     Variale (1,2,3, or 4)
        Num_Land_Bands   INT8        1       7
        scale_factor     FLOAT64     1       0.0001 
        add_offset       FLOAT64     1       0.0
        scale_factor_err FLOAT64     1       0.0
        add_offset_err   FLOAT64     1       0.0
        calibrated_nt    INT32       1       5

Data Field_3
------------

        Data Field Name: Band_QC

        Description: QC in bands 1-7  

		Bits 0-1: Modland QA bits
		  key:	00: Product produced at ideal quality
			01: Product produced, less than ideal quality.
			10: Product not produced due to cloud effects.
			    
          - See Notes Below
			11: Product not produced for other reason
		Bits 2-5: Atmospheric Quality Flags
              Dead Dectector flag superceeds other cases.
              So a dead dectector flag does not exclude cases 9,10,11, and 12.
		  key:	0000: Highest Quality
      0110: (6)  dead detector; Less than 50% data has been copied from adjacent detector
      0111: (7)  dead detector; More that 50% data has been copied from adjacent detector
      1000: (8)  dead detector; (100%) All data has been copied from adjacent detector
		  1001: (9)  solar zenith >= 85 degrees
			1010: (10) solar zenith >= 75 and < 85 degrees
	  	1011: (11) missing input
			1100: (12) Internal constants used in place of climatology
			1101: (13) Quality so low that it is not useful
			1110: (14) L1B data faulty
			1111: (15) not useful for any other reason/not processed
		Bits 6-7: Geospatial Quality
		  key:	00: 25% or less of the finer resolution data contribued
			    to this 1km pixel
			01: 50% "
			10: 75% "
			11: 100% "

        Type: HDF-uint8

        Dimensions:

                Dimension Name          Value

                YDim                    DataRows
                XDim                    DataColumns
                Num_Obs_Max             "Num_Obs_Max"
                Num_Band_QC             "Num_Band_QC"

        HDF Attributes:

                                  Number of
                                  Values or
                                    Max.
        Attribute        Data      String    Value
                         Type      Length

        long_name        STRING      7       "Band QC"
        units            STRING      13      class or flag 
        valid_range      INT16       2       0, 254 
        _FillValue       INT16       1       255 
        Num_Obs_Max      INT8        1       Variale (1,2,3, or 4)
        Num_Band_QC      INT8        1       7

Data Field_4
------------

        Data Field Name: Aggregate_QC 

        Description: Quality of the aggregate 1km Observations
	Bits	0-1:   Cloud State; clear (00), cloudy (01)
			    mixed (10), not set, assumed clear (11)
		    2  :   Cloud shadow; yes (1) or no (0)
		    3-5:   Land/water Flag;
			    000 Shallow ocean
			    001 Land (Nothing else but land)
			    010 Ocean coastlines and lake shorelines
			    011 Shallow inland water
			    100 Ephemeral water
			    101 Deep inland water
			    110 Moderate or continental ocean
			    111 Deep ocean
		    6-7:   Aerosol quantity; climatology (00), low (01)
			    average (10), high (11)
		    8-9:   Cirrus detected; none (00), small (01), 
			    average (10), high (11)
				10 : internal cloud mask; cloudy (1) or clear (0)
				11 : internal fire mask; fire (1) or no fire (0) 
	     	12 : Snow/ice flag; yes (1) or no (0)
     		13 : Pixel is adjacent to cloud: (1) : YES or (0) : NO
	     	14 : BRDF correction performed : (1) : YES or (0) : NO
				15 : internal snow mask; snow (1) or no snow (0)

---- Note ---------------------------------------------------------------
Bits [10],[11] and [15] use to contain the following QA flags.  Replaced
since Nov., 2001 production

		     10 :   Water vapor data source; MOD05 (1) or climatology (0) (DAO or OORT)
		     11 :   Ozone data source; MOD07 (1) or climatology (0) (DAO or London)
		     15 :   Adjacent cloud detected; yes (1) or no (0) 
				 
Filed [13-14] was modified starting Collection 5.0. It is now broken into 
two separate fields as (See above):  It use to contain :
		    13-14: BRDF correction performed; no (00), Montana
			    methodology (01), Boston methodology (10)
-------------------------------------------------------------------------

        Type: HDF-uint16

        Dimensions:

                Dimension Name          Value

                YDim                    DataRows
                XDim                    DataColumns
                Num_Obs_Max             "Num_Obs_Max"
                Num_Aggregate_QC        "Num_Aggregate_QC"

        HDF Attributes:

                                  Number of
                                  Values or
                                    Max.
        Attribute        Data      String    Value
                         Type      Length

        long_name        STRING      14      "Aggregate QC"
        units            STRING      5       class 
        valid_range      INT16       2       0, 65534 
        _FillValue       INT16       1       65535 
        Num_Obs_Max      INT8        1       4
        Num_Aggregate_QC INT8        1       1

NOTE: Janaury/2001 by Kamel Didan
------------------------------
  A fix was implemented to properly compute the TEXTURE data. Right now
	the code will compute the std-dec/mean for the band 1.  It was not doing so before!
	More filters are applied, to properly interpret MOD09 quality bits.


NOTE 1: June 12/2000 by Kamel Didan
------------------------------------
 This is a MODLAND-wide decision stemming from the fact that
  outputing "mediocre/cloudy" data is better than FILL data.
  For at least the user will find (by inspecting the data) the
  reasons why it was labeled as such.  This will also allow the
  generation of complete tiles, as opposed to tiles with holes of
  missing data in them (Compare results from tiles prior and post 
  DOY 077/2000).

				
NOTE 2: July/1999 by Kamel Didan
------------------------------
  The actual "Aggregate_QC" FILL VALUE is not 65535, it is a dynamic
	FILL VALUE that is adjusted by the Land-Water mask.  To be useful for any
	comparison the user should mask the Land-Water field and then compare
	to 65535 to realize wether it is FILL or not.  This was done to convey 
	the correct Land-Water mask even when data was not present or bad.
NOTE 3: Deember/1999 by Kamel Didan
------------------------------
  Minute adjustment to some Metadata VALIDS