I found that explanation ...

ISIN grid location variables (only present in ISIN case). Some variable
names are prefixed by the name of the parameter (e.g. CHL1_mean,
EL555_weight).

row(bin) Latitudinal band index of the bins stored in the product, zero
based and beginning at south
col(bin) Longitudinal index of the bins stored in the product, zero based
and beginning at west
center_lat(row) Center latitude for each useful row
center_lon(row) Center longitude of the first bin (the first bin in the
global ISIN grid, not the first valid bin) for each useful row
lon_step(row) Longitude step for each useful row
PRM_mean(bin) Average value of the binned pixels values
PRM_stdev(bin) Standard deviation of the square of the binned pixels values
PRM_count(bin) Number of binned pixels
PRM_weight(bin) Sum of the weights of the binned pixels
PRM_flags(bin) Flags
PRM_error(bin) Error estimation for the geophysical variable

Note 1: the row(), col(), center_lat, center_lon and lon_step() arrays
allow an easier conversion
of the bin index into geographical coordinates rather than the global idx()
array written in the
SeaWiFS and MODIS level 3 products.
Equations to compute center longitude and latitude for a bin b are:
index = row(b) – first_row (first_row is a global attribute)
lat(b) = center_lat( index )
lon(b) = center_lon( index ) + col(b) * lon_step( index )

... I will try to convert, but that's not straight forward !!!

Thanks for your help !

Arnaud

Le 14 mars 2012 15:42, Robert J. Hijmans <r.hijmans@gmail.com> a écrit :

>
> I assume this from MERIS and that the files stores 'sparse raster' data
>  (NAs are not stored) that you can 'expand' following what is described
> here:
> http://www.enviport.org/meris/docs/meris_l3_sin_grid.pdf .
>
> It would be nice to have a good "sparse raster" format; but unfortunately
> this one does not look like a generic implementation.
>
> Robert
>
>
> On Wed, Mar 14, 2012 at 12:10 PM, Barry Rowlingson <
> b.rowlingson@lancaster.ac.uk> wrote:
>
>> On Wed, Mar 14, 2012 at 4:14 PM, Arnaud Mosnier <a.mosnier@gmail.com>
>> wrote:
>> > Hi all,
>> >
>> > I am trying to open a netCDF file (
>> >
>> ftp://globcolour_data:fgh678@ftp.acri.fr/GLOB_4KM/RAN/CHL1/MERGED/GSM/2007/DAILY/L3b_20070615__GLOB_4_GSM-MERMODSWF_CHL1_DAY_00.nc.gz
>> > ).
>> >
>> > However, when I use the raster package to load it as a raster ...
>> >
>> > library(raster)
>> >
>> test<-raster("D:\\temp\\testAQUATERRA\\rawtif\\L3b_20070615__GLOB_4_GSM-MERMODSWF_CHL1_DAY_00.nc",
>> > varnam= "CHL1_mean")
>> >
>> > Error in .rasterObjectFromCDF(x, type = objecttype, band = band, ...) :
>> >  CHL1_mean only has a single dimension; I cannot make a RasterLayer from
>> > this
>> >
>> >
>> > Here is the structure of the file ...
>> > Variable "CHL1_mean is linked to a bin, not XY coordinates
>> >
>> > library(ncdf)
>> >
>> test<-open.ncdf("D:\\temp\\L3b_20070615__GLOB_4_GSM-MERMODSWF_CHL1_DAY_00.nc")
>> > test
>> >
>> > [1] "file D:\\temp\\L3b_20070615__GLOB_4_GSM-MERMODSWF_CHL1_DAY_00.nc
>> has 2
>> > dimensions:"
>> > [1] "bin   Size: 3308394"
>> > [1] "row   Size: 3121"
>> > [1] "------------------------"
>> > [1] "file D:\\temp\\L3b_20070615__GLOB_4_GSM-MERMODSWF_CHL1_DAY_00.nc
>> has 8
>> > variables:"
>> > [1] "short col[bin]  Longname:Longitudinal index of the bins stored in
>> the
>> > product, zero based and beginning at west Missval:NA"
>> > [1] "float center_lat[row]  Longname:Center latitude for each useful row
>> > Missval:1e+30"
>> > [1] "float center_lon[row]  Longname:Center longitude of the first left
>> bin
>> > (the first bin in the global ISIN grid, not the first valid bin) for
>> each
>> > useful row Missval:1e+30"
>> > [1] "float lon_step[row]  Longname:Longitude step for each useful row
>> > Missval:1e+30"
>> > [1] "float CHL1_mean[bin]  Longname:Chlorophyll-a concentration. Case 1
>> > water - Mean of the binned pixels Missval:1e+30"
>> > [1] "short CHL1_count[bin]  Longname:Chlorophyll-a concentration. Case 1
>> > water - Total number of binned pixels Missval:NA"
>> > [1] "short CHL1_flags[bin]  Longname:Chlorophyll-a concentration. Case 1
>> > water - Flags Missval:NA"
>> > [1] "short CHL1_error[bin]  Longname:Chlorophyll-a concentration. Case 1
>> > water - Error estimation Missval:NA"
>> >
>> > Is there a simple way to open this file directly as a raster ?
>>
>>  There's nothing in it that is explicitly two-dimensional.  The list
>> of variables printed are all one-dimensional.
>>
>>  The file has two 'dimensions': "bin" which is 3308394 long, and 'row'
>> which is 3121 long. Every other variable is one of those lengths long,
>> and one-dimensional.
>>
>>  If there was a 2d grid in there you'd see something like:
>>
>> [1] "file /data/rowlings/MapLibrary/World/Climate/CRUTEM3.nc has 4
>> dimensions:"
>> [1] "longitude   Size: 72"
>> [1] "latitude   Size: 36"
>> [1] "unspecified   Size: 1"
>> [1] "t   Size: 1925"
>> [1] "------------------------"
>> [1] "file /data/rowlings/MapLibrary/World/Climate/CRUTEM3.nc has 1
>> variables:"
>> [1] "float temp[longitude,latitude,unspecified,t]
>> Longname:Temperature T Missval:2.00000004008175e+20"
>>
>> which is defining a 36x72x1x1925 grid (lon x lat x 1 x t).
>>
>>  So I'm guessing that maybe some of those vectors are actually
>> unwrapped grids? Quite what their dimension is I don't know, since
>> 3121 doesn't go into 3308394 exactly.
>>
>>  You'll have to use the ncdf package to have a look at the variables
>> and see if you can make sense of them:
>>
>>  > L = open.ncdf("L3b_20070615__GLOB_4_GSM-MERMODSWF_CHL1_DAY_00.nc")
>>
>>  > get.var.ncdf(L,"lon_step",1,10)
>>  [1] 0.06079027 0.06073899 0.06069803 0.06064690 0.06059586 0.06055509
>>  [7] 0.06050420 0.06046356 0.06041282 0.06037230
>>
>> Barry
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
>

	[[alternative HTML version deleted]]

