l2mapgen is not exporting pixel values correctly.

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
jvaldezch
Posts: 27
Joined: Fri Aug 24, 2018 2:52 pm America/New_York
Answers: 0

l2mapgen is not exporting pixel values correctly.

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

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

Tags:

OB.DAAC - SeanBailey
User Services
User Services
Posts: 1470
Joined: Wed Sep 18, 2019 6:15 pm America/New_York
Answers: 1
Been thanked: 5 times

l2mapgen is not exporting pixel values correctly.

by OB.DAAC - SeanBailey » Tue May 07, 2019 1:50 pm America/New_York

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

jvaldezch
Posts: 27
Joined: Fri Aug 24, 2018 2:52 pm America/New_York
Answers: 0

l2mapgen is not exporting pixel values correctly.

by jvaldezch » Tue May 07, 2019 2:16 pm America/New_York

Thank you Sean, that solved my problem!

Post Reply