public static Type GetClrDataType(NetCdfDataType type)
 {
     if (type == NetCdfDataType.NC_BYTE)
     {
         return(typeof(byte));
     }
     if (type == NetCdfDataType.NC_CHAR)
     {
         return(typeof(char));
     }
     if (type == NetCdfDataType.NC_DOUBLE)
     {
         return(typeof(double));
     }
     if (type == NetCdfDataType.NC_INT)
     {
         return(typeof(int));
     }
     if (type == NetCdfDataType.NC_INT64)
     {
         return(typeof(long));
     }
     if (type == NetCdfDataType.NC_FLOAT)
     {
         return(typeof(float));
     }
     if (type == NetCdfDataType.NC_SHORT)
     {
         return(typeof(Int16));
     }
     throw new NotSupportedException(string.Format("NetCDF type {0} cannot be converted to CLR type", type));
 }
Exemplo n.º 2
0
 public static Type GetClrDataType(NetCdfDataType type)
 {
     if (type == NetCdfDataType.NC_BYTE)
     {
         return typeof (byte);
     }
     if (type == NetCdfDataType.NC_CHAR)
     {
         return typeof(char);
     }
     if (type == NetCdfDataType.NC_DOUBLE)
     {
         return typeof(double);
     }
     if (type == NetCdfDataType.NC_INT)
     {
         return typeof(int);
     }
     if (type == NetCdfDataType.NC_INT64)
     {
         return typeof(long);
     }
     if (type == NetCdfDataType.NC_FLOAT)
     {
         return typeof(float);
     }
     if (type == NetCdfDataType.NC_SHORT)
     {
         return typeof(Int16);
     }
     throw new NotSupportedException(string.Format("NetCDF type {0} cannot be converted to CLR type", type));
 }
Exemplo n.º 3
0
 public static int nc_put_att_int(int ncid, int varid, string name, NetCdfDataType type, IntPtr len, int[] tp) { /* lock (LockObject) */ { var r = NetCDFInterop.nc_put_att_int(ncid, varid, name, type, len, tp); return r; } }
Exemplo n.º 4
0
 public static int nc_inq_vartype(int ncid, int varid, out NetCdfDataType xtypep) { /* lock (LockObject) */{ var r = NetCDFInterop.nc_inq_vartype(ncid, varid, out xtypep); return r; } }
Exemplo n.º 5
0
 public static int nc_inq_att(int ncid, int varid, string name, out NetCdfDataType type, out IntPtr length) { /* lock (LockObject) */{ var r = NetCDFInterop.nc_inq_att(ncid, varid, name, out type, out length); return r; } }
Exemplo n.º 6
0
 public static extern int nc_put_att_float(int ncid, int varid, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8Marshaler))] string name, NetCdfDataType type, IntPtr len, float[] tp); 
Exemplo n.º 7
0
 public static int nc_def_var(int ncid, string name, NetCdfDataType xtype, int ndims, int[] dimids, out int varidp) { /* lock (LockObject) */{ var r = NetCDFInterop.nc_def_var(ncid, name, xtype, ndims, dimids, out varidp); return r; } }
Exemplo n.º 8
0
 public static extern int nc_inq_vartype(int ncid, int varid, out NetCdfDataType xtypep);
Exemplo n.º 9
0
 public static extern int nc_inq_att(int ncid, int varid, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8Marshaler))] string name, out NetCdfDataType type, out IntPtr length);
Exemplo n.º 10
0
public static int nc_inq_att(int ncid, int varid, string name, out NetCdfDataType type, out IntPtr length) /* lock (LockObject) */ {
{
    var r = NetCDFInterop.nc_inq_att(ncid, varid, name, out type, out length); return(r);
}
}
Exemplo n.º 11
0
 public static extern int nc_def_var(int ncid, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8Marshaler))] string name, NetCdfDataType xtype, int ndims, int[] dimids, out int varidp);
Exemplo n.º 12
0
 public static extern int nc_put_att_float(int ncid, int varid, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8Marshaler))] string name, NetCdfDataType type, IntPtr len, float[] tp);
Exemplo n.º 13
0
public static int nc_inq_vartype(int ncid, int varid, out NetCdfDataType xtypep) /* lock (LockObject) */ {
{
    var r = NetCDFInterop.nc_inq_vartype(ncid, varid, out xtypep); return(r);
}
}
Exemplo n.º 14
0
public static int nc_def_var(int ncid, string name, NetCdfDataType xtype, int ndims, int[] dimids, out int varidp) /* lock (LockObject) */ {
{
    var r = NetCDFInterop.nc_def_var(ncid, name, xtype, ndims, dimids, out varidp); return(r);
}
}
Exemplo n.º 15
0
 public static extern int nc_inq_att(int ncid, int varid, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8Marshaler))] string name, out NetCdfDataType type, out IntPtr length);
Exemplo n.º 16
0
 public static extern int nc_inq_vartype(int ncid, int varid, out NetCdfDataType xtypep);
Exemplo n.º 17
0
 public static extern int nc_def_var(int ncid, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8Marshaler))] string name, NetCdfDataType xtype, int ndims, int[] dimids, out int varidp);
Exemplo n.º 18
0
public static int nc_put_att_int(int ncid, int varid, string name, NetCdfDataType type, IntPtr len, int[] tp) /* lock (LockObject) */ {
{
    var r = NetCDFInterop.nc_put_att_int(ncid, varid, name, type, len, tp); return(r);
}
}