Flags and Reprojected files

Please enter here to ask a question about any NASA Science related topics!
avmehta
Posts: 148
Joined: Mon Feb 03, 2020 10:27 am America/New_York

Flags and Reprojected files

by avmehta » Sat Oct 17, 2020 3:53 pm America/New_York

Hello,
      I have been processing L1 to L2 using l2gen. One of the  output OLCI L2 files has the following flag statistics (I believe it in % of pixels with each flag value in the image):

ATMFAIL      0.0000
LAND      72.8164
PRODWARN      0.00000
HIGLINT      0.00000
HILT      0.00000
HISATZEN      0.00000
COASTZ      26.6807
SPARE      0.00000
STRAYLIGHT      0.00000
CLDICE      49.3987
COCCOLITH     0.445776
TURBIDW      2.25399
HISOLZEN      0.00000
LOWLW      0.00000
CHLFAIL      0.00000
NAVWARN      0.00000
ABSAER      0.00000
MAXAERITER      0.00000
MODGLINT      18.2133
CHLWARN      0.00000
ATMWARN      0.00000
SEAICE      0.00000
NAVFAIL      0.00000
FILTER      0.00000
BOWTIEDEL      0.00000
HIPOL      0.00000
PRODFAIL      0.00000

But when I reproject the  file (using gpt.sh), all of the above flag values are -119! This is true for all reprojected images. Am I doing something wrong?
Thank you.
Amita

Tags:

gnwiii
Posts: 606
Joined: Fri Jan 29, 2021 5:51 pm America/New_York
Answers: 1

Flags and Reprojected files

by gnwiii » Sat Oct 17, 2020 5:31 pm America/New_York

Depending on the method used, reprojection can mix data from more than one pixel, so you end up mixing "good" data with "bad" data.   For this reason, flags are normally used to mask "bad" data and reprojection is done only for "good" pixels.   Examples are provided in GPT Cookbook: Reproject

OB SeaDAS - knowles
Subject Matter Expert
Subject Matter Expert
Posts: 221
Joined: Mon Apr 07, 2008 4:40 pm America/New_York

Flags and Reprojected files

by OB SeaDAS - knowles » Mon Oct 19, 2020 9:34 am America/New_York

You can apply the flag masks using the original unprojected flag by setting the following field within the Reproject operator:
<maskExpression>${maskExpression}</maskExpression>

The flags themselves should not be reprojected as they really have no meaning since they are tied to multiple unprojected pixels.

avmehta
Posts: 148
Joined: Mon Feb 03, 2020 10:27 am America/New_York

Flags and Reprojected files

by avmehta » Mon Oct 19, 2020 9:49 am America/New_York

Thanks for the reply.
I understand that reprojection would 'mix' pixels and can affect l2flags. But in reprojected files also l2flag array looks fine. It is the flag_percentages that are not correct in reprojected files. This is what I find in OLCI L2 files. 
When I checked the same in MODIS L2 files, I find that unprojected L2 file has flag_percentages but they are not written out in reprojected files. I am trying to find out  whether flag_percentages in reprojected files should be even looked at.
Thanks again.
Amita

avmehta
Posts: 148
Joined: Mon Feb 03, 2020 10:27 am America/New_York

Flags and Reprojected files

by avmehta » Mon Oct 19, 2020 10:43 pm America/New_York

Yes, I thought that reprojection of flags would no make sense - but thanks you so much confirming,  Danny.
Amita

avmehta
Posts: 148
Joined: Mon Feb 03, 2020 10:27 am America/New_York

Flags and Reprojected files

by avmehta » Tue Oct 20, 2020 2:31 pm America/New_York

Hello,
   In my l2gen caluclations for L1 to L2 conversion of OLCI image I am setting cloudmask=0 as we want to decide our own threshold for clouds. But in my l2flag array I still see pixels are flagged with CLDICE! Is there anything else I have to specify or turnoff in l2gen inout parameters?
Thanks.
Amita

OB.DAAC - SeanBailey
User Services
User Services
Posts: 1168
Joined: Wed Sep 18, 2019 6:15 pm America/New_York

Flags and Reprojected files

by OB.DAAC - SeanBailey » Tue Oct 20, 2020 2:40 pm America/New_York

The option I assume you meant was maskcloud=0.  All that does is tell l2gen to continue processing a pixel it has deemed to be a cloud.  The flag will still be set, since it determined a cloud was present.  It's just a flag now that you set maskcloud=0.  You can ignore it.

Sean

avmehta
Posts: 148
Joined: Mon Feb 03, 2020 10:27 am America/New_York

Flags and Reprojected files

by avmehta » Tue Oct 20, 2020 2:46 pm America/New_York

Thanks you Sean.
Amita

avmehta
Posts: 148
Joined: Mon Feb 03, 2020 10:27 am America/New_York

Flags and Reprojected files

by avmehta » Fri Oct 23, 2020 2:26 pm America/New_York

Hello,
    When I reproject OLCI L2 files I find that in some cases original L2 files look fine but reprojected files are  NaN over water at most locations!
I use geographic reprojection  and bilinear resampling. I got the par file  and xml file from gpt Cookbook website:

pixelSize=0.003
resampling=Bilinear
maskExpression=!l2_flags.HIGLINT and !l2_flags.HISATZEN and !l2_flags.LOWLW and !l2_flags.HILT
transferValidPixelExpression=true

applyValidPixelExpression=true

I changed pixelsize for OLCI
Kept the  maskExpression at default.

I am really confused about what happens during reprojection.
[img]S3A_OLCI_20160706T154459_rhos_490.png[/img]
[img]S3A_OLCI_20160706T154459_reproj_rhos_490.png[/img]


OB.DAAC - SeanBailey
User Services
User Services
Posts: 1168
Joined: Wed Sep 18, 2019 6:15 pm America/New_York

Flags and Reprojected files

by OB.DAAC - SeanBailey » Fri Oct 23, 2020 4:06 pm America/New_York

What flags are set in the L2 file?  You're telling the reprojection tool to exclude these HIGLINT, HISATZEN, LOWLW and HILT
maskExpression=!l2_flags.HIGLINT and !l2_flags.HISATZEN and !l2_flags.LOWLW and !l2_flags.HILT


HISATZEN and HILT probably aren't set, but HIGLINT and LOWLW very well may be.

Post Reply