Created
August 13, 2011 03:10
-
-
Save carlohamalainen/1143434 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns testing-netcdf | |
(:import ucar.ma2.Array) | |
(:import ucar.ma2.ArrayDouble) | |
(:import ucar.ma2.ArrayDouble$D2)) | |
(def a (Array/factory Double/TYPE (int-array [2 2]))) | |
(println (type a)) ; ucar.ma2.ArrayDouble$D2 | |
; How do we make an ArrayDouble.D2 directly? | |
; | |
; http://www.unidata.ucar.edu/software/netcdf-java/tutorial/IOSPbackground.html | |
; | |
; ArrayDouble.D2 data3 = new ArrayDouble.D2)(128, 256); | |
; | |
; None of these work: | |
; | |
; testing-netcdf=> (new ArrayDouble/ArrayDouble.D2 (int 3) (int 3)) | |
; java.lang.IllegalArgumentException: Unable to resolve classname: ArrayDouble/ArrayDouble.D2 (NO_SOURCE_FILE:10) | |
; testing-netcdf=> (new ArrayDouble$D2/ArrayDouble$D2 (int 3) (int 3)) | |
; java.lang.IllegalArgumentException: Unable to resolve classname: ArrayDouble$D2/ArrayDouble$D2 (NO_SOURCE_FILE:11) | |
; testing-netcdf=> (new ArrayDouble$D2/ArrayDouble.D2 (int 3) (int 3)) | |
; java.lang.IllegalArgumentException: Unable to resolve classname: ArrayDouble$D2/ArrayDouble.D2 (NO_SOURCE_FILE:12) | |
; testing-netcdf=> | |
; Solution provided on Freenode's #clojure by tomoj on 2011-08-13: | |
(ns testing-netcdf | |
(:import (ucar.ma2 ArrayDouble$D2))) | |
(println (ArrayDouble$D2. 2 2)) ; testing-netcdf=> #<D2 0.0 0.0 0.0 0.0 > | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment