Title: | Integerized Sinusoidal Binning Scheme for Level 3 Data |
---|---|
Description: | The NASA Ocean Biology processing Group L3 bin scheme, based on the sinusoidal map projection. Psuedo code for the binning scheme was published in Appendix A of NASA Technical Memorandum 104566, Vol. 32., listed in URL. |
Authors: | Michael D. Sumner [aut, cre], NASA's OceanColor Web [ctb, cph] |
Maintainer: | Michael D. Sumner <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.0.9000 |
Built: | 2024-11-01 11:16:38 UTC |
Source: | https://github.com/hypertidy/L3bin |
Bin number from longitude and latitude for a given grid with NUMROWS unique latitudes.
bin_from_lonlat(lon, lat, NUMROWS)
bin_from_lonlat(lon, lat, NUMROWS)
lon |
longitude |
lat |
latitude |
NUMROWS |
number of rows in the grid |
This function previously lived in sosoc/croc where it is called lonlat2bin
integer vector of bin number
bin_from_lonlat(147, -42, 1024) bin_from_lonlat(c(0, 0, 0), c(-90, 0, 90), 1024)
bin_from_lonlat(147, -42, 1024) bin_from_lonlat(c(0, 0, 0), c(-90, 0, 90), 1024)
Crop L3 list, returns bins that fall within the extent.
crop_bins(x, extent)
crop_bins(x, extent)
x |
L3bin object |
extent |
vector of 'c(xmin, xmax, ymin, ymax)' |
This function previously lived in sosoc/croc where it is called crop_init
integer vector of bins
init <- L3bin(24) crop_bins(init, c(100, 110, -50, -45))
init <- L3bin(24) crop_bins(init, c(100, 110, -50, -45))
Calculate bin boundaries from bin number
extent_from_bin(bin, NUMROWS)
extent_from_bin(bin, NUMROWS)
bin |
bin number |
NUMROWS |
relevant number of L3 bin rows |
Bin boundaries are the xmin, xmax, ymin, ymax edge of each bin - compare to the output of
lonlat_from_bin' which returns only the centre of each bin.
This function previously lived in sosoc/croc where it is called bin2bounds
matrix of extent columns xmin,xmax,ymin,ymax -
bins <- L3bin(NUMROWS = 12) ex <- extent_from_bin(1:bins$totbins, 12) plot(range(ex[,1:2]), range(ex[,3:4]), type = "n", asp = 1) points(lonlat_from_bin(1:bins$totbins, 12), pch = "+", cex = .8) rect(ex[,1], ex[,3], ex[,2], ex[,4])
bins <- L3bin(NUMROWS = 12) ex <- extent_from_bin(1:bins$totbins, 12) plot(range(ex[,1:2]), range(ex[,3:4]), type = "n", asp = 1) points(lonlat_from_bin(1:bins$totbins, 12), pch = "+", cex = .8) rect(ex[,1], ex[,3], ex[,2], ex[,4])
This function previously lived in sosoc/croc where it is called initbin
L3bin(NUMROWS = 2160)
L3bin(NUMROWS = 2160)
NUMROWS |
relevant number of L3 bin rows |
https://oceancolor.gsfc.nasa.gov/docs/format/l3bins/
L3bin(1024)
L3bin(1024)
Generate longitude and latitude coordinates from bin number.
lonlat_from_bin(bins, NUMROWS)
lonlat_from_bin(bins, NUMROWS)
bins |
bin number |
NUMROWS |
number of rows in this grid |
This function previously lived in sosoc/croc where it is called bin2lonlat
matrix of longitude, latitude the centre coordinate of the bin
lonlat_from_bin(c(1, 184), 12)
lonlat_from_bin(c(1, 184), 12)
Row is 1-based, and starts at the southern-most row.
row_from_lat(lat, NUMROWS)
row_from_lat(lat, NUMROWS)
lat |
latitude |
NUMROWS |
number of rows in the grid |
This function previously lived in sosoc/croc where it is called .lat2row.
row_from_lat(-42, 1024) row_from_lat(c(-90, 0, 90), 1024)
row_from_lat(-42, 1024) row_from_lat(c(-90, 0, 90), 1024)