I have nc files ,here is one file https://echange-fichiers.inra.fr/get?k=LUfqiyO1Dl7az5bihnS. from the metadata ,the projection is cylindrical and the resolution is 25 km:
Warning 1: No UNIDATA NC_GLOBAL:Conventions attribute
Driver: netCDF/Network Common Data Format
Files: none associated
Size is 1383, 586
Coordinate System is `'
Metadata:
lat#_FillValue=9.96921e+036
lat#long_name=latitude
lat#units=degrees_north
lon#_FillValue=9.96921e+036
lon#long_name=longitude
lon#units=degrees_east
NC_GLOBAL#conventions=CF-1.4
NC_GLOBAL#creation_date=2012-01-18T06:27:33
NC_GLOBAL#ease_global=yes
NC_GLOBAL#ease_origin_lat=-85.312271
NC_GLOBAL#ease_origin_lon=-179.8698
NC_GLOBAL#ease_projection=cylindrical
NC_GLOBAL#ease_resolution=25
NC_GLOBAL#history=none
NC_GLOBAL#institution=SMOS CATDS Processing Chain
NC_GLOBAL#netcdf_version_id=3.6.2
NC_GLOBAL#product_version=1.0
NC_GLOBAL#references=DDI CATDS - Ref. CAT-DDI-CT-00020-CG
NC_GLOBAL#source=CATDS L3 SM Filtrering Processor
NC_GLOBAL#title=L3-SM P11p : Preliminary Daily Retrieval Map
Corner Coordinates:
Upper Left ( 0.0, 0.0)
Lower Left ( 0.0, 586.0)
Upper Right ( 1383.0, 0.0)
Lower Right ( 1383.0, 586.0)
Center ( 691.5, 293.0)
I want to reproject it to WGS84 with a resolution of 0.25 * 0.25 degree. I used this code:
import os
for doy in range(1,367):
inputFile='D:\\358\\2010SMOSl3_sm'+str(doy)+'.nc'
inputDataset='NETCDF:\"'+inputFile+'\":Soil_Moisture'
outputFile='D:\\SMOS\\RE01\\MIR_CLF31D\\2010_sm'+str(doy)+'.img'
gdalcmd='gdalwarp -of "ENVI" -ot Float32 -srcnodata -32768 -dstnodata -9999 -te -180 -90 180 90 -overwrite '+inputDataset+' '+outputFile
os.system( gdalcmd)
but I got an error:
ERROR 1: Unable to compute a transformation between pixel/line
and georeferenced coordinates for NETCDF:D:\SMOS\RE01\MIR_CLF31D\SM-D-RE-renamed- daily-2010-from day 14 to day 358\2010SMOSl3_sm307.nc:Soil_Moisture.
There is no affine transformation and no GCPs.