Bug report #8417

incorrect value loaded from netcdf file with scale factor

Added by Jan David Bendrien over 11 years ago. Updated over 9 years ago.

Status:Closed
Priority:Normal
Assignee:René-Luc ReLuc
Category:Rasters
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:17186

Description

I have downloaded a large (200+ MB) netcdf file on sea water velocities (from this dataset: http://www.myocean.eu/web/69-myocean-interactive-catalogue.php/?option=com_csw&view=details&product_id=GLOBAL_REANALYSIS_PHYS_001_009 ). After loading the file, QGIS 1.9 does not show the right values.

It seems it does not take into account the scaling factor of "0.001" embedded in the netcdf file (see the attached screenshot of the "ncBrowse" utility). QGIS displays sea water velocities of "117" m/s where the real value is "0.117" m/s.

netcdf_file_structure__tree_.png (24.8 KB) Jan David Bendrien, 2013-08-06 07:03 AM


Subtasks

Bug report #4388: gdal raster provider does not use Offset and Scale raster...Closed

History

#1 Updated by Giovanni Manghi over 11 years ago

  • Category set to Rasters
  • Status changed from Open to Feedback

Can you attach the actual dataset?

#2 Updated by Jan David Bendrien over 11 years ago

Trying to upload the dataset (200 MB file)

#3 Updated by Giovanni Manghi over 11 years ago

Jan David Bendrien wrote:

Trying to upload the dataset (200 MB file)

max attachment size is 5mb per file. Link it (dropbox or simila)?

#4 Updated by Jan David Bendrien over 11 years ago

I'm uploading it. Here is a first link (but it says it will take 90 minutes to download, so I am looking for another provider): http://dfiles.eu/files/6qtgs0hiz

#6 Updated by Giovanni Manghi over 11 years ago

  • Status changed from Feedback to Open

related discussions/pages

http://trac.osgeo.org/gdal/wiki/NetCDF_Improvements

http://trac.osgeo.org/gdal/ticket/3797

not sure, but it seems that gdal should support the scale_factor. Anyway I'll leave the response to the rasters guys.

PS
The wetransfer link should have an expire date, it would be better to have something that allows a download also in the future.

#7 Updated by Jan David Bendrien over 11 years ago

I've uploaded the file to another provider that hosts files for 90 days: https://hotfile.com/dl/238223792/7662375/GLORYS2V1_ORCA025_19930915_R20110216_gridU.nc.html

#8 Updated by René-Luc ReLuc almost 11 years ago

  • Target version set to Future Release - High Priority
  • % Done changed from 0 to 90
  • Status changed from Open to In Progress

I have send a pull-request [RASTER][Feature] Applying scale and offset to raster data - funded by Ifremer

https://github.com/qgis/QGIS/pull/1066

#9 Updated by René-Luc ReLuc almost 11 years ago

  • Assignee set to Radim Blazek

#10 Updated by Radim Blazek almost 11 years ago

  • Assignee deleted (Radim Blazek)

#11 Updated by René-Luc ReLuc over 10 years ago

The pull request https://github.com/qgis/QGIS/pull/1066 has been closed

I opened a new one https://github.com/qgis/QGIS/pull/1252
this one integrates reviews from @blazek @wonder-sk @etiennesky and @timlinux :
  • integrated and updated the test provided by @etiennesky
  • updated the sip API for un-protected method requested by @wonder-sk
  • updated the stats method to account for negative scale value

#12 Updated by René-Luc ReLuc over 10 years ago

  • Pull Request or Patch supplied changed from No to Yes

#13 Updated by Etienne Tourigny over 10 years ago

  • Subject changed from incorrect value loaded from netcdf file to incorrect value loaded from netcdf file with scale factor

#14 Updated by René-Luc ReLuc over 10 years ago

  • Resolution set to fixed/implemented
  • Status changed from In Progress to Closed
  • Assignee set to René-Luc ReLuc

Merged commit 07c57585c1fe10143a3529dfdeddcfa358c8f692
#07c57585c1fe10143a3529dfdeddcfa358c8f692

Pull request 1252 has been closed

#15 Updated by Ali Yagci over 9 years ago

I believe QGIS shouldn't correct the data for the scale factor. Users can do it on their own by one simple operation. It leads this, see here http://gis.stackexchange.com/questions/158949/pixel-values-beyond-valid-range-in-qgis?noredirect=1#comment235630_158949.

Also available in: Atom PDF