This is a generic filename generator.
Files are grouped into types, each type having a specific
name. This class allows you to refer to files by their type
and a list of their properties, such as instrument, mode, etc.
This way you may modify the file names without having to
modify the processing script in multiple places.
This class also knows some things about the output catalogs
for the processing script. It knows the file class for
each file type and catalog, and it also knows a human-readible
description of each file type.
This class gets most of its information from the file_classes
list file for the processing script. The constructor reads this
file and remembers its contents.
This is a mission-independant class.
It knows about the
file names of universal things like log files, catalogs, etc.,
and can read the input catalog and the processing parameter file
to get more file names.
Although you can get alot of mileage out of this class,
nearly all missions need to create a sub-class of this one
to handle the particular needs of that mission.
Constructor
- new()
This mostly reads the file_classes list file and stores its contents
internally.
Accessors
- log()
Get or set the log object in the class data.
- procpar()
Get or set the processing parfile object in the class data.
- jobpar()
Get or set the job.par parfile object in the class data.
- seriousness()
Get or set the level of errors issued by the methods of this class.
- mission()
Returns the mission specifier string.
- sequence()
Returns the sequence number identifying the current dataset.
- version()
Returns the processing version number for the current processing of the
current dataset.
- catalog_types()
Return an array of the file types for all the output catalogs.
- glob_dir(dir)
Set the directory where filename globbing will occur.
Note this is reset to an empty string by the get method.
- sequence_specific()
- version_specific()
- set_input_files()
Read the file types from the input catalog.
Methods
- description(type)
Returns the human-readable description for a given file type.
- types(catalog)
Return an array of all the file types for a given output catalog.
- class(catalog, type)
Return the class for a given file type as it will appear in a given
output catalog.
- glob_template(type, inst, index, mode)
Returns a list if filename templates possible containing wildcards.
- glob(dir, type, inst, index, mode)
Do filename globbing on a list of files in the current $self->{GLOB_DIR}
This is called by the get method.
- filter(list)
Takes a reference to a list of filenames, plus a set of file descriptor
arguments and returns a list of files valid for those descriptors.
This method always returns the input list. Subclasses may overrirde this.
This method is used by the "get" method.
- remove_path(name)
Removes the glob directory path from a file name.
- get()
Generate a filename of a given type.
- any(type)
Produce an array of all the files of a given type.
- parse(filename, type)
Extract the components of a filename and return them in an array
The components are the arguments to the "get" method which would
be required to produce this file name.
This method doesn't know how to parse anything and should
be overridden by mission specific sub-classes.
- corresponding(old_type, new_type, old_name)
Parse a file name and return the file of a different type which would
have had the same arguments.
- fetch(file, dir, justname)
Copy a named file from a given directory into the working directory.
If the directory is omitted, it defaults to the calibration file directory.
Returns true is a file was actually fetched. Returns 0 otherwise, either
becuase the file already exists in the working directory or because of error.
- fetch_cal(type, arg1, arg2,...)
Fetch a calibration file specified by the arguments which would
be given to the get method to specify its name. The method returns the
name of the fetched file.
- fetch_orbit(justname)
Copy the orbit file into the current working directory and
return the name of the (local) orbit file.
If an argument is given which evaluates to true, this method
will not actually fetch the file, but will just return the name.
That's so the "get" method can use the same parfile reading
and parsing code.
- exist()
This method takes a list of file names and
returns a list of all the files which actually exist.
Note this method does not do any globbing.
- error(message)
Internal error handling method.