![]() |
Tutorial | |
|
Working With DataOverviewThis tutorial introduces some of the basic tools for working with superdarn data. To understand how the toolset works, you must first know a little about how UNIX operates. Most users are familiar with the concept of running a program to perform some action on a file, for instance using In UNIX it is possible to redirect where the standard input and output streams read and write to by using the redirection operators "<" and ">". For instance, to display the contents of a file you could use:
The "<" redirection operator reads the file "README.txt" and feeds it to the standard input of
The ">" redirection operator writes the standard ouptut of Almost all UNIX utilities can use standard input and output instead of files. The real power of streams comes from the concept of the UNIX pipe. A pipe connects the standard output of one process to the standard input of another and is indicated by the "|" symbol. A pipe lets your string together multiple commands into a single operation:
The simple example above lists who is logged onto the system, sorts them into alphabetical order and prints the list on the default printer. Most of the SuperDARN tools work both on files and on the standard input and output streams. Filenames and suffixesIt is important to understand that UNIX offers great flexibility in naming files and filename suffixes do not necessarily determine the type of a file. The convention is that certain suffixes are used for certain types of file, for example "gz" indicates that the file has been compressed using This UNIX convention means that the utilities cannot infer the type of the file from its name and any information that is required to determine its type must be supplied by the user. Old and new data formatsThe two principal types of SuperDARN data are the raw ACF data derived from the radar observations and the fitted paramaeters generated by the FitACF algorithm. In the past the raw ACF data has been stored in Some utilities in the software are only applicable to old format files and some are only applicable to the new. When a utility can be applied to both, the command line option "-new" is used to indicate that the utility is working on a new format file. Concatenating FilesIndividual SuperDARN data files normally contain up to two hours of data, so one of the first jobs that a user will want to do is concatenate these short files together to create larger more useful files. How this cocatenation is done depends on whether the data is in the old or new format. Old Format DataOld format To concatenate together a
The program takes as command line arguments the list of files to concatenate; the final command line argument is the output filename. It's a lot of work to have to type the name of each file on the command line, so you can take advantage of UNIX wildcard filename expansion:
Note: Be careful when using wildcards that the pattern doesn't turn up a match for the output file. If the filenames follow the SuperDARN naming convention, this will not be a problem, but if they do not, place a trailing "C" on the end of the ouput filename. To concatenate together a
New format filesNew format
Creating Index FilesSuperDARN data files can be very large and to speed up searching through the file for a particular time, you can create an index file. Old format
Note: For consistency with the rest of the software, The program will either read from the file specified on the command line or from standard input and write the index to standard output:
To create an index file for a
The program will read the fit file from the first file given on the command line and write the index to the second:
You use the same utiltity to create an index for a
As with
The filename suffix for Trimming FilesOften you will only be studying a short interval within a data file. It would be useful if you could trim larger files down so that they contain just the interval of interest; this will make the files smaller and easier to work with. To do this you can use the utilities These utilities have a number of command line options, but the most important ones are used to specify the interval to extract from the file. You can specify either a start time and an end time, or a start time and an extent. If the file consists of one day of data then only the UT time must be specified, if the file extends beyond one day then you may also have to specify a start date and an end date. The start time is specified using the "-st hr:mt" option, where hr is the UT hour and mt is the ut minute; the end time is similarly defined using "-et hr:mt". If you decide to specify an extent of time to extract, use the "-ex hr:mt" option. The start date is specified using the "-sd yyyymmdd" option, where yyyy is the four digit year, mm mm is the two digit month and dd is the two digit dat; similarly the end date is specified using the "-ed yyyymmdd" option. The syntax of Old Format DataThe syntax of
The "-t thr" sets the threshold level for the ratio of signal to power; ranges with a lag zero power to noise ratio less than this value are not stored. The default value for this ratio is 3. The
The syntax of
The
New Format DataThe syntax of
The "-t thr" sets the threshold level for the ratio of signal to power; ranges with a lag zero power to noise ratio less than this value are not stored. The default value for this ratio is 3. The
The syntax of
The
Creating
|
make_fit [-vb] datfile fitfile [inxfile] |
The dat file is read from datfile and the fit file is written to fitfile. An index file is created if the optional filename inxfile is included on the command line:
make_fit 20021220.kap.dat 20021220.kap.fit 20021220.kap.inx |
The syntax of the command when creating fitacf files is:
make_fit -new [-vb] [inpfile] |
The rawacf file is read from either inpfile or from standard input and the fitacf file is written to standard output:
make_fit 20021220.kap.rawacf > 20021220.kap.fitacf cat 20021220.kap.rawacf | make_fit > 20021220.kap.fitacf |
Note:You can only make a fit file from a dat file, and you can only make a fitacf file from a rawacf file. You can always convert to a different file type using the conversion utilities.
| Back |