Quick SeaWiFS l1bgen usage/calibration question

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
amsayer
Posts: 22
Joined: Tue Jan 25, 2011 3:03 pm America/New_York
Answers: 0

Quick SeaWiFS l1bgen usage/calibration question

by amsayer » Tue Mar 06, 2018 11:19 am America/New_York

Hi all,

I have a quick question about command-line usage of l1bgen from SeaDAS 7.4. My goal is to take L1a files and make L1b files using the latest available calibration coefficients, etc. Reading the documentation I was not 100% sure whether I need to specify the calibration files etc or whether just supplying the input/output filenames was sufficient, and the default calibration would be applied that way? It has been some years since I last used SeaDAS.

For example, I was invoking l1bgen like this:

l1bgen ifile=/data15/asayer/aac/seawifs_input/l1a/S1997259070828.L1A_GAC.x.hdf ofile=/data15/asayer/aac/seawifs_input/l1b/S1997259070828.L1B_GAC.x.hdf

The verbose output from running the code suggests it is reading in stuff so I assume this is the right way to do it, but like to double-check. :) Do I need to add additional arguments?

l1bgen ifile=/data15/asayer/aac/seawifs_input/l1a/S1997259070828.L1A_GAC.x.hdf ofile=/data15/asayer/aac/seawifs_input/l1b/S1997259070828.L1B_GAC.x.hdf
Input file /data15/asayer/aac/seawifs_input/l1a/S1997259070828.L1A_GAC.x.hdf is SeaWiFS Level-1A GAC.
Loading default parameters from /data3/asayer/seadas-7.4/ocssw/run/data/common/msl12_defaults.par
Loading default parameters for SeaWiFS from /data3/asayer/seadas-7.4/ocssw/run/data/seawifs/msl12_defaults.par
Loading default sub-sensor parameters for SeaWiFS from /data3/asayer/seadas-7.4/ocssw/run/data/seawifs/msl12_defaults_seawifs_gac.par
Loading parameters for suite OC from /data3/asayer/seadas-7.4/ocssw/run/data/seawifs/msl12_defaults_OC.par
Loading command line parameters

Loading user parameters for SeaWiFS

Loading characteristics for SeaWiFS
Opening sensor information file /data3/asayer/seadas-7.4/ocssw/run/data/seawifs/msl12_sensor_info.dat


As a related question, I understand that the vicarious calibration coefficients are not applied by l1bgen, and are instead applied at the l2 stage (from https://oceancolor.gsfc.nasa.gov/reprocessing/r2018/seawifs/). I am testing my own algorithms, so if I want to use the latest vicarious gains then I would need to apply those latest numbers from the table at that link myself. Is that right?

Thanks,

Andy

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

Quick SeaWiFS l1bgen usage/calibration question

by OB.DAAC - SeanBailey » Tue Mar 06, 2018 2:29 pm America/New_York

Andy,

For SeaWiFS, the only thing that changed with the most recent reprocessing was the vicarious calibration.  The calibration table is the same, and is also the default, so no need to specify it.
MODIS and VIIRS have separate L1B codes that have no knowledge of vicarious calibration, however, the l1bgen code you would use for SeaWiFS DOES apply the vicarious calibration.   
(it could also be used on MODIS and VIIRS L1B files, but making an L1B from and L1B is, well, a bit silly - unless you wanted a similar file format, or to apply the vicarious calibration).

To apply the updated vicarious calibration (until we release the next version of SeaDAS when the default will do so), you will need to pass l1bgen the following argument:
gain=[1.0014, 0.9925, 0.9820, 0.9864, 0.9948, 0.9698, 0.9580, 1.0]

If you were to then process these L1B files through l2gen, you'd want to set
gain=[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]

...or you could reverse the order and use unity gains for l1bgen and new gains for l2gen...we're flexible :wink:

Regards,
Sean

amsayer
Posts: 22
Joined: Tue Jan 25, 2011 3:03 pm America/New_York
Answers: 0

Quick SeaWiFS l1bgen usage/calibration question

by amsayer » Tue Mar 06, 2018 2:46 pm America/New_York

Thanks Sean, that is good to know! So to use the latest coefficients (until SeaDAS 7.5) my call looks like this:

l1bgen ifile=/data15/asayer/aac/seawifs_input/l1a/S1997259070828.L1A_GAC.x.hdf ofile=/data15/asayer/aac/seawifs_input/l1b/S1997259070828.L1B_GAC.x.h5 gain="[1.0014, 0.9925, 0.9820, 0.9864, 0.9948, 0.9698, 0.9580, 1.0]"


(without the "" it threw an error; with, it seems to work)

And I do not need to apply these gains later on.

On a semi-related question, I see my L1b files have certain l2_flags set. However as far as I can tell from looking at an orbit (and comparing to the code I used some years before), the land/sea mask (LAND) does not appear to be set. (In IDL, I do a check like is_land=where((l2_flags and 2) gt 0,nland)). Is that the case (i.e. is it set by l2gen), and if so is there any processing flag in l1bgen which will add in the land/sea mask? Looking at the description of the l2_flags SDS within the L1b file:

int l2_flags(number_of_lines=997, pixels_per_line=155);
  :flag_masks = 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824, -2147483648; // int
  :flag_meanings = "ATMFAIL LAND PRODWARN HIGLINT HILT HISATZEN COASTZ SPARE STRAYLIGHT CLDICE COCCOLITH TURBIDW HISOLZEN SPARE LOWLW CHLFAIL NAVWARN ABSAER SPARE MAXAERITER MODGLINT CHLWARN ATMWARN SPARE SEAICE NAVFAIL FILTER SPARE BOWTIEDEL HIPOL PRODFAIL SPARE";
  :valid_max = 2147483647; // int
  :long_name = "Level-2 Processing Flags";
  :valid_min = -2147483648; // int


Thanks,

Andy

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

Quick SeaWiFS l1bgen usage/calibration question

by OB SeaDAS - knowles » Wed Mar 07, 2018 8:08 am America/New_York

Hi Andy,

You are correct that you need quotes surrounding a command line option in order for it to be correctly parsed.   Sean's syntax is for a parameter file entry.  In this case your command would be:

l1bgen ifile=/data15/asayer/aac/seawifs_input/l1a/S1997259070828.L1A_GAC.x.hdf ofile=/data15/asayer/aac/seawifs_input/l1b/S1997259070828.L1B_GAC.x.h5 par=l1bgen.par

where l1bgen.par is a text file containing your name-value pair gain line and any other parameters.
gain=[1.0014, 0.9925, 0.9820, 0.9864, 0.9948, 0.9698, 0.9580, 1.0]

l2_flags are level-2 flags set by l2gen so there are not l2_flags in an level-1B file.  I'll let Sean or Don add in a note regarding whether there are any possible flag options in the level-1B files.

SeaDAS does have a Land mask tool which you can apply to a level-1B file from within the SeaDAS GUI.  The command line GPT version of this tool I believe works, but will be officially supported in SeaDAS 7.5 release.

Danny

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

Quick SeaWiFS l1bgen usage/calibration question

by OB.DAAC - SeanBailey » Wed Mar 07, 2018 8:49 am America/New_York

Andy,

l1bgen sets a very minimal set number of the l2_flags, specifically:
HILT, STRAYLIGHT, NAVFAIL, and NAVWARN
If you want a more complete set, you can use l2gen to generate a product very much like l1bgen's output.
So much so, that it *might* just work for any downstream processing you have with no modification.
...unless that downstream processing is l2gen, since it doesn't read it's own output as input.

l2gen ifile=<SeaWiFS L1A file> ofile=<SeaWiFS 'pseudo L1B' file> atmocor=0 l2prod=Lt_nnn,solz,sola,senz,sena

It'll take a little longer to run, as l2gen has a bit more up-front setup that ultimately isn't used in the L1B simulation.
...but not much longer :grin:

Sean

amsayer
Posts: 22
Joined: Tue Jan 25, 2011 3:03 pm America/New_York
Answers: 0

Quick SeaWiFS l1bgen usage/calibration question

by amsayer » Wed Mar 07, 2018 9:07 am America/New_York

Thanks, both of you. I appreciate the suggestions. In that case I'll give that a shot when SeaDAS 7.5 comes out. For the moment I can just pull the land mask from OCSSW (ocssw/run/data/common/landmask_GMT15ARC.nc) when I read in the L1b and use that directly to categorise pixels; I tested this morning and it turns out it only takes a few seconds.

Andy

Post Reply