Bin numbers to lat lon

Please enter here to ask a question about any NASA Science related topics!
Post Reply
schckngs
Posts: 21
Joined: Wed Feb 03, 2021 1:43 pm America/New_York

Bin numbers to lat lon

by schckngs » Tue Mar 23, 2021 4:35 pm America/New_York

Hi ocean colour folks,

I'm making daily composites of chlor_a at 1km resolution by running l2bin on MODIS-Aqua level-2 files. Then I'm using R to open the binned files and analyze further.

1) I can't convince l3bindump to do my bidding so far - it will produce an empty text file, though mapping the file I see it has data. I haven't found examples to see what I'm doing wrong. E.g.
l3bindump ifile=A2003151.L3b_DAY_CHLOR_A.nc ofile=test.txt oformat=txt verbose=1 l3bprod=chlor_a

Output file contents:
chlor_a chlor_a
bin centerlat centerlon north south west east n N sum sum_squared weight mean stdev
------- --------- ---------- --------- --------- ---------- ---------- ---- --- --------------- --------------- --------------- ---------- ----------
! Input file: A2003151.L3b_DAY_CHLOR_A.nc
! Number of Rows: 17280


2) Is there anything wrong with making a look-up table to use for matching bin number to lat lon? This is easier for me than using l3bindump. Or does this already exist and I can't find it?

Thanks, cheers,
Andrea

Tags:

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

Re: Bin numbers to lat lon

by OB.DAAC - SeanBailey » Tue Mar 23, 2021 4:53 pm America/New_York

Andrea,

l3bindump needs a bit more information from you:
There are 3 use cases:
1) bin_number
2) region defined by lat, lon, and radius (in km)
3) region defined by north, south, west, east

So, if you know the bin_number you're interested in, add bin_number=<the number> to your call...but that's not likely :D

If you have a lat/lon region defined by north, south, west, east then add: north=<N> south=<S> east=<E> west=<W>

Or if you just want values in a radius around a point, add: lat=<latitude> lon=<longitude> radius=<radius of circle in km)

You *could* create a look-up table for bin number to lat/lon, but it would be rather large. At the 4.6km resolution of most of our bin files, there are over 23 million bins...
https://oceancolor.gsfc.nasa.gov/docs/format/l3bins/

Sean

schckngs
Posts: 21
Joined: Wed Feb 03, 2021 1:43 pm America/New_York

Re: Bin numbers to lat lon

by schckngs » Tue Mar 23, 2021 5:45 pm America/New_York

Thank you Sean, and for your fast reply.

From the way it is written the use cases were not clear to me how to use ...so thanks for providing the details and examples! Works perfectly.

Cheers.

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

Re: Bin numbers to lat lon

by OB.DAAC - SeanBailey » Wed Mar 24, 2021 9:21 am America/New_York

Glad it works for you :) Admittedly that usage statement could use some work. We'll see about clarifying it in a future release.

Regards,
Sean

Post Reply