Here’s how to figure out the contents of a save set.
1. This is the classic way:
restore,’filename.sav’,/verbose will list the variable names in the saveset.
help, variable_name will then give details on any such variable.
2. This is the modern (object-oriented) way. Note that it does not require a restore:
[After http://northstar-www.dartmouth.edu/doc/idl/html_6.2/IDL_Savefile.html#wp1034474 ] :
Use the IDL_Savefile object to query the contents of a SAVE file containing data and selectively restore variables.
So first, create a savefile object out of of the .sav file: sObj = obj_new(‘IDL_Savefile’, ‘p2206.B1913+16.wapp4.53958.0004_shifted.sav’)
Typically, IDL_Savefile::Contents is the first method called on a savefile object; the information retrieved indicates the number of different types of items contained in the file (variables, routines, etc.).
sContents = sObj->Contents()
one type of query of sContents is: print, sContents.N_var
20
Next, a call to IDL_Savefile::Names is used to obtain the names of items of a specific type.
sNames = sObj ->Names()
print,snames
ACTUAL_NRECS BINSHIFT BW DELFREQ IDLFILE LSRK NBIN NCHAN OBSJULDATE OBSTIME PROFILE_VERSION ROUNDBINSHIFT SCANNO SHIFTONOFFA SHIFTONOFFB
SHIFTTOTA SHIFTTOTB SRC VEL WAPPHOST
Then, IDL_Savefile::Size can be used to determine the size of a given (named) variable in the file:
size_of_shiftonoffa = sObj->Size(‘shiftonoffA’)
print, size_of_shiftonoffA
1 512 4 512, which means:
If no keywords are set, SIZE returns a vector of integer type. The first element is equal to the number of dimensions of Expression. This value is zero if Expression is scalar or undefined. The next elements contain the size of each dimension, one element per dimension (none if Expression is scalar or undefined). After the dimension sizes, the last two elements contain the type code (zero if undefined) and the number of elements in Expression, respectively. The type codes are listed at https://www.harrisgeospatial.com/docs/size.html. (the four here means floating point).
–Joel
Be First to Comment