Chlorophyll_a data retrieval

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
leon_c
Posts: 16
Joined: Fri Jun 04, 2021 1:28 pm America/New_York
Answers: 0
Has thanked: 2 times

Chlorophyll_a data retrieval

by leon_c » Fri Jun 04, 2021 1:37 pm America/New_York

Hello!

I have a question regarding downloading the data. Bear with me, I'm pretty new to this interface.

So, using the Level-3 Browser, I select the desired sensor, product, dates and extract the location.

However, if I download Binned file, once I open the .nc file in Python using xarray, I get a completely empty xarray.Dataset. If, on the other hand, I download Mapped file and repeat the proces in Python, I get chlor_a array of the desired shape (lat * lon), but all the data is nan (float 32)... I expected to have a float number for every pair of (lat,lon). Is this even how it's supposed to work?

Any tips and help would be much obliged! :)

Tags:

leon_c
Posts: 16
Joined: Fri Jun 04, 2021 1:28 pm America/New_York
Answers: 0
Has thanked: 2 times

Re: Chlorophyll_a data retrieval

by leon_c » Sun Jun 06, 2021 3:01 pm America/New_York

Figured it out. nan files was data over land, or missing data. Everything works fine. :)

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

Re: Chlorophyll_a data retrieval

by OB.DAAC - SeanBailey » Mon Jun 07, 2021 10:13 am America/New_York

Glad you figured it out :D

Just so you are aware, the bin files are not in a raster format. They can be read with Python, but a little bit of extra work is necessary to get to a recognizable image. There is an old, but still mostly relevant document on the binning process and format:
https://oceancolor.gsfc.nasa.gov/resources/docs/technical/seawifs_reports/prelaunch/vol32_abs/
A more recent dissertation on the subject is here:
https://oceancolor.gsfc.nasa.gov/resources/docs/format/l3bins/

Regards,
Sean

leon_c
Posts: 16
Joined: Fri Jun 04, 2021 1:28 pm America/New_York
Answers: 0
Has thanked: 2 times

Re: Chlorophyll_a data retrieval

by leon_c » Mon Jun 07, 2021 11:23 am America/New_York

Thanks for your reply! I will look into it.

But the thing that worries me is, when the bin file is opened in Python using xarray, I get the result posted in the images. It's almost as if the file is "empty", but it's not.
Attachments
thumbnail_Screenshot from 2021-06-07 14-34-00.png
thumbnail_Screenshot from 2021-06-07 14-34-00.png (120.94 KiB) Not viewed yet
Screenshot from 2021-06-07 14-34-00.png
Screenshot from 2021-06-07 14-34-00.png (132.52 KiB) Not viewed yet

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

Re: Chlorophyll_a data retrieval

by OB.DAAC - SeanBailey » Tue Jun 08, 2021 9:06 am America/New_York

Well, xarray is great for multi-dimensional array data, not so keen on the single dimensional compound data structure of the bin files. It can be read with Python and the netCDF4 module, but xarray probably can't interpret it out of the box. Here's what's contained in a typical bin file:

Code: Select all

group: level-3_binned_data {
  types:
    compound binListType {
      uint bin_num ;
      short nobs ;
      short nscenes ;
      float weights ;
      float time_rec ;
    }; // binListType
    compound binDataType {
      float sum ;
      float sum_squared ;
    }; // binDataType
    compound binIndexType {
      uint start_num ;
      uint begin ;
      uint extent ;
      uint max ;
    }; // binIndexType
  dimensions:
  	binListDim = UNLIMITED ; // (318168 currently)
  	binDataDim = UNLIMITED ; // (318168 currently)
  	binIndexDim = UNLIMITED ; // (8640 currently)
  variables:
  	binListType BinList(binListDim) ;
  	binDataType chlor_a(binDataDim) ;
  	binIndexType BinIndex(binIndexDim) ;
  } // group level-3_binned_data
Some math is involved to convert the sum and the sum of squares into a mean value. More is required to identify where on the planet a bin is located given the bin index...

Sean

dominichr1
Posts: 1
Joined: Mon Oct 30, 2023 3:24 pm America/New_York
Answers: 0

Re: Chlorophyll_a data retrieval

by dominichr1 » Mon Oct 30, 2023 3:25 pm America/New_York

Did anyone find a way to read these binned files using xarray?

ds = xr.open_dataset(files[2], group="level-3_binned_data")

gnwiii
Posts: 713
Joined: Fri Jan 29, 2021 5:51 pm America/New_York
Answers: 2
Has thanked: 1 time

Re: Chlorophyll_a data retrieval

by gnwiii » Thu Nov 02, 2023 3:43 pm America/New_York

As this thread shows, writing software to work with binned data is a nontrivial project. You will need SeaDAS to validate any new implementation, so most people just use tools available in SeaDAS.

Post Reply