Chlorophyll_a data retrieval

Please enter here to ask a question about any NASA Science related topics!
Post Reply
leon_c
Posts: 3
Joined: Fri Jun 04, 2021 1:28 pm America/New_York

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: 3
Joined: Fri Jun 04, 2021 1:28 pm America/New_York

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: 1195
Joined: Wed Sep 18, 2019 6:15 pm America/New_York

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/docs/t ... vol32_abs/
A more recent dissertation on the subject is here:
https://oceancolor.gsfc.nasa.gov/docs/format/l3bins/

Regards,
Sean

leon_c
Posts: 3
Joined: Fri Jun 04, 2021 1:28 pm America/New_York

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: 1195
Joined: Wed Sep 18, 2019 6:15 pm America/New_York

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

Post Reply