NAME

plotrc.pl - Interactivly plots range changes, calibrates the x offsets for range changes and saves the range chances plots as pdf files.


SYNOPSIS

plotrc.pl [--year year] --month month [--days days_list | --begin day_begin --end day_end] --spacecraft spacecraft --Length length --All --ranges ranges [--ICL] [--(no)xwin] [--version version] [--help]


DESCRIPTION

This script plots the magnetic field components Bx, sqrt(By^2+Bz^2) and the magnetic field magnitude, B during intervals centered on the range change times for the given spacecraft and day. It can use ESTEC or Imperial College raw data which may also be compressed. Using keybord shortcuts the user can browse through the identified range changes. Bx values selected with the mouse are printed to the standard output. When two Bx values are selected, the corresponding range change offset is calculated and a file which can be read by the cls.pro idl calibration routine is prepared. Use update - rc offset> from cls.pro to load the prepared values. The script can also use the calculated offset to directly modify the calibration files. When the script exits, the plots are saved as pdf files. In non-interactive mode it produces the range changes plots for the spacecraft and days given in the command line.


OPTIONS

-y year, --year year

The year. One or two digits. Default is the current year.

-m month, --month month

The month. One or two digits. Mandatory argument.

-d days_list, --days days_list

List of days given as a string. Ranges are permitted, e.g -d '3 12 15-28 30'. If niether --days, --begin, or --end options are given, than the entire month is processed.

-b day_begin, --begin day_begin

First day in sequence. Default is 1.

-e day_end, --end day_end

Last day in sequence. Default is 31.

-s spacecraft, --spacecraft spacecraft

The spacecraft number (1-4) or list of spacecraft e.g -s '1 3 4'. Defaults to all spacecraft.

-L length, --Length length

The duration in seconds before and after the range change which should be ploted. Default is 10s.

-A, --All

This option is passed to fgmtel. If used, all data, including data marked as 'bad' will be ploted. See the fgmtel manual page.

-r ranges, --ranges ranges

The range change which is plotted first, e.g. -r 56. Default is the first range change of the day.

-I ,--ICL

Use the Imperial College London raw data. Default is to use the ESTEC raw data.

-x, -xwin

Interactive mode. Enabled by default if only one day and one spacecraft are are given in the command line. Can be disabled using the --noxwin option. In non-interactive mode only the pdf files with range changes plots are produced.

-v version, --version version

Version of the calibration files. If this option is not given then the environment variable FGMVERSION is used. If FGMVERSION is not set, then the default version is 3.

-h, -?, --help

Prints a brief help message.


KEYBOARD AND MOUSE BINDINGS

The following commands are available in the plot window:

n or space

display the next range change.

p

display the previous range change.

o

Update the corresponding calibration files (.cfgnew and .fgmcal) to reflect the calculated x offset.

b

Undo the changes back to the x offset before the last change of the calibration files.

r

read again the calibration files and redo the plot.

q or mouse middle

quit.

mouse left

If two Bx values are already selected, then clear them, otherwise, select Bx value.

mouse right

clear Bx value.


ENVIRONMENT

FGMROOT

Root for the FGM calibration directory structure. Default to /home/FGM/ if not set.

FGMPATH

Path to calibration files (*.fgmcal and *.cfgnew). Default to $FGMROOT/data/dcalf/ if not set.

SATTPATH

Path to orbit parameters files. Default to $FGMROOT/log/atorb/ if not set.


FILES

$FGMROOT/log/cd_log/YY_MM - log file directory.

Cn_YYMMDD_B.[NS/BS/BSNS]log - log file. Used for identifying the range changes.

$FGMROOT/data/raw/YY_MM - Imperial input path.

$FGMROOT/data/raw/ESTEC/cluster$sc/[n|b]sd_n/ - ESTEC (default) input path.

Cn_YYMMDD_B.[NS/BS] - Imperial input file. Contains the raw data.

YYMMDD.f[n|b].?an - ESTEC (default) input files

$FGMROOT/data/cfcal/ - output path for *.cal files.

cf_cn_YYYYMMDDThh:mm:ss.mmm_rMN.cal - output file. One for each range change.

$FGMPATH/CN_YYYYMMDD_Vn.fgmcal - calibration file used to produce the data for the plots. This file is updated with o and b interactive commands.

$FGMPATH/cN_YYMMDD_hhmmr2_Vn.cfgnew - calibration file. Calibration parameters are read from this file. After selecting two Bx values, the computed offset is writen in rc_off.tmp. The o and b interactive commands can be used to update this calibration file and the corresponding fgmcal file.

$FGMROOT/data/ini/rc_off.tmp - range and offset value for cls.pro script.

$FGMROOT/data/rcplots/YYYY/MM/ - output directory for pdf plots.

cf_cn_YYYYMMDD.pdf - plot with all range changes for the day.

RC_cn_YYYYMM.pdf - plot with all range changes for the month. Only produced if no days are specified in the command line.


DEPENDENCES

This script uses the following:

 ddscut,
 fgmtel,
 fgmcal,
 fgmvec,
 modcalf.pl,
 ps2pdf,
 pdfjoin.


AUTHOR

Dragos Constantinescu <d.constantinescu@tu-bs.de>