Page 1 of 1

l2mapgen is not exporting pixel values correctly.

Posted: Tue May 07, 2019 1:31 pm America/New_York
by jvaldezch
Hi,

I'm using python for processing some L2 images in order to produce AFAI, the result is stored on L2 file and when using SeaDAS 7.5.1 data seems ok as you can see in the imagen below.



But when exporting to tiff using l2mapgen I only get pixels value of 0.0010000000474974513.

l2mapgen ifile=A2019111192000_L2_OC.nc ofile=A2019111192000_L2_OC_afai.tif prod=afai outmode=tiff flaguse=LAND,HILT,CLDICE,LOWLW stype=1

I'm using Python to create a new NetCDF variable as follow:

with nc.Dataset(filename_in, 'a', format='NETCDF4') as src:
    geo = src['geophysical_data']
    newVar = geo.createVariable('afai', 'f4', ('number_of_lines', 'pixels_per_line'), fill_value=vars[0]._FillValue)
    newVar.long_name = 'Alternative floating algae index'
    newVar.standard_name = 'afai'
    newVar.valid_min = -1.00000
    newVar.valid_max = 1.00000
    newVar.units = 'mg m^3'
    newVar[:] = afai_arr

l2mapgen is not exporting pixel values correctly.

Posted: Tue May 07, 2019 1:50 pm America/New_York
by OB.DAACx - SeanBailey
l2mapgen needs to know how to scale the data.  Since it's not one of the products it knows about (i.e. not in $OCDATAROOT/common/smigen_product_table.dat), you either need to add an entry to that file or provide the information on the command line:

   datamin (float) (default=0.0) = minimum value for data scaling
        (default see SMI product table)
   datamax (float) (default=0.0) = maximum value for data scaling
        (default see SMI product table)


Sean

l2mapgen is not exporting pixel values correctly.

Posted: Tue May 07, 2019 2:16 pm America/New_York
by jvaldezch
Thank you Sean, that solved my problem!