;+ ; Project : Computational Physics ; ; Name : ORBTICKS ; ; Purpose : Determines the tick marks for orbit plots. ; ; Explanation : This procedure creates tick mark locations and labels for the ; orbit plot made by ORBPLOT. ; ; Use : ORBTICKS, MAXVAL, TICKS, STICKS, NTIC, NMINOR, MINSEP ; ; Inputs : MAXVAL: The maximum extent of the data (RAP or BSEMI). ; ; Opt. Inputs : None. ; ; Outputs : TICKS: An array containing the locations of the major ; (positive value) tick marks. ; ; STICKS: A array containing string version of TICKS. Note that ; the origin has a NULL string as its value. ; ; NTIC: The number of major tick marks stored in TICKS. ; ; NMINOR: The number of major tick marks to be plotted between ; the major tick marks (last minor = next major location). ; ; MINSEP: The separation in data coordinates of the minor tick ; marks. ; ; Opt. Outputs: None. ; ; Keywords : ERRMSG: If defined and passed, then any error messages will ; be returned to the user in this parameter rather than ; being internally printed. If no errors are ; encountered, then a null string is returned. In order ; to use this feature, the string ERRMSG must be defined ; first, e.g., ; ; ERRMSG = '' ; ORBTICKS, MAXVAL, TICKS, STICKS, NTIC, $ ; NMINOR, MINSEP, ERRMSG=ERRMSG ; IF ERRMSG(0) NE '' THEN ... ; ; Calls : None. ; ; Common : None. ; ; Restrictions: None. ; ; Side effects: None. ; ; Category : Computation physics. ; ; Prev. Hist. : None. ; ; Written : Donald G. Luttermoser, ETSU/Physics, 9 December 2002 ; ; Modified : Version 1, Donald G. Luttermoser, ETSU/Physics, 9 Dec 2002 ; Initial program. ; Version 2, Donald G. Luttermoser, ETSU/Physics, 3 May 2007 ; Replaced the IDL MESSAGE utility with a PRINT statement. ; Version 3, Donald G. Luttermoser, ETSU/Physics, 23 Nov 2009 ; Changed variable array indicies symbols from "()" to "[]". ; ; Version : Version 3, 23 November 2007. ; ;- ; PRO ORBTICKS, MAXVAL, TICKS, STICKS, NTIC, NMINOR, MINSEP, ERRMSG=ERRMSG ; EMESS = '' ; Set to non-null string if error is encountered. ; IF N_PARAMS() NE 6 THEN BEGIN EMESS = 'Syntax: ORBTICKS, MAXVAL, TICKS, STICKS, NTIC, ' + $ 'NMINOR, MINSEP, ERRMSG=ERRMSG GOTO, HANDLE_ERROR ENDIF ; ; Figure out tick mark locations. ; TDIM = [6, 6, 5, 5, 6, 5, 4, 6, 5, 6, 4, 5, 6, 4, 6, 4, 4] TMIN = [5, 4, 3, 4, 5, 5, 4, 4, 4, 5, 5, 5, 5, 4, 4, 5, 5] TTYPE = ['F', 'F', 'F', 'F', 'F', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I',$ 'I', 'I', 'I'] CKVAL = [0.0, 0.5, 1.0, 1.6, 2.0, 3.0, 5.0, 8.0, 12., 20., 30., 40., 50., 60.,$ 80., 120., 200.] TMA = [0.1, 0.2, 0.3, 0.4, 0.5, 1.0, 2.0, 2.0, 4.0, 5.0, 10., 10., 10., 20., $ 20., 50., 50.] NDIM = N_ELEMENTS(TDIM) ITIC = WHERE(CKVAL LE 1.05*MAXVAL, MTIC) IF MTIC EQ 0 THEN BEGIN TM = FIX(ALOG10(MAXVAL)) LDIFF = ALOG10(MAXVAL) - TM TICKS = [0., 5.*10.^(TM-1), 10.^TM, 5.*10.^TM] IF LM GT 0.69897 THEN TICKS = [TICKS, 10.^(TM+1)] STICKS = STRTRIM(STRING(LONG(TICKS)), 2) NTIC = N_ELEMENTS(TICKS) NMINOR = 5 ENDIF ELSE BEGIN ITIC = ITIC[MTIC-1] TICKS = FINDGEN(TDIM[ITIC]) * TMA[ITIC] IF TTYPE[ITIC] EQ 'F' THEN STICKS = STRING(TICKS, FORMAT='(F3.1)') $ ELSE STICKS = STRTRIM(STRING(LONG(TICKS)), 2) NTIC = TDIM[ITIC] NMINOR = TMIN[ITIC] ENDELSE STICKS[0] = '' MINSEP = (TICKS[1] - TICKS[0]) / NMINOR ; IF EMESS NE '' THEN GOTO, HANDLE_ERROR IF N_ELEMENTS(ERRMSG) GT 0 THEN ERRMSG = EMESS RETURN ; ; Error handling portion of the procedure. ; HANDLE_ERROR: IF N_ELEMENTS(ERRMSG) NE 0 THEN ERRMSG = EMESS ELSE PRINT, EMESS ; RETURN END