Skip to content

Commit

Permalink
update julia syntax in README
Browse files Browse the repository at this point in the history
Came up in #80
  • Loading branch information
visr authored Jan 9, 2019
1 parent 7de2c5a commit 4a97063
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@ which will read the variable called "Radiation" from the file "myfile.nc". Gener

which gives an overview of the dimensions, variables and attributes stored in the file.

filename = "myfile.nc"
varname = "var1"
attribs = {"units" => "mm/d",
"data_min" => 0.0,
"data_max" => 87.0}
filename = "myfile.nc"
varname = "var1"
attribs = Dict("units" => "mm/d",
"data_min" => 0.0,
"data_max" => 87.0)


Creating variables and files is done by using the nccreate command:

nccreate(filename, varname, "x1", 11:20, "t", 20, {"units"=>"s"}, atts=attribs)
nccreate(filename, varname, "x1", collect(11:20), "t", 20, Dict("units"=>"s"), atts=attribs)

This will create the variable called var1 in the file myfile.nc. The attributes defined in the Dict attribs are written to the file and are associated with the
newly created variable. The dimensions "x1" and "t" of the variable are called "x1" and "t" in this example. If the dimensions do not exist yet in the file,
Expand Down

0 comments on commit 4a97063

Please sign in to comment.