Purpose

Generate a file listing the current LRIS settings. This file
is similar in form to the files generated by XHIRES. The
contents of the file can be parsed later by the restore_state
function in order to recover the original configuration. By
default, the data will be written to a file in the user's home
directory. The user can provide an optional file name to use
instead.

Usage

save_state [-all] [-blue] [-red] [-mechanisms] [-info] [-clobber] \
[-verbose] [-debug] [save_file]

Flags

-(a)ll save all LRIS parameters except INFO keywords;
equivalent to -rbm [default]
-(b)lue save blue-side CCD parameters
-(r)ed save red-side CCD parameters
-(m)echanisms save all mechanisms settings
-(i)nfoman save INFOMAN-only keywords when saving red or blue
CCD settings; these include FRAMENO, OUTDIR,
OUTFILE, DFORM, TODISK, OBJECT, OBSERVER
-(c)lobber clobber existing save file
-(v)erbose print diagnostic output
-(d)ebug print troubleshooting output

Arguments

save_file = name of the save file to generate. The default is
to create the file ~/.save_state.YYYY-MMM-DD

Output

Current LRIS settings are sent to the save file

Restrictions

- Unless the clobber flag is set, this script will not
overwrite an existing save file
- Trapdoor and lamps are not saved
- Guider position and filters are not saved (tv1fpos, tv1filt, tv2filt)
- CCD heater settings are not saved (redwheat, redcheat)

Exit values

0 = normal completion
1 = wrong number of arguments

Example

1) Save red, blue, and mechanism keywords to default file

save_state

2) Save red, blue, mechanism and infoman keywords to default file

save_state -i

3) Save red, blue, mechanism and infoman keywords to file ~/state1
save_state -i ~/state1

4) Overwrite existing default state file

save_state -c