Group Abstract Group Abstract

Message Boards Message Boards

How do I access the add_offset and scale_factor in an .nc file?

Posted 2 years ago

When I give

Import["H:\\g15e\\nc_ecmwf\\era5\\ec_2006010904z_25_PV_T_u_v.nc", \
"Attributes"] [file name works - loses underscores in post]

among the responses are

"/u" -> <|"_FillValue" -> -32767, "add_offset" -> 30.6164, 
  "long_name" -> "U component of wind", "missing_value" -> -32767, 
  "scale_factor" -> 0.00198886, "standard_name" -> "eastward_wind", 
  "units" -> "m s**-1"|>,

How do I access addoffset and scalefactor for subsequent calculations and where is this written up in the online documentation?​

POSTED BY: Joel Tenenbaum
6 Replies

Thanks, and have made progress.

Joel

POSTED BY: Joel Tenenbaum

Eric,

I started with a clean fresh notebook and tried with and without initializing the index variable. What is attached is the complete notebook, test05.nb.

Joel

Attachments:
POSTED BY: Joel Tenenbaum
Posted 2 years ago
POSTED BY: Eric Rimbey
POSTED BY: Joel Tenenbaum
Posted 2 years ago

I don't get that message running that code. I get that message if I provide a symbol as the Do iterator and the symbol doesn't evaluate to a number. Is this the exact code, or did you try to simplify the example? I would need to more about what happened in your session. Have you tried quitting the kernel and trying again?

FWIW, you shouldn't expect that code to actually resolve to any value. Well, more accurately it should evaluate to Null.

POSTED BY: Eric Rimbey
Posted 2 years ago

Look up the documentation for Association.

POSTED BY: Eric Rimbey
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard