* Veronica Andreo <[email protected]> [2018-09-25 08:24:44 -0300]:

AFAIU, plate carree (lat long grid, no meters) is deprecated, and you
should use latlong instead. I had a similar issue with modis ocean color
products.

Do you at least get the same number of row and columns that is described by
gdalinfo when you import?

No, it is 512^2 (see below) against
```
g.regio -p
..
rows:       3584
cols:       8064
..
```

Markus' hint, not *directly* on the netCDF file, rather on one of the
layers:

gdalinfo NETCDF:"g2_BIOPAR_LST_201606220100_GLOBE_GEO_V1.2.nc":LST
Driver: netCDF/Network Common Data Format
Files: g2_BIOPAR_LST_201606220100_GLOBE_GEO_V1.2.nc
Size is 8064, 3584
Coordinate System is:
GEOGCS["unknown",
   DATUM["unknown",
       SPHEROID["Spheroid",6378137,298.2572326660156]],
   PRIMEM["Greenwich",0],
   UNIT["degree",0.0174532925199433,
       AUTHORITY["EPSG","9122"]]]
Origin = (-180.022321429103613,80.022321429103613)
Pixel Size = (0.044642858207226,-0.044642858207226)
Metadata:
 crs#grid_mapping_name=latitude_longitude
 crs#inverse_flattening=298.2572326660156
 crs#longitude_of_prime_meridian=0
 crs#semi_major_axis=6378137
 lat#axis=Y
 lat#long_name=latitude
 lat#standard_name=latitude
 lat#units=degrees_north
 lon#axis=X
 lon#long_name=longitude
 lon#standard_name=longitude
 lon#units=degrees_east
 LST#add_offset=273.15
 LST#ancillary_variables=Q_FLAGS, ERRORBAR_LST, TIME_DELTA, PERCENT_PROC_PIXELS
 LST#cell_methods=area:mean where land
 LST#coverage_content_type=physicalMeasurement
 LST#grid_mapping=crs
 LST#long_name=Land Surface Temperature
 LST#scale_factor=0.01
 LST#standard_name=surface_temperature
 LST#units=Kelvin
 LST#valid_range={-7000,8000}
 LST#_FillValue=-8000
 NC_GLOBAL#algorithm_version=GOES13-LST_v3.40, MSG3-LST_v7.14.0, 
HIMAWARI8-LST_v3.50, DataFusion_v5.2
 NC_GLOBAL#archive_facility=IPMA
 NC_GLOBAL#comment=Land Surface Temperature (LST) is the radiative skin 
temperature over land. LST plays an important role in the physics of land 
surface as it is involved in the processes of energy and water exc
hange with the atmosphere. LST is useful for the scientific community, namely 
for those dealing with meteorological and climate models. Accurate values of 
LST are also of special interest in a wide range of areas
related to land surface processes, including meteorology, hydrology, 
agrometeorology, climatology and environmental studies.
 NC_GLOBAL#contacts=Principal investigator (Researcher): [email protected]; 
Instituto Português do Mar e da Atmosfera (IPMA); Rua C ao Aeroporto; Lisbon; 
1749-077; Portugal (PT); IPMA website; http://www.ipma.
pt
Originator (IPMA GIO-Global Land Help Desk): [email protected]; Instituto 
Português do Mar e da Atmosfera (IPMA); Rua C ao Aeroporto; Lisbon; 1749-077; 
Portugal (PT); IPMA website; http://www.ipma.pt
Point of contact (GIO-Global Land Help Desk): [email protected]; Flemish 
Institute for Technological Research (VITO); Boeretang 200; Mol; 2400; Belgium 
(BE); VITO website; http://land.copernicus.eu/global/
Owner: [email protected]; European Commission 
Directorate-General for Enterprise and Industry (EC-DGEI); Avenue d'Auderghem 
45; Brussels; 1049; Belgium (BE); EC-DGEI website; http://ec.europa.eu/
enterprise/
Custodian (Responsible): [email protected]; European 
Commission Directorate-General Joint Research Center (JRC); Via E.Fermi, 249; 
Ispra; 21027; Italy (IT); JRC website; http://ies.jrc.ec.eur
opa.eu
 NC_GLOBAL#Conventions=CF-1.6
 NC_GLOBAL#credit=LST products are generated by the land service of Copernicus, 
the Earth Observation programme of the European Commission. The LST algorithm, 
originally developed in the framework of the FP7/Geoland2, is generated from 
MTSAT/HIMAWARI and GOES data, respectively owned by JMA and NOAA, and combined 
with the LST product from MSG under copyright EUMETSAT, produced by LSA-SAF.
 NC_GLOBAL#date_created=2016-06-22T03:22:01Z
 NC_GLOBAL#gcmd_keywords=SURFACE TEMPERATURE
 NC_GLOBAL#gemet_keywords=solar radiation
 NC_GLOBAL#history=2016-06-22T03:22:01Z - Product generation;
 
NC_GLOBAL#identifier=urn:cgls:global:lst_v1_0.045degree:LST_201606220100_GLOBE_GEO_V1.2
 NC_GLOBAL#inspire_theme=Orthoimagery
 NC_GLOBAL#institution=IPMA
 NC_GLOBAL#iso19115_topic_categories=climatologyMeteorologyAtmosphere, 
imageryBaseMapsEarthCover
 NC_GLOBAL#long_name=Land Surface Temperature
 NC_GLOBAL#name=LST
 NC_GLOBAL#orbit_type=GEO
 NC_GLOBAL#other_keywords=Global
 NC_GLOBAL#parent_identifier=urn:cgls:global:lst_v1_0.045degree
 NC_GLOBAL#platform=GOES13, MSG3, HIMAWARI8
 NC_GLOBAL#processing_level=L4
 NC_GLOBAL#processing_mode=Near Real Time
 NC_GLOBAL#product_version=V1.2
 NC_GLOBAL#purpose=This product is first designed to fit the requirements of 
the Global Land component of Land Service of GMES-Copernicus. It can be also 
useful for all applications related to the environment monitoring.
 NC_GLOBAL#references=Product User Manual: 
http://land.copernicus.eu/global/sites/default/files/products/GIOGL1_PUM_LST_I1.10.pdf
Validation Report: 
http://land.copernicus.eu/global/sites/default/files/products/GIOGL1_VR_LST_I2.10.pdf
Product page: http://land.copernicus.eu/global/products/lst
 NC_GLOBAL#sensor=IMAG, SEVI, AHI
 NC_GLOBAL#source=Data was derived from satellite imagery.
 NC_GLOBAL#time_coverage_end=2016-06-22T01:30:00Z
 NC_GLOBAL#time_coverage_start=2016-06-22T00:30:00Z
 NC_GLOBAL#title=Global Land Surface Temperature for 2016-06-22T01:00:00Z
 NETCDF_DIM_EXTRA={time}
 NETCDF_DIM_time_DEF={1,6}
 NETCDF_DIM_time_VALUES=0
 time#axis=T
 time#long_name=time
 time#units=days since 2016-06-22 01:00:00
Corner Coordinates:
Upper Left  (-180.0223214,  80.0223214) (180d 1'20.36"W, 80d 1'20.36"N)
Lower Left  (-180.0223214, -79.9776824) (180d 1'20.36"W, 79d58'39.66"S)
Upper Right ( 179.9776872,  80.0223214) (179d58'39.67"E, 80d 1'20.36"N)
Lower Right ( 179.9776872, -79.9776824) (179d58'39.67"E, 79d58'39.66"S)
Center      (  -0.0223171,   0.0223195) (  0d 1'20.34"W,  0d 1'20.35"N)
Band 1 Block=200x200 Type=Int16, ColorInterp=Undefined
 NoData Value=-8000
 Unit Type: Kelvin
 Offset: 273.15,   Scale:0.01
 Metadata:
   add_offset=273.15
   ancillary_variables=Q_FLAGS, ERRORBAR_LST, TIME_DELTA, PERCENT_PROC_PIXELS
   cell_methods=area:mean where land
   coverage_content_type=physicalMeasurement
   grid_mapping=crs
   long_name=Land Surface Temperature
   NETCDF_DIM_time=0
   NETCDF_VARNAME=LST
   scale_factor=0.01
   standard_name=surface_temperature
   units=Kelvin
   valid_range={-7000,8000}
   _FillValue=-8000


So, the important bits are:

```
gdalinfo NETCDF:"g2_BIOPAR_LST_201606220100_GLOBE_GEO_V1.2.nc":LST |grep Pixel

Pixel Size = (0.044642858207226,-0.044642858207226)
```
and
```
gdalinfo NETCDF:"g2_BIOPAR_LST_201606220100_GLOBE_GEO_V1.2.nc":LST |grep 
Coordinates -A5

Corner Coordinates:
Upper Left  (-180.0223214,  80.0223214) (180d 1'20.36"W, 80d 1'20.36"N)
Lower Left  (-180.0223214, -79.9776824) (180d 1'20.36"W, 79d58'39.66"S)
Upper Right ( 179.9776872,  80.0223214) (179d58'39.67"E, 80d 1'20.36"N)
Lower Right ( 179.9776872, -79.9776824) (179d58'39.67"E, 79d58'39.66"S)
Center      (  -0.0223171,   0.0223195) (  0d 1'20.34"W,  0d 1'20.35"N)
```

A fresh Location:
```
grass -c 'epsg:4326' /geo/grassdb/lst/wgs84
```
and
```
g.region -p

projection: 3 (Latitude-Longitude)
zone:       0
datum:      wgs84
ellipsoid:  wgs84
north:      1N
south:      0
west:       0
east:       1E
nsres:      1
ewres:      1
rows:       1
cols:       1
cells:      1
```

Import using r.in.gdal, _without_ any of `-l` or `-a` and then I get the
closest to the reported spatial resolution. Else, with `-a`, for
example, the spatial resolution is not as close to the "original" one.
Makes sense?

```
r.in.gdal in=NETCDF:"g2_BIOPAR_LST_201606220300_GLOBE_GEO_V1.2.nc":LST 
output=g2_BIOPAR_LST_201606220300_GLOBE_GEO_V1.2.nc_LST -o

WARNING: Datum <unknown> not recognised by GRASS and no parameters found
Over-riding projection check
360 degree EW extent is exceeded by 0.000192261 cells
Importing raster map <g2_BIOPAR_LST_201606220300_GLOBE_GEO_V1.2.nc_LST>...
100%
```

Here,
```
r.info g2_BIOPAR_LST_201606220300_GLOBE_GEO_V1.2.nc_LST -g

360 degree EW extent is exceeded by 0.00019226 cells
north=80.0223214291667
south=-79.9776823855556
east=179.977687153889
west=-180.022321429167
nsres=0.0446428582072328
ewres=0.0446428582072241
rows=3584
cols=8064
cells=28901376
datatype=CELL
ncats=0
```

Then, setting the region:
```
g.region raster=g2_BIOPAR_LST_201606220300_GLOBE_GEO_V1.2.nc_LST -pg
360 degree EW extent is exceeded by 0.00019226 cells
360 degree EW extent is exceeded by 0.00019226 cells
360 degree EW extent is exceeded by 0.00019226 cells
360 degree EW extent is exceeded by 0.00019226 cells
projection=3
zone=0
n=80.0223214291667
s=-79.9776823855556
w=-180.022321429167
e=179.977687153889
nsres=0.0446428582072328
ewres=0.0446428582072241
rows=3584
cols=8064
cells=28901376
```

Better to cut off the west side (?):
```
g.region raster=g2_BIOPAR_LST_201606220100_GLOBE_GEO_V1.2.nc_LST -pag w=-180 
e=180

360 degree EW extent is exceeded by 0.00019226 cells
360 degree EW extent is exceeded by 0.00019226 cells
360 degree EW extent is exceeded by 0.00019226 cells
projection=3
zone=0
n=80.0223214291667
s=-79.9776823855556
w=-180
e=180
nsres=0.0446428582072328
ewres=0.0446428571428571
rows=3584
cols=8064
cells=28901376
```

How does this look like?  We had this questions not along ago.

Nikos

Attachment: signature.asc
Description: PGP signature

_______________________________________________
grass-user mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to