Hi Barry,
As you suspect, I believe the mk_matchup.py script has just what you need. That script was designed to operate on
SeaBASS files, but those type of files are simply ASCII files with meta-data headers that start with a "/" followed by a delimited data matrix.
I envision you could construct a psuedo-SeaBASS file (having a reduced set of headers, only the required ones for parsing) with the following contents:
/begin_header
/missing=-999
/delimiter=comma
/fields=year,month,day,hour,minute,second,lat,lon
/end_header
2018,11,5,13,45,32,46.34,-9.49
...
You would then define one row per station you desire to extract MODIS/SeaWiFS/VIIRS/etc data for, and save that file as a plain text file.
Note, there are a number of ways to represent time with
SeaBASS fields: date/time, year/month/day/hour/minute/second, year/month/day/time, date/hour/minute/second, date_time, year/sdy/hour/minute/second, or year/sdy/time, all in GMT and each with a specific data format. But fundamentally, all you need are date, time, latitude, and longitude information.
Once you have your pseudo-SeaBASS file with your
n station targets as separate rows, you would then call the
mk_matchup.py Python3.x script, which is distributed with the OCSSW build inside SeaDAS7.x, like so:
> mk_matchup.py --sat_file <L2_fname1.nc> [<L2_fname2.nc> ...] --seabass_file <your_pseudo-SeaBASS_fname.txt>
The mk_matchup.py script applies the default
exclusion criteria (5x5 satellite extract, L2flag filters, etc) of Bailey & Werdell (2006), but these are also customizable using command line options. Call mk_matchup.py with the -h or --help options to explore these in detail.
Note, that you can pass in multiple L2 satellite files via the command line argument --sat_file, simply separate the paths to the files by a space. The same is also true for --seabass_file should you need to run this command on multiple psuedo-SeaBASS files.
The mk_matchup.py script will append the L2 satellite data as additional columns to your pseudo-SeaBASS (comma-delimited, text) file, including the filtered mean and stdev, as well as L2 file identification information.
Once you have all that information appended into your pseudo-SeaBASS file, you may use any one of our
SeaBASS file readers (Python, Perl, Matlab) to interact with the data, or simply open the file with a text editor or spreadsheet program.
Note, the
Python SeaBASS reader (SB_support.py and its readSB class) is included in the OCSSW build within SeaDAS already.
I do admit this might be a bit of a change to your prior workflow, but I believe this will still get you the functionality you desire.
Please reply to this forum post, should you have any questions.
Cheers,
Joel
Ref: Bailey, S.W., and Werdell, P.J. (2006). A multi-sensor approach for the on-orbit validation of ocean color satellite data products. Rem. Sens. Environ. 102, 12-23.