Waves get zero values after calculations
steeve88
I have a netcdf file, which contains meteorological parameters, which need correction before any use.
After loading this file you can see parameters and their correction factors.
So eg. I do:
Function test2()<br />
<br />
wave/c nc_z<br />
wave nc_var3_scale_factor, nc_var3_add_offset<br />
<br />
duplicate/o/c nc_z, nc_z1 <br />
<br />
nc_z1=nan<br />
<br />
nc_z1=nc_z*nc_var4_scale_factor[0]+ nc_var4_add_offset[0]<br />
<br />
End
<br />
wave/c nc_z<br />
wave nc_var3_scale_factor, nc_var3_add_offset<br />
<br />
duplicate/o/c nc_z, nc_z1 <br />
<br />
nc_z1=nan<br />
<br />
nc_z1=nc_z*nc_var4_scale_factor[0]+ nc_var4_add_offset[0]<br />
<br />
End
I have uploaded the nc file here:
http://www.megafileupload.com/qRr0/rel_vort.nc
After that the nc_vo1 wave gets only zero values.
What could be the problem?
You declare
wave nc_var3_scale_factor, nc_var3_add_offset
but use
nc_var4_scale_factor[0]
andnc_var4_add_offset[0]
--> "3" vs "4"
HJ
January 15, 2016 at 06:57 am - Permalink
January 15, 2016 at 07:31 am - Permalink
I don't see nc_vo1 listed in your code anywhere, so your difficulty is hard to diagnose.
And the NetCDF XOP I found couldn't load your data file; how did you get it into Igor?
You should attach your experiment instead of the data file.
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
January 15, 2016 at 08:25 am - Permalink
Could you post a minimal example that reproduces your issue (make waves and do arithmetics)?
...factor[0] and ...offset[0] are non-zero? -- Really checked? ;-)
HJ
January 15, 2016 at 01:25 pm - Permalink
concerning the way that I load my this nc file. A guy from the forum gave me an extension for Igor, because this files are a bit "weird".
However, I think that finally I found the solution. The only I did was to make a new wave and put the data I wanted from the nc_vo into my new wave. It might be a kind of different type (?) of wave. I am not sure.
For a reason that I don't know, when I multiplied and summed these factors, a kind of rounding took place. So, all values were really small (order of 10^-5), so the became 0.
January 18, 2016 at 01:23 pm - Permalink