![]() ![]() You should also store the flags and corresponding original strings, either as attributes or as a separate array of chars and associated flag values. (Obviously, choose numeric values that cannot occur in your actual data.) This is similar to how you need to encode nan's, flagged by the attribute _FillValue. ![]() For example, if you have strings of "Ozone", "CO2", "Methane", replace these with, say, -999, -998, and -997 respectively. Then store the data as a fixed-length 2-D char array.Įncode your string data with numeric values. These will unfortunately have to be fixed length strings, which would need to be long enough to retain your necessary precision. ![]() datatime cdflib.getVarRecordData (cdfid,0,0) datatime 6.3146e+13. The low-level interface returns these as double values. The Installation instructions are fairly straightforward and there is little that can be added to it. This version of the library is provided for free and can be downloaded directly from SPDF. The first variable contains CDF Epoch time values. To read the data from NASA Space Physics Data Facility (SPDF) you are encouraged to use the CDF handling library from SPDF. Neither, unfortunately, does Matlab currently (1/18) support the ability to read and write NetCDF4's variable-length strings (even though it has recently added a string datatype).Ĭonvert all numeric data to strings with sprintf(.). Read the data in a variable into the MATLAB workspace. AFAIK, NetCDF3 and NetCDF4 formats do not have anything akin to Matlab's cell array, which can hold different types of data in each cell. ĭisp('Skipping variable with more than 3 dimensions') It's not exactly what you asked, but here's a script that writes all the. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |