This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Hi Janeen, > I don't understand the output I'm getting for a float variable when I > use the -p option of the ncdump command. > For example here is a file where I specified precision of the ncdump > utility as -p 4,7: > > // Chl_ctrl(6, 0-95) > 0.006179, 0.005789, 0.002502, 0.002943, 0.003311, 0.003856, 0.006481, > 0.01431, 0.02607, 0.06223, 0.08741, 0.08848, 0.09337, 0.08391, 0.06148, > 0.03593, 0.03441, 0.06112, 0.08778, 0.06033, 0.05429, 0.05096, 0.0419, > ... > Based on the documentation for the ncdump command's -p option I expected > to see decimals places of 4 or less, yet I'm getting 6. Here is same > variable with precision set at -p 2,2 > > // Chl_ctrl(6, 0-95) > 0.0062, 0.0058, 0.0025, 0.0029, 0.0033, 0.0039, 0.0065, 0.014, 0.026, > ... > I expected to see decimal values of no more than 2 places, yet I'm > getting up to 4. Can anyone explain how to interpret what the ncdump > utility is giving me? I should mention that I'm also using the -b c > option in the same command. > > Any comments would be most appreciated. The "-p" option to ncdump specifies the number of significant digits of precision rather than the number of digits after the decimal point. --Russ _____________________________________________________________________ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu