# The OCSSW Cookbook

Binning & Mapping
SST mapped image (VIIRS)

This set of examples uses l2bin and l3mapgen to create SST mapped images from source VIIRS level-2 files. Each example illustrates a different masking level.

Example 1: Best Quality qual_max=0 flaguse=LAND,HISOLZEN | Example 2: Science Quality qual_max=2 flaguse=LAND,HISOLZEN
Example 3: Imagery Quality (Higher Retrievals - DAY only) qual_max=3 flaguse=ATMFAIL,LAND,HISATZEN,CLDICE,NAVWARN, MAXAERITER,ATMWARN,HISOLZEN,NAVFAIL,HIGLINT | Example 4: No Quality Restrictions qual_max=3 flaguse=LAND,HISOLZEN

Example 1 Best Quality

Applies the highest degree of sst quality masking for best quality results (though lowest pixel retrieval count).

Command Line Entry

    l2bin ifile=V2015045190600.L2_SNPP_SST.nc ofile=V2015045190600.L3b_SST_BestQual_1km.nc par=l2bin_SST_BestQual.par

    l3mapgen ifile=V2015045190600.L3b_SST_BestQual_1km.nc ofile=V2015045190600.L3m_SST_BestQual_750m.nc par=l3mapgen.par

File = l2bin_SST_BestQual.par

    prodtype=regional
    resolution=1
    qual_prod=qual_sst
    qual_max=0
    l3bprod=sst
    flaguse=LAND,HISOLZEN

File = l3mapgen.par

    product=sst
    resolution=750
    interp=area
    oformat=netCDF4

Example 2 Science Quality

This is the standard masking level used for science quality results. There will be some blockiness of missing data caused by straylight and non-uniformity algorithms.

Command Line Entry

    l2bin ifile=V2015045190600.L2_SNPP_SST.nc ofile=V2015045190600.L3b_SST_StdQual_1km.nc par=l2bin_SST_StdQual.par

    l3mapgen ifile=V2015045190600.L3b_SST_StdQual_1km.nc ofile=V2015045190600.L3m_SST_StdQual_750m.nc par=l3mapgen.par

File = l2bin_SST_StdQual.par

    prodtype=regional
    resolution=1
    qual_prod=qual_sst
    qual_max=2
    l3bprod=sst
    flaguse=LAND,HISOLZEN

File = l3mapgen.par

    product=sst
    resolution=750
    interp=area
    oformat=netCDF4

Example 3 Imagery Quality (Higher Retrievals - DAY only)

This illustrates an approach for producing imagery with more sst pixels retrieved than when using the standard quality, and without all the blockiness of missing data caused by straylight and non-uniformity algorithms. This can only be done on daytime sst file because it uses many level2 flags which are only available from visible band daytime measurements.

Note: The naming "Imagery Quality" is not official, but just used here for illustrative purposes related to this set of cookbook examples.

Command Line Entry

    l2bin ifile=V2015045190600.L2_SNPP_SST.nc ofile=V2015045190600.L3b_SST_AvgQual_1km.nc par=l2bin_SST_AvgQual.par

    l3mapgen ifile=V2015045190600.L3b_SST_AvgQual_1km.nc ofile=V2015045190600.L3m_SST_AvgQual_750m.nc par=l3mapgen.par

File = l2bin_SST_AvgQual.par

    prodtype=regional
    resolution=1
    qual_prod=qual_sst
    qual_max=3
    l3bprod=sst
    flaguse=ATMFAIL,LAND,HISATZEN,CLDICE,NAVWARN,MAXAERITER,ATMWARN,HISOLZEN,NAVFAIL,HIGLINT

File = l3mapgen.par

    product=sst
    resolution=750
    interp=area
    oformat=netCDF4

Example 4 No Quality Restrictions

This is the lowest possible level of masking without including "really, really bad" data. You can expect clouds, ice and just about anything present to return a sst value, which may or may not have any valid temperature meaning.

Command Line Entry

    l2bin ifile=V2015045190600.L2_SNPP_SST.nc ofile=V2015045190600.L3b_SST_PoorQual_1km.nc par=l2bin_SST_PoorQual.par

    l3mapgen ifile=V2015045190600.L3b_SST_PoorQual_1km.nc ofile=V2015045190600.L3m_SST_PoorQual_750m.nc par=l3mapgen.par

File = l2bin_SST_PoorQual.par

    prodtype=regional
    resolution=1
    qual_prod=qual_sst
    qual_max=3
    l3bprod=sst
    flaguse=LAND,HISOLZEN

File = l3mapgen.par

    product=sst
    resolution=750
    interp=area
    oformat=netCDF4

NOTES

Resolution: With a goal of producing a 750m resolution mapped SST file, these examples bin at 1km resolution and then map at 750m resolution.
l2bin: In general you want to pick a bin resolution lower than the source resolution. This is because each source pixel gets put into precisely one bin. Consequently, having your bin resolution higher than your source resolution will likely result in a peppering of missing data. Alse, keep in mind that satellite specifications refer to nadir resolution so likely many of your source pixels are actually of a lower resolution than the nadir specification value.
l3mapgen: The mapping process differs from the strict rules of the binning process. When mapping, you can increase the resolution of the mapped image through an area interpolation process.

Defaults: Fields in some of these par files such as 'flaguse', and 'qual_prod' are being explicitly set with their default value so you are aware of the actual setting being used. You could also just not include these particular fields and they will get set with the default from the configurations your particular ocssw mission config directory.