NEW QUANTITY







Syntax




   NEW QUANTITY @name DESCRIPTION (1:)@word
 
     (0:4){ FORMAT (1:)@word
          | UNITS @word
          | HEADING (1:)@word
          | NO LEGEND }
 
Optional Syntax:

   NEW! QUANTITY @name DESCRIPTION (1:)@word
     (0:4){ FORMAT (1:)@word
          | UNITS @word
          | HEADING (1:)@word
          | NO LEGEND }


Description




The NEW QUANTITY command is used to name a quantity that can then be used as part of a report or FIND command. Quantities have 5 parts: a name, a description, formatting information, an optional heading and an option to preclude this quantity from showing up in a legend for any report that might include this quantity.

If you specify a quantity using the NEW QUANTITY version of this command, for a quantity that has already been named, PERCY will not overwrite the existing quantity. Instead you will be informed that you are duplicating a quantity name and the command will have no effect. If you really want to overwrite an existing quantity you have two options:



Entry Descriptions



Every QUANTITY has a descriptive clause that describes the value associated with the quantity. This clause is the

   DESCRIPTION (1:)@word
portion of the NEW QUANTITY command. In addition, every quantity has associated with it a print format and units in which it may be displayed. These are specified through the optional FORMAT and UNITS clauses given in the syntax description. Syntactic descriptions of all available quantities, allowed units and formats are given below.



Time



The time quantity is used to have times associated with other quantities appear in reports. The description for the time quantity is very simple.

   TIME
 
   FORMAT @system
Units are ignored in the TIME quantity as they are included in the FORMAT description. Acceptable systems to supply as time format are: UTC, DOY, JED, JDUTC, and SP2000TDB (seconds past the ephemeris epoch J2000 TDB).

In addition to these predefined formats for time output, PERCY allows you to create your own format as well as select any of the time systems: TDB, TDT or UTC. To do this you supply a ``picture'' that represents how time should be portrayed. In this case the TIME description takes the form:

   TIME
 
   FORMAT @picture
For example, the format picture

   YYYY-DOY.HR:MN:SC.###
produce time strings such as

   1992-231.12:18:57.221
A more complete discussion of formatting time strings is provided in the chapter About Time Formats.



Angles



A number of angular quantities may be specified as entries. You may supply either a picture for the output of these angles

Picture format has the form such as xxx.xxxxx.

The units specified must be appropriate angular units or angular rate units.

   ANGULAR  RATE     OF @body       FROM @obs RELATIVE @body
   APPARENT DIAMETER OF @body       FROM @obs
   ELONGATION        OF @body       FROM @obs
   PHASE             OF @body       FROM @obs
   SEPARATION        OF @body @body FROM @obs
 
   FORMAT @fmt UNITS @units


Distances



A number of quantities are available that yield the distances between solar system bodies and designated objects. Formats should be picture formats. Units must be appropriate distance and distance rate units.

   DISTANCE BETWEEN @body @body  FROM @obs
   DISTANCE OF      @body        FROM @obs
 
   DISTANCE RATE BETWEEN @body @body  FROM @obs
   DISTANCE RATE OF      @body        FROM @obs
 
   FORMAT @fmt UNITS @units


Inertial Coordinates



All of the basic inertial coordinates and their derivatives are available for use as quantities. Allowed coordinates are: X, Y, Z, RA (right ascention), DEC (declination) and RANGE. The derivatives of these quantities are specified by: DX, DY, DZ, DRA DDEC and DRANGE respectively. Picture formats are used to specify the format. Units must be appropriate for the coordinate specified.

   FRAME @name @coordinate OF @body FROM @obs
 
   FORMAT @fmt UNITS @units


Position Angles



The following quantities allow you to retrieve position angles of one object relative to another as seen from a specified observation point. Formats should be picture formats. Units must be angular units.

   NORTH POSITION ANGLE OF @body FROM @obs RELATIVE @body
   SOLAR POSITION ANGLE OF @body FROM @obs RELATIVE @body
 
   FORMAT @fmt UNITS @units
The syzygy quantities are ``boolean'' quantities. They either are not or are in the condition specified. Formats are specified by concatenating a marker character (implied by the first character of the format word) followed by a ``not in state'' string. This is followed by the marker character and the ``in state'' string. For example a possible format for the occultation quantity would be

   FORMAT "-Visible-Occulted"
The marker character in this case is the hyphen ``-''. When the objected specified is not occulted the word ``Visible'' would be used to report the value of the quantity. When the object is occulted, the word ``Occulted'' would be used to report its value.

   OCCULTATION       OF @body BY     @body FROM @obs
   TRANSIT           OF @body ACROSS @body FROM @obs
   ECLIPSE           OF @body BY     @body FROM @obs
   PENUMBRAL ECLIPSE OF @body BY     @body FROM @obs
   UMBRAL ECLIPSE    OF @body BY     @body FROM @obs
 
   FORMAT @no-yes


Body-relative Coordinates



The following quantities allow you to determine body-fixed positions of one object relative to another as seen from a third.

   CENTRAL MERIDIAN LONGITUDE OF @body FROM @obs
 
   CARTOGRAPHIC   @coordinate OF @body RELATIVE @body FROM @obs
   PLANETOCENTRIC @coordinate OF @body RELATIVE @body FROM @obs
   PLANETOGRAPHIC @coordinate OF @body RELATIVE @body FROM @obs
 
   FORMAT @fmt UNITS @units
For Cartographic and Planetocentric entries, acceptable coordinates are: LATITUDE, LONGITUDE, RADIUS, LATITUDE RATE, LONGITUDE RATE, RADIUS RATE. For Planetographic entries, acceptable coordinates are: LATITUDE, LONGITUDE, HEIGHT, LATITUDE RATE, LONGITUDE RATE, HEIGHT RATE. Units for latitude and longitude must be angular. For radius and height, units must be units of distance. Rate quantities must be angular rates and distance rates respectively. Formats must be picture formats.

Orbital longitude entries return the orbital longitude of a body relative to its center of motion. The syntax for this quantity is

   ORBITAL LONGITUDE OF @body FROM @obs
 
   FORMAT @fmt UNITS @units
Formats should be picture formats. Units must be angular units.



Creating a column heading for a quantity



When you create a new quantity you specify a name that you can then use to refer the quantity later in your PERCY session. However, this name may not be what you care to have appear in a report heading when the quantity it appears in a report. For this reason you may create a more suitable heading for this quantity using the optional

   HEADING (1:)@word
clause of the NEW QUANTITY command. Your heading must be limited to 32 or fewer characters.



Inhibiting appearance in report legends



Quantities support the GENERATE REPORT facility of PERCY. When a report is generated, you may specify that a "legend" be printed at the top of the first page of the report. The legend describes the various entries appearing in the report. However, the meaning of an item may be clear from the heading you have selected for a quantity. In such a case, you may prefer to save space on the first page by not including the quantity description in the report's legend, thus keeping the legend smaller and allowing more room for data-lines. To do this include the

   NO LEGEND
clause in your new quantity definition. By doing so you ensure that any report referring to this quantity will not include a description of the quantity in the report legend.



Examples




Here is how you could create a report that gives the right ascesion, declination and elongation of Mars as a function of time.

   NEW QUANTITY TIME DESCRIPTION TIME FORMAT UTC HEADING "Time" NO LEGEND;
 
   NEW QUANTITY ELONG DESCRIPTION ELONGATION OF MARS FROM EARTH
                   FORMAT  XXXXXXXXX.XX UNITS DEGREES
                   HEADING "Elongation of Mars";
 
   NEW QUANTITY RA    DESCRIPTION FRAME J2000 RA OF MARS FROM EARTH
                   FORMAT XXX.XXXX UNITS DEGREES
                   HEADING "R.A.";
 
   NEW QUANTITY DEC   DESCRIPTION FRAME J2000 DEC OF MARS FROM EARTH
                   FORMAT XXX.XXXX UNITS DEGREES
                   HEADING "Dec.";
 
   NEW REPORT MARS_DATA ENTRIES TIME ELONG RA DEC;
 
   GENERATE SMART REPORT MARS_DATA FROM 1 JAN 1991 TO 1 DEC 1991
                         EVERY 2 WEEKS HEADER LEGEND;
The resulting report would look like this:

            Elongation of Mars --- ELONGATION OF 4 FROM 399 FORMAT
                                   XXXXXXXXXX.XX UNITS DEGREES
            R.A.               --- J2000 RIGHT ASCENSION OF 4 FROM 399
                                   FORMAT XXX.XXXX UNITS DEGREES
            Dec.               --- J2000 DECLINATION OF 4 FROM 399 FORMAT
                                   XXX.XXXX UNITS DEGREES
 
            Corrections for Stellar aberration are enabled.
 
                     Time   Elongation of         R.A.         Dec.
                    (utc)            Mars    (degrees)    (degrees)
                                (degrees)
   ===================================================================
   1991 JAN 01 00:00:00.0          137.37      55.0480      21.9656
   1991 JAN 15 00:00:00.0          124.23      56.1913      22.2655
   1991 JAN 29 00:00:00.0          113.15      59.5303      22.9024
   1991 FEB 12 00:00:00.0          103.61      64.5064      23.6961
   1991 FEB 26 00:00:00.0           95.20      70.6984      24.4673
   1991 MAR 12 00:00:00.0           87.64      77.7730      25.0608
   1991 MAR 26 00:00:00.0           80.71      85.4918      25.3570
   1991 APR 09 00:00:00.0           74.28      93.6486      25.2694<
   1991 APR 23 00:00:00.0           68.24     102.0850      24.7425
   1991 MAY 07 00:00:00.0           62.53     110.6585      23.7505
   1991 MAY 21 00:00:00.0           57.07     119.2652      22.2909
   1991 JUN 04 00:00:00.0           51.83     127.8227      20.3835
   1991 JUN 18 00:00:00.0           46.77     136.2862      18.0612
   1991 JUL 02 00:00:00.0           41.85     144.6339      15.3698
   1991 JUL 16 00:00:00.0           37.05     152.8740      12.3594
   1991 JUL 30 00:00:00.0           32.34     161.0326       9.0869
   1991 AUG 13 00:00:00.0           27.70     169.1546       5.6101
   1991 AUG 27 00:00:00.0           23.12     177.2969       1.9915
   1991 SEP 10 00:00:00.0           18.58     185.5263      -1.7037
   1991 SEP 24 00:00:00.0           14.08     193.9168      -5.4040
   1991 OCT 08 00:00:00.0            9.61     202.5447      -9.0311
   1991 OCT 22 00:00:00.0            5.18     211.4876     -12.4972
   1991 NOV 05 00:00:00.0            0.79     220.8132     -15.7039
   1991 NOV 19 00:00:00.0            3.01>    230.5768     -18.5434
 


Related Topics




  1. About Time Formats
  2. Forget Quantity
  3. About Reports
  4. The Percy Help System