Group Abstract Group Abstract

Message Boards Message Boards

Plot netcdf file?

Posted 7 years ago
POSTED BY: abdossamad r
3 Replies

If you take a look at the dimensions of your data you will notice that it is wrapped into an additional layer (which could mean that it is kind of a 3D structure --- list of data):

data = Import["~/Downloads/test.nc",  {"Datasets",  "SST"}]; 
Dimensions[data]
(* ==> {1, 801, 1001} *)

So what you want to do here to plot the data, is getting rid of additional layer, which can be done as easy as:

data = First[data]; 
Dimensions[data]
(* ==> {801, 1001} *)

Now you can plot the data:

ArrayPlot[data]

enter image description here

Or you could plot it as it is:

ArrayPlot /@ data

All the rest, in the example from the documentation I refereed to, is matter of preference. For example here is how it looks when you reverse your data:

ArrayPlot[Reverse[data]]

enter image description here

Or, here is how the ColorFunction actually influences your plot:

ArrayPlot[Reverse[data],  ColorFunction -> "BlueGreenYellow"]

enter image description here

And so on, so force.

p.s. Please consider removing External Programs and Systems from your question's keywords, since it is not related to your question.

POSTED BY: Mikayel Egibyan
Posted 7 years ago

Thanks Do you have the experience of netcdf plot in mathematica? I acted as an example, but I did not succeed.

Import[ "D:/test.nc"] enter image description here

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