Extended IDL Help

This page was created by the IDL library routine mk_html_help. For more information on this routine, refer to the IDL Online Help Navigator or type:

     ? mk_html_help

at the IDL command line prompt.

Last modified: Mon Nov 27 21:23:23 2006.


List of Routines


Routine Descriptions

OC_AAREADME

[Next Routine] [List of Routines]
 NAME:
   oc_AAREADME
 PURPOSE
   Print the file 'oc_AAREADME.pro'
 CATEGORY:
  Occultation searching and star catalog reading (oc)
 CALLING SEQUENCE:
  oc_AAREADME
 
 ---------------------------------------------------------------------------
 FILES AND ENVIRONMENT VARIABLES
 ---------------------------------------------------------------------------
 
 
 $WCS_CATDIR  : directory with stellar catalogs
   |
   |- hd      : Henry Draper Catalog directory
       |
       |- catalog.dat : HD catalog 
       |      (from Vizier  http://vizier.u-strasbg.fr/ftp/cats/III/135A
       |       edited to replace '.' with ' 'in mags for  stars 37030 and 37023
       |
       |- catalog.dat.lookup : file with starting location and lengths of HD lines
       |
       |- catalog.wcs.dat : HD catalog in format for WCS tools (eg scat)
    

   $SAO_PATH : Smithsonian Astrophysical Observatory catalog
       |
       |- sao.dat : SAO catalog (from Vizier)
       |
       |- saora : RA-sorted SAO catalog in format for WCS tools (eg scat)

   $UCAC2_PATH : UCAC2 catalog
       |
       |- u2
           |
           |- u2index.txt
           |
           |- z001 ... z288

   $TY2_PATH : Tycho2 catalog
       |
       |- data
           |
           |- catalog.dat : Tycho2 catalog

 ---------------------------------------------------------------------------
 FUNCTIONS
 ---------------------------------------------------------------------------
 
 SEARCH CATALOGS
 oc_getline[_hd, _sao, _tyc2, _ucac2] 
   return catalog lines by id
 oc_getstar[_hd, _sao, _tyc2, _ucac2] 
   return star structures by id
 oc_search_pos_single[_hd, _sao, _tyc2, _ucac2] 
   return star structures near one position
 oc_search_pos_multiple
 oc_search_eph

 EVENT
 oc_x2f_rotmat - Return the matrix for rotating XYZ to FGH (should be naif?)

 UTILITY FUNCTIONS (NOT CALLED BY USER)
 oc_star_isempty : Indicates whether a star structure is empty or not
 oc_scat : search catalogs using scat, returning ids
 oc_star_set_empty : Sets a star structure(s) to be empty (i.e., invalid)
 oc_which_uniqev

 ---------------------------------------------------------------------------
 VARIABLES
 ---------------------------------------------------------------------------
 
 

 dec
 declination, Equinox J2000
 radians
 
 id
 star id, unique within a catalog
 string, scalar

 ids
 star ids, unique within a catalog
 string, scalar or array

 nstars
 counter - number of stars returned by a getline routine
 long

 ra
 right ascension, Equinox J2000
 radians
 
 radius
 search radius
 radians

 stars

 mk_html_help,['.','hd','sao','tyc2','tyc2_hd','ucac2'],'oc.html'
 ---------------------------------------------------------------------------

(See oc_AAREADME.pro)


OC_CONVERTID_UCAC2

[Previous Routine] [Next Routine] [List of Routines]
 NAME: 
  oc_convertid_ucac2
  
 PURPOSE: (one line)
  Convert UCAC2 ID's between standard format and SCAT format.

 DESCRIPTION:
  UCAC2 stars are intended to be identified by a sequential number 0 ..
  48,330,571.  However, WCSTools' SCAT program returns ID's in the form
  zone.index, where zone is 1 .. 288 and index is a sequential number within
  that zone.  This program converts between the two ID systems, by using the
  u2_index.txt file supplied with the UCAC2 catalog.

  The program converts from UCAC2 to SCAT ID's in order to parse
  the UCAC2 catalog directly.

  The program converts from SCAT to UCAC2 ID's in order to match
  SCAT's output to the standard stellar ID's.

 CATEGORY:
  Occultation
  
 CALLING SEQUENCE:
  result = oc_convertid_ucac2( SCAT=scat | UCAC2=ucac2 [, /VERBOSE] )

 INPUTS:
  SCAT -- SCAT-formatted ID's.  Single string or vector of strings.
    Floating point is not acceptable: 34.10 and 34.1 are different.
  UCAC2 -- Standard UCAC2 ID's.  Single string or vector of strings.

  Either SCAT or UCAC2 must be set, but not both.

 OPTIONAL INPUT PARAMETERS:
  None
  
 KEYWORD INPUT PARAMETERS:
  /VERBOSE -- Print error messages to screen for incorrect ID's.

 KEYWORD OUTPUT PARAMETERS:
  None

 OUTPUTS:
  Returns a list of ID's matching those passed in.  Input and output
    lengths are identical.  If a star is not found, 'none' is returned
    for its ID.
  
 COMMON BLOCKS:
  UCAC2_ID_COMMON -- Used to store index file so it is loaded
    only the first time this routine is called.

 SIDE EFFECTS:
  None

 RESTRICTIONS:
  The file $UCAC2_PATH/u2/u2index.txt must exist.  File is shipped
  with UCAC2 CD-ROM catalog.

 EXAMPLE:
   print, oc_convertid_ucac2(SCAT=['1.0', '2.10', '999.999'], /VERBOSE)
   IDL returns:  "none 00000885 none"
  
 MODIFICATION HISTORY:
  Written 11-Jan-2006 by Henry Throop, SwRI
  Modified  1-Feb-2005 by HBT. Improved error handling. 
  Modified 23-Feb-2006 by HBT. Improved documentation and formatting.
  Modified 26-Feb-2006 by LAY. Added '/' before 'u2/' (see scat code
                               usage)
  Modified 14-Apr-2006 by Leslie Young. Made loop index long.

(See ucac2/oc_convertid_ucac2.pro)


OC_GETLINE_HD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  oc_getline_hd

 PURPOSE: (one line)
  Return the raw catalog line from HD catalog for a given ID or IDs.

 DESCRIPTION:
  Return the raw catalog line from HD catalog for a given ID or IDs.
  The catalog line is a single line of text which is human-readable,
  although it must be carefully interpreted.

 This routine searches through the catalog using grep.  For small catalogs
 like this, grep is fast enough.
 

 CATEGORY:
  Star catalogs
  
 CALLING SEQUENCE:
  lines = oc_getline_hd( ids [, NSTARS=nstars] [, /VERBOSE])

 INPUTS:
  IDs -- A list of HD ID's.  Scalar or vector.
   IDs must be in HD format and are recommended to be strings, rather
   than numerical values, due to precision and wraparound.

 OPTIONAL INPUT PARAMETERS:
  None
  
 KEYWORD INPUT PARAMETERS:
  /VERBOSE -- If set, print diagnostics to screen.

 KEYWORD OUTPUT PARAMETERS:
  NSTARS -- Returns the number of successfully-retrieved lines.

 OUTPUTS:
  If input is a scalar, then output is a single string.
  If input is a vector, then output is an array of strings.
  If a star is not found, returned value is ''.
  
 COMMON BLOCKS:
  None

 SIDE EFFECTS:
  None

 RESTRICTIONS:
  HD catalog must be available at $WCS_CATDIR/hd/catalog.dat .

 EXAMPLE:
  print, oc_getline_hd(['430', '1000'])
 
 MODIFICATION HISTORY:
  Written   2-Nov-2005 by Henry Throop, SwRI
  Modified 27-Feb-2006 by HBT. Improved documentation and formatting.
  Modified 05-Mar-2006 by LAY. Change nstars to count (consistent
                               with oc_getline_ucac2)
  Modified 15-Mar-2006 by HBT. Undid LAY's nstars change (hah!), 
                               as it already was consistent w/ ucac2.
  Modifoed 23 Apr 2006 by LAY. Finished the undoing of nstars
                               (increment nstars, not count) and
                               chane spawn to call to nthline -
                               lookup table

(See hd/oc_getline_hd.pro)


OC_GETLINE_SAO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  oc_getline_sao

 PURPOSE: (one line)
  Return the raw catalog line from SAO catalog for a given ID or IDs.

 DESCRIPTION:
  Return the raw catalog line from SAO catalog for a given ID or IDs.
  The catalog line is a single line of text which is human-readable,
  although it must be carefully interpreted.

 This routine searches through the catalog using grep.  For small catalogs
 like this, grep is fast enough.
 

 CATEGORY:
  Star catalogs
  
 CALLING SEQUENCE:
  lines = oc_getline_sao( ids [, NSTARS=nstars] [, /VERBOSE])

 INPUTS:
  IDs -- A list of SAO ID's.  Scalar or vector.
   IDs must be in SAO format and are recommended to be strings or longs.

 OPTIONAL INPUT PARAMETERS:
  None
  
 KEYWORD INPUT PARAMETERS:
  /VERBOSE -- If set, print diagnostics to screen.

 KEYWORD OUTPUT PARAMETERS:
  NSTARS -- Returns the number of successfully-retrieved lines.

 OUTPUTS:
  If input is a scalar, then output is a single string.
  If input is a vector, then output is an array of strings.
  If a star is not found, returned value is ''.
  
 COMMON BLOCKS:
  None

 SIDE EFFECTS:
  None

 RESTRICTIONS:
  SAO catalog must be available at $WCS_CATDIR/sao/catalog.dat .

 EXAMPLE:
  print, oc_getline_sao(['430', '1000'])
 
 MODIFICATION HISTORY:
  Written   2-Nov-2005 by Henry Throop, SwRI
  Modified 27-Feb-2006 by HBT. Improved documentation and formatting.
  Modified 05-Mar-2006 by LAY. Change nstars to count (consistent
                               with oc_getline_ucac2)
  Modified 15-Mar-2006 by HBT. Undid LAY's nstars change (hah!), 
                               as it already was consistent w/ ucac2.
  Modified 10-Nov-2006 by LAY. Close opened lun.

(See sao/oc_getline_sao.pro)


OC_GETLINE_TYC2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  oc_getline_tyc2

 PURPOSE: (one line)
  Return the raw catalog line from TYC2 catalog for a given ID or IDs.

 DESCRIPTION:
  Return the raw catalog line from TYC2 catalog for a given ID or IDs.
  The catalog line is a single line of text which is human-readable,
  although it must be carefully interpreted.

  Because the TYC2 catalog is quite long (2M entries, 200M bytes), it is
  inefficient to read the whole thing in, or grep through it.  Instead, we
  use associative arrays to read individual arbitrary lines.

 CATEGORY:
  Star catalogs
  
 CALLING SEQUENCE:
  lines = oc_getline_tyc2( ids [, NSTARS=nstars] [, /VERBOSE])

 INPUTS:
  IDs -- A list of TYC2 ID's.  Scalar or vector.  String.
   IDs must be in standard TYC2 format.

 OPTIONAL INPUT PARAMETERS:
  None
  
 KEYWORD INPUT PARAMETERS:
  None

 KEYWORD OUTPUT PARAMETERS:
  NSTARS -- Returns the number of successfully-retrieved lines.
  /VERBOSE -- If set, print diagnostics to screen.

 OUTPUTS:
  If input is a scalar, then output is a single string.
  If input is a vector, then output is an array of strings.
  If a star is not found, returned value is ''.
  
 COMMON BLOCKS:
  None

 SIDE EFFECTS:
  None

 RESTRICTIONS:
  Tycho-2 catalog must be available at $WCS_CATDIR/tyc2/catalog.dat .

 EXAMPLE:
  lines = oc_getline_tyc2(['9537 03881', '000100017', '1-22'], nstars=nstars)
    [Reads in two valid stars and one invalid one, and sets NSTARS=2]

 MODIFICATION HISTORY:
  Written   1-Nov-2005 by Henry Throop, SwRI
  Modified 27-Feb-2006 by HBT. Improved documentation and formatting.
  Modified  7-Mar-2006 by LAY. Changed getenv to be consistent with scat

(See tyc2/oc_getline_tyc2.pro)


OC_GETLINE_TYC2_HD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  oc_getline_tyc2_hd

 PURPOSE: (one line)
  Return raw catalog line from TYC2<->HD conversion catalog. 

 DESCRIPTION:
  Return raw catalog line from TYC2<->HD conversion catalog, given 
  TYC2 or HD ID(s).

  This routine does not do the matching; it only retrieves 
  raw lines from the conversion catalog.  It is called by
  oc_getrec_tyc2_hd.pro, which is the end-user routine.
 
  The catalog is Vizier IV/25, Fabricius et al 2002.

 CATEGORY:
  Category
  
 CALLING SEQUENCE:
  lines = oc_getline_tyc2_hd( {HD=hd | TYC2=tyc2} [, NTH=nth], $
                               [, NSTARS=nstars]  [, /VERBOSE]

 INPUTS:
  HD   = hd    -- Either HD= *or* TYC2= must be passed.  Each is an ID 
  TYC2 = tyc2     or array of ID's, in the standard format for that catalog.

 OPTIONAL INPUT PARAMETERS:
  NTH -- Return the nth possible match for each star, if possible; if not,
         return a lower match.  E.g., there may be 2 TYC2 stars for 1 HD ID.
         Setting NTH=0 will return the first match for this star and
         NTH=1 with return the second match to the star.  For stars
         on which there is only one match, it will return the single
         match.
  
  /VERBOSE -- If set, print diagnostics to screen.

 KEYWORD INPUT PARAMETERS:
  None

 KEYWORD OUTPUT PARAMETERS:
  NSTARS -- Returns the number of successfully-retrieved lines.

 OUTPUTS:
  String or array of strings.  Same dimensions as input ID, regardless of
  multiple matches or non-matches.

  If HD=   is passed for input, returned values are for Tycho-2 stars.
  If TYC2= is passed for input, returned values are for HD stars.

  If a star has no match, an empty string is returned for that element.
  
 COMMON BLOCKS:
  None

 SIDE EFFECTS:
  None

 RESTRICTIONS:
  Tycho2-HD catalog must exist at $WCS_CATDIR/tyc2_hd/tyc2_hd.dat .

 EXAMPLE:
  print, oc_getline_tyc2_hd(HD=[0,1,10,100,1000,10000d], nstars=nstars, /VER)
   [Returns 5 matches and one non-match, setting nstars=5]
 
 MODIFICATION HISTORY:
  Written   3-Nov-2005 by Henry Throop, SwRI.
  Modified  7-Dec-2005 by HBT.  Improved multiple- and non-match handling.
  Modified 27-Feb-2006 by HBT.  Improved documentation and formatting.
  Modified  7-Mar-2006 by LAY.  Fixed bug in indexing line for nth>lines-1
                                and changed documentation to reflect nth=0..lines-1
  Modified 14-Apr-2006 by Leslie Young. Made loop index long.

(See tyc2_hd/oc_getline_tyc2_hd.pro)


OC_GETLINE_UCAC2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  oc_getline_ucac2
   
 PURPOSE: (one line)
  Retrieve the raw binary UCAC2 catalog line for a given ID or IDs.

 DESCRIPTION:
  This function retrieves the raw binary UCAC2 catalog line for a given ID or
  IDs.  The catalog line is a 44-byte sequence and is not human-readable.
  Therefore, this routine will not usually be called by an end-user.

 CATEGORY:
  Star catalogs.
  
 CALLING SEQUENCE:
  result = oc_getline_ucac2( IDs [,NSTARS=nstars] [,/VERBOSE] )

 INPUTS:
  IDs -- A list of UCAC2 ID's.  Must be string or array of strings.
   IDs can be in UCAC2 or SCAT format -- e.g., '004321897' or '216.212'.
   They must all be in the same format.

 OPTIONAL INPUT PARAMETERS:
  None
  
 KEYWORD INPUT PARAMETERS:
  None

 KEYWORD OUTPUT PARAMETERS:
  NSTARS -- Returns the number of successfully-retrieved lines.

 OUTPUTS:
  If input is a scalar, then output is byte array of size [44].
  If input is a vector, then output is byte array of size [num_ids, 44].
  If a star is not found, elements of that array are set to zero.

 COMMON BLOCKS:
  UCAC2ID_COMMON -- Used to store catalog index file.

 SIDE EFFECTS:
  None

 RESTRICTIONS:
  UCAC2 catalog must be available on local filesystem, 
  in files $UCAC2_PATH/u2/{z001 .. z288}

 EXAMPLE:
  lines = oc_getline_ucac2(['1.0', '1.1'], /VERBOSE)
  help, lines
  ; L               BYTE      = Array[2, 44]
 
 MODIFICATION HISTORY:
  Written  10-Jan-2006 by Henry Throop, SwRI
  Modified 23-Feb-2006 by HBT. Improved documentation and formatting.
  Modified 26-Feb-2006 by LAY. Added '/' before 'u2/' (see scat code
                               usage)
  Modified 27-Feb-2006 by HBT.  Changed keyword COUNT -> NSTARS.
  Modified 14-Apr-2006 by Leslie Young. Made loop index long.
  Modified 29-Jun-2006 by Leslie Young. Close open files on exit

(See ucac2/oc_getline_ucac2.pro)


OC_GETREC_TYC2_HD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  oc_getrec_tyc2_hd

 PURPOSE: (one line)
  Return structure that correlates TYC2 and HD catalogs, given stellar ID(s).

 DESCRIPTION:
  Return a fully-populated tyc2_hd record, based on a supplied Tycho-2 or HD
  ID.  The structure is similar to a star structure, but with 
  different fields.   The record can be used to match star with its
  counterpart(s) in the HD or Tycho-2 catalog.
 
  The structure type implements the fields in the Vizier ReadMe file
  for the catalog.  The catalog is Vizier IV/25, Fabricius et al 2002.

  Statistics: 272152 stars in HD catalog
              385 stars in tyc2_hd where 2 HD stars match  1 TYC2 star
              16  stars in tyc2_hd where 1 HD star matches 2 TYC2 stars
              ~400 HD stars which match no TYC2 star

 CATEGORY:
  Star catalogs
  
 CALLING SEQUENCE:
  lines = oc_getrec_tyc2_hd( {HD=hd | TYC2=tyc2} [, NTH=nth], $
                               [, NSTARS=nstars]  [, /VERBOSE]
 

 INPUTS:
  HD   = hd    -- Either HD= *or* TYC2= must be passed.  Each is an ID 
  TYC2 = tyc2     or array of ID's, in the standard format for that catalog.

 OPTIONAL INPUT PARAMETERS:
  NTH -- Return the nth possible match for each star, if possible; if not,
         return a lower match.  E.g., there may be 2 TYC2 stars for 1 HD ID.
         Setting NTH=0 will return the first match for this star and
         NTH=1 with return the second match to the star.  For stars
         on which there is only one match, it will return the single
         match.
  
  /VERBOSE -- If set, print diagnostics to screen.

 OPTIONAL INPUT PARAMETERS:
  None
  
 KEYWORD INPUT PARAMETERS:
  None

 KEYWORD OUTPUT PARAMETERS:
  NSTARS -- Returns the number of successfully-retrieved records.

 OUTPUTS:
  Structure or array of structures. Same dimensions as input ID, regardless
  of multiple matches or non-matches.

  If HD=   is passed for input, returned values are for Tycho-2 stars.
  If TYC2= is passed for input, returned values are for HD stars.

  If a star has no match, an empty structure is returned for that element.

  None
  
 COMMON BLOCKS:
  None

 SIDE EFFECTS:
  None

 RESTRICTIONS:
  Tycho2-HD catalog must exist at $WCS_CATDIR/tyc2_hd/tyc2_hd.dat .

 EXAMPLE:
  recs = oc_getrec_tyc2_hd(HD=[0,1,10,100,1000,10000d], nstars=nstars)
   [Returns 5 matches and one non-match, setting nstars=5]
 
 MODIFICATION HISTORY:
  Written   3-Nov-2005 by Henry Throop, SwRI
  Modified 30-Nov-2005 by HBT.  Fixed to read in n_hd, n_tyc properly.
                                Changed output format of .tyc2 field.
                                Improved handling of multiple- and 
                                non-matches.
  Modified  7-Dec-2005 by HBT.  Improved error handling.
  Modified 28-Feb-2006 by HBT.  Improved documentation and formatting.
  Modified  7-Mar-2006 by LAY.  Changed documentation to reflect nth=0..lines-1
  Modified 14-Apr-2006 by Leslie Young. Made loop index long.

(See tyc2_hd/oc_getrec_tyc2_hd.pro)


OC_GETSTAR_HD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  oc_getstar_hd

 PURPOSE: (one line)
  Returns HD star structures given their ID's.
  
 DESCRIPTION:
  Returns a fully-populated HD star structure for each ID supplied.
  The ID's must be in the HD format.  The star structure is returned in 
  the standard format, and includes the raw HD catalog line as well as 
  standard-format RA, DEC, magnitudes, etc.
 
 CATEGORY:
  Star catalogs
 
 CALLING SEQUENCE:
  stars = oc_getstar_hd(ids [, NSTARS=nstars] [, /VERBOSE])

 INPUTS:
  ids -- HD id's in string format.  Can be either scalar or vector.
         Either SCAT-format SCAT-format ('221.00434') or standard UCAC2 
           format ('00534450'), but all ids must be in the same format.

 OPTIONAL INPUT PARAMETERS:
  None

 KEYWORD INPUT PARAMETERS:
  VERBOSE -- Print messages about incorrect/missing ID's to screen if set.

 KEYWORD OUTPUT PARAMETERS:
  NSTARS -- Returns the number of successfully-retrieved stars

 OUTPUTS:
  Structures of type 'star' with fields filled in.  
  Returns either a vector or a scalar depending on input value 'ids'.
  Length of returned value is the same as that of input 'ids.'

  The field star.hd.record is the HD text catalog entry.
  The fields in star.hd.* are exactly as described in the 
    HD Vizier ReadMe file.
  If a star is not found, that entry is blank.
  
 COMMON BLOCKS:
  None

 SIDE EFFECTS:
  None

 RESTRICTIONS:
  HD catalog must be available at $WCS_CATDIR/hd/catalog.dat .

 EXAMPLE:
  print, (oc_getstar_hd(['0', '1000', '10000'])).id
    [Prints "none 1000 10000"]
 
 MODIFICATION HISTORY:
  Written  18-Oct-2005 by Henry Throop, SwRI
  Modified 30-Oct-2005 by HBT.  Fixed to read magnitudes properly.
  Modified  7-Dec-2005 by HBT.  Fixed to handle invalid ID's properly.
                                Changed SILENT->VERBOSE.
  Modified 27-Feb-2006 by HBT. Improved documentation and formatting.
  Modified 05-Mar-2006 by LAY. Change nstars to count (consistent
                               with oc_getline_ucac2)
  Modified 14-Mar-2006 by HBT.  Undid LAY's nstars change (hah!)
                               (It was already consistent.)
                                Fixed handling of undefined mag's
                                for HD=37020-37026.
  Modified 24-Mar-2006 by HBT.  Added fields for ETPM, RA_ETPM, etc.

(See hd/oc_getstar_hd.pro)


OC_GETSTAR_SAO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  oc_getstar_sao

 PURPOSE: (one line)
  Returns SAO star structures given their ID's.
  
 DESCRIPTION:
  Returns a fully-populated SAO star structure for each ID supplied.
  The ID's must be in the SAO format.  The star structure is returned in 
  the standard format, and includes the raw SAO catalog line as well as 
  standard-format RA, DEC, magnitudes, etc.
 
 CATEGORY:
  Star catalogs
 
 CALLING SEQUENCE:
  oc_getstar_sao, ids [, NSTARS=nstars] [, /VERBOSE]

 INPUTS:
  ids -- SAO id's in string format.  Can be either scalar or vector.
         Either SCAT-format SCAT-format ('221.00434') or standard UCAC2 
           format ('00534450'), but all ids must be in the same format.

 OPTIONAL INPUT PARAMETERS:
  None

 KEYWORD INPUT PARAMETERS:
  VERBOSE -- Print messages about incorrect/missing ID's to screen if set.

 KEYWORD OUTPUT PARAMETERS:
  NSTARS -- Returns the number of successfully-retrieved stars

 OUTPUTS:
  Structures of type 'star' with fields filled in.  
  Returns either a vector or a scalar depending on input value 'ids'.
  Length of returned value is the same as that of input 'ids.'

  The field star.sao.record is the SAO text catalog entry.
  The fields in star.sao.* are exactly as described in the 
    SAO Vizier ReadMe file.
  If a star is not found, that entry is blank.
  
 COMMON BLOCKS:
  None

 SIDE EFFECTS:
  None

 RESTRICTIONS:
  SAO catalog must be available at $WCS_CATDIR/sao/catalog.dat .

 EXAMPLE:
  print, (oc_getstar_sao(['0', '1000', '10000'])).id
    [Prints "none 1000 10000"]
 
 MODIFICATION HISTORY:
  

(See sao/oc_getstar_sao.pro)


OC_GETSTAR_TY2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  oc_getstar_ty2

 PURPOSE: (one line)
   Returns Tycho-2 star structures given their ID's.

 DESCRIPTION:
  Returns a fully-populated Tycho-2 star structure for each ID supplied.
  The ID's must be in the Tycho-2 format.  The star structure is returned in 
  the standard format, and includes the raw Tycho-2 data as well as 
  standard-format RA, DEC, magnitudes, etc.

  The Tycho-2 Supplement is not searched.

 CATEGORY:
  Star catalogs.
  
 CALLING SEQUENCE:
  oc_getstar_tyc2, ids [, NSTARS=nstars] [, /VERBOSE]

 INPUTS:
  ids -- Tycho-2 id's in string format.  Can be either scalar or vector.

 OPTIONAL INPUT PARAMETERS:
  None
  
 KEYWORD INPUT PARAMETERS:
  VERBOSE -- Print messages about incorrect/missing ID's to screen if set.

 KEYWORD OUTPUT PARAMETERS:
  NSTARS -- Returns the number of successfully-retrieved stars

 OUTPUTS:
  Structures of type 'star' with fields filled in.  
  Returns either a vector or a scalar depending on input value 'ids'.
  Length of returned value is the same as that of input 'ids.'
  The field star.tyc2.record is the Tycho-2 catalog entry line.
  The remaining fields in star.tyc2.* are exactly as described in the 
  Vizier Tycho-2 'ReadMe' file.

  If a star is not found, that entry is blank.
  
 COMMON BLOCKS:
  None

 SIDE EFFECTS:
  None

 RESTRICTIONS:
  Tycho-2 catalog must be available at $WCS_CATDIR/tyc2/catalog.dat .

 EXAMPLE:
   print, oc_getstar_tyc2(['9537-003881', '9537-00309'], nst=nst, /VERB)
 
 MODIFICATION HISTORY:
  Written  18-Oct-2005 by Henry Throop, SwRI
  Modified 30-Nov-2005 by HBT.  Fixed to properly parse TYC/HIP/CCDM fields.
  Modified  7-Dec-2005 by HBT.  Fixed to handle unfound stars.
  Modified  8-Dec-2005 by HBT.  Fixed units for position error and pm.
  Modified 23-Feb-2006 by HBT.  Improved documentation and formatting.
  Modified 28-Feb-2006 by HBT.  Fixed to handle missing positions (pflag='X')
  Modified 24-Mar-2006 by HBT.  Added handling of proper motion with 
                        ETPM, ra_etpm, etc.
  Modified 14-Apr-2006 by Leslie Young. Made loop index long.

(See tyc2/oc_getstar_tyc2.pro)


OC_GETSTAR_TYC2_TEST.PRO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  oc_getstar_tyc2_test.pro

 PURPOSE: (one line)
  Validates the oc_getstar_tyc2 routine by searching for Tycho-2 stars.

 DESCRIPTION:
  Searches for a large number of stars, using made-up ID's.  
  Some of these will be valid; most will be invalid.  The 
  results are printed, along with 'benchmark' results 
  to compare to to validate proper functionality.

  Then, prints a series of diagnostics to verify that proper motion
  is applied properly.
 
 CATEGORY:
  Star catalogs
  
 CALLING SEQUENCE:
  oc_getstar_tyc2_test

 INPUTS:
  None

 OPTIONAL INPUT PARAMETERS:
  None
  
 KEYWORD INPUT PARAMETERS:
  None

 KEYWORD OUTPUT PARAMETERS:
  None

 OUTPUTS:
  None
  
 COMMON BLOCKS:
  None

 SIDE EFFECTS:
  None

 RESTRICTIONS:
  Tycho-2 catalog must be available at $WCS_CATDIR/tyc2/catalog.dat .

 EXAMPLE:
  oc_getstar_tyc2_test
   [Makes a plot, and prints results along with benchmark results]
 
 MODIFICATION HISTORY:
  Written   2-Nov-2005 by Henry Throop, SwRI.
  Modified 28-Feb-2006 by HBT. Improved documentation and formatting.
  Modified 24-Feb-2006 by HBT. Added testing of proper motion fields.

(See tyc2/oc_getstar_tyc2_test.pro)


OC_GETSTAR_UCAC2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  oc_getstar_ucac2
  
 PURPOSE: (one line)
  Returns UCAC2 star structures given their ID's.
  
 DESCRIPTION:
  Returns a fully-populated UCAC2 star structure for each ID supplied.
  The ID's must be in the UCAC2 format.  The star structure is returned in 
  the standard format, and includes the raw UCAC2 data as well as 
  standard-format RA, DEC, magnitudes, etc.
 
 CATEGORY:
  Star catalogs
 
 CALLING SEQUENCE:
  oc_getstar_ucac2, ids [, NSTARS=nstars] [, /VERBOSE]

 INPUTS:
  ids -- UCAC2 id's in string format.  Can be either scalar or vector.
         Either SCAT-format ('221.00434') or standard UCAC2 
           format ('00534450'), but all ids must be in the same format.

 OPTIONAL INPUT PARAMETERS:
  None

 KEYWORD INPUT PARAMETERS:
  VERBOSE -- Print messages about incorrect/missing ID's to screen if set.

 KEYWORD OUTPUT PARAMETERS:
  NSTARS -- Returns the number of successfully-retrieved stars

 OUTPUTS:
  Structures of type 'star' with fields filled in.  
  Returns either a vector or a scalar depending on input value 'ids'.
  Length of returned value is the same as that of input 'ids.'
  The field star.ucac2.record is the UCAC2 raw binary catalog entry.
  The fileds in star.ucac2.* are exactly as described in the 
    UCAC2 CD-ROM 'readme.txt' file.
  If a star is not found, that entry is blank.
  
 COMMON BLOCKS:
  None

 SIDE EFFECTS:
  None

 RESTRICTIONS:
  UCAC2 catalog must be available on local filesystem, 
  in files $UCAC2_PATH/u2/{z001 .. z288}

 EXAMPLE:
   star = oc_getstar_ucac2(['35213093','35396495'])

 MODIFICATION HISTORY:
  Written  10-Jan-2006 by Henry Throop, SwRI
  Modified 23-Feb-2006 by HBT. Improved documentation and formatting.
  Modified 26-Feb-2006 by LAY. Allow scalar id. 
                       Fix bug in star.et (convert EpRAm and EpDEm to
                        double before averaging to avoid INT warparound)
                       Fixed comment above star.decer
                       Fixed conversion and cos dec factors in 
                        star.radot, decdot, radoterr, and decdoterr.   
  Modified 24-Mar-2006 by HBT.  Added handling of proper motion with 
                        ETPM, ra_etpm, etc.
  Modified 14-Apr-2006 by Leslie Young. Made loop index long.

(See ucac2/oc_getstar_ucac2.pro)


OC_HD_TYC2_TEST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  oc_hd_tyc2_test

 PURPOSE: (one line)
  Test to validate that HD -> TYC2 ID's can be properly matched.

 DESCRIPTION:
  Tests end-to-end HD search and matching to TYC2.  Makes a plot
  showing positions of HD and TYC2 stars.  This is a very
  extensive test, which validates many many routines.

  Program oc_test_tyc2_hd tests this in the opposite direction.

 CATEGORY:
  Star catalogs.
  
 CALLING SEQUENCE:
  oc_hd_tyc2_test

 INPUTS:
  None

 OPTIONAL INPUT PARAMETERS:
  None
  
 KEYWORD INPUT PARAMETERS:
  None

 KEYWORD OUTPUT PARAMETERS:
  None

 OUTPUTS:
  
 COMMON BLOCKS:
  None

 SIDE EFFECTS:
  None

 RESTRICTIONS:
  None

 EXAMPLE:
  oc_hd_tyc2_test
 
 MODIFICATION HISTORY:
  Written   4-Nov-2005 by Henry Throop, SwRI
  Modified 15-Dec-2005 by HBT. Minor changes.
  Modified 23-Feb-2006 by HBT. Improved documentation and formatting.
  Modified 24-Mar-2006 by HBT. Renamed oc_test_hd_tyc2 -> oc_hd_tyc2_test

(See tyc2_hd/oc_hd_tyc2_test.pro)


OC_SCAT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  oc_scat

 PURPOSE: (one line)
  call scat (Doug Mink) using spawn and report results

 DESCRIPTION:
  call scat (Doug Mink) using spawn and report results

 CATEGORY:
  Star catalogs.
  
 CALLING SEQUENCE: 
  ids = oc_scat(RA, DEC, RADIUS, NSTARS, catalog [, /VERBOSE] )

 INPUTS:
  RA     -- Right ascension of center of search position.  Radians, J2000.
  DEC    -- Declination     of center of search position.  Radians, J2000.
  RADIUS -- Search radius.  Radians. 
  NAME_CATALOG -- string.  Name of the catalog (as expected by scat)
                   act, gsc, ua2, usa2, or local file

  Inputs are single values, not arrays.

 OPTIONAL INPUT PARAMETERS:
  None

 KEYWORD INPUT PARAMETERS:
  /VERBOSE -- If set, print error messages to screen.

 OUTPUTS:
  ids -- Array of star ids found by scat (strings)
  NSTARS -- Number of stars found
  
 KEYWORD OUTPUT PARAMETERS:
  command -- the command called by spawn (string)
  scat -- the lines returned by scat (array of strings)
  

 COMMON BLOCKS:
  None

 SIDE EFFECTS:
  None

 RESTRICTIONS:
  
  This calls scat using spawn. Therefore, this 
  (1) only runs on unix operating systems and
  (2) must have scat installed.  
     http://tdc-www.harvard.edu/software/wcstools/index.html
  (3) The proper environment variable must be set for the catalog called.
     $TY2_PATH   -- For Tycho-2 catalog
     $WCS_CATDIR -- For HD and other WCS-based catalogs
     $UCAC2_PATH -- For UCAC2 catalog
     $TMC_PATH -- For 2MASS catalog
     This can be done prior to the call with (eg)
     setenv,'TY2_PATH=/Users/layoung/reference/stellar_cat/TYCHO2'

 EXAMPLE:
  print, getenv('WCS_CATDIR')
  ids = oc_scat(0.5, 0.5, 0.01, 'hd/catalog.wcs.dat', nstars)
  help, ids, nstars
  print, ids
  
 
 MODIFICATION HISTORY:
  Written  02-Jul-2006 by Leslie Young, SwRI, based on oc_search_pos_fullcat

(See oc_scat.pro)


OC_SEARCH_EPH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  oc_search_eph
 PURPOSE: (one line)
  Return array of star structures around ephemeris positions
 DESCRIPTION:
  Return array of star structures
 CATEGORY:
  occultation
 CALLING SEQUENCE:
 stars = oc_search_eph(eph, radius, single_fun, $
   nstars, _extra=extra,
   verbose=verbose)
 INPUTS:
  eph - ephemeris structure
  radius - search radius (radian) 
  single_fun - string name of search function for stars
   around one position.
   MUST BE OF THE FORM
   stars = single_func(ra, dec, radius, nstars, verbose=verbose,
   _extra=extra)
   where stars = -1 and nstars = 0 for no matches
 OPTIONAL INPUT PARAMETERS:
  none
 KEYWORD INPUT PARAMETERS:
  verbose : set (1) to print out information
  _extra : passed to single_func
 KEYWORD OUTPUT PARAMETERS:
  none
 OUTPUTS:
  nstars : number of stars found (0 if none)
  posindex : index array of length nstars into raArr and decArr
  returns array of star array (-1 if none found)
 COMMON BLOCKS:
  None
 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:
  call oc_search_pos_multiple, then ensure that a single event
  is only reported a single time. 
 EXAMPLE:
 miss = 1/206265.
 eph = oc_ephicy_arclen('Pluto', 'Earth', $
  '2007 Mar 18 00:00', '2007 Mar 19 00:00', 2*miss, neph)
 raArr = eph.ra
 decArr = eph.dec
 single_func = 'oc_search_pos_single_ucac2'
 stars = oc_search_eph(eph, sqrt(2)*miss, single_func, $
                           nstars, posindex, verbose=1)
 MODIFICATION HISTORY:
  Written 2005 December, by Leslie Young, SwRI
  2006 July 02 LAY comment out help command

(See oc_search_eph.pro)


OC_SEARCH_POS_MULTIPLE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  oc_search_pos_multiple 

 PURPOSE: (one line)
  Return array of star structures around multiple positions

 DESCRIPTION:
  Return array of star structures

 CATEGORY:
  occultation

 CALLING SEQUENCE:
 stars = oc_search_pos_multiple(raArr, decArr, radius, single_fun, $
   nstars, _extra=extra,
   verbose=verbose)

 INPUTS:
  raArr - right ascension (radian)
  decArr - declination (radian)
  radius - search radius (radian) 
  single_fun - string name of search function for stars
   around one position.
   MUST BE OF THE FORM
   stars = single_func(ra, dec, radius, nstars, verbose=verbose,
   _extra=extra)
   where stars = -1 and nstars = 0 for no matches

 OPTIONAL INPUT PARAMETERS:
  none

 KEYWORD INPUT PARAMETERS:
  verbose : set (1) to print out information
  _extra : passed to single_func

 KEYWORD OUTPUT PARAMETERS:
  none

 OUTPUTS:
  nstars : number of stars found (0 if none)
  posindex : index array of length nstars into raArr and decArr
  returns array of star array (-1 is none found)

 COMMON BLOCKS:
  None

 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:
 EXAMPLE:
 miss = 1/206265.
 eph = oc_ephicy_arclen('Pluto', 'Earth', $
  '2007 Mar 18 00:00', '2007 Mar 19 00:00', 2*miss, neph)
 raArr = eph.ra
 decArr = eph.dec
 single_func = 'oc_search_pos_single_ucac2'
 stars = oc_search_pos_multiple(raArr, decArr, sqrt(2)*miss, single_func, $
                           nstars, posindex, verbose=1)
 MODIFICATION HISTORY:
  Written 2005 December, by Leslie Young, SwRI
  Renamed from oc_search_multiple.pro, HBT, 15-Dec-2005
  Changed looping variable from int to long,LAY 08-Jan-2006
  Return if bad radius array, LAY 23-Apr-2006
  Pass verbose to called function LAY 02-July-2006

(See oc_search_pos_multiple.pro)


OC_SEARCH_POS_MULTIPLE_TYC2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  oc_search_pos_multiple_tyc2

 PURPOSE: (one line)
  Return array of star structures around multiple positions

 DESCRIPTION:
  Return array of star structures

 CATEGORY:
  occultation

 CALLING SEQUENCE:
 stars = oc_search_pos_multiple_tyc2(raArr, decArr, radius, nstars, $
   _extra=extra, verbose=verbose)

 INPUTS:
  raArr - right ascension (radian)
  decArr - declination (radian)
  radius - search radius (radian) 

 OPTIONAL INPUT PARAMETERS:
  none

 KEYWORD INPUT PARAMETERS:
  verbose : set (1) to print out information
  _extra : passed to single_func

 KEYWORD OUTPUT PARAMETERS:
  none

 OUTPUTS:
  nstars : number of stars found (0 if none)
  posindex : index array of length nstars into raArr and decArr
  returns array of star array (-1 is none found)

 COMMON BLOCKS:
  None

 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:
 MODIFICATION HISTORY:
  Written 2005 December, by Leslie Young, SwRI
  Renamed from oc_search_multiple.pro, HBT, 15-Dec-2005
  Changed looping variable from int to long,LAY 08-Jan-2006
  Return if bad radius array, LAY 23-Apr-2006

(See tyc2/oc_search_pos_multiple_tyc2.pro)


OC_SEARCH_POS_SINGLE_HD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  oc_search_pos_single_hd

 PURPOSE: (one line)
  Searches around a given position in the HD catalog.

 DESCRIPTION:
  This routine is a wrapper to oc_search_pos_fullcat/oc_search_pos_subcat .

 CATEGORY:
  Star catalogs

 CALLING SEQUENCE:
  oc_search_pos_single_hd, RA, DEC, RADIUS, NSTARS, 
   METHOD=method, _extra=extra

 INPUTS:
  RA     -- Right ascension of center of search position.  Radians, J2000.
  DEC    -- Declination     of center of search position.  Radians, J2000.
  RADIUS -- Search radius.  Radians. 

  Inputs are single values, not arrays.

 OPTIONAL INPUT PARAMETERS:
  METHOD -- either 'FULLCAT' or 'SUBCAT', for on search method requested.

 KEYWORD INPUT PARAMETERS:
  /VERBOSE -- If set, print diagnostics to screen.
  _extra -- Passed on 

 KEYWORD OUTPUT PARAMETERS:
  None

 OUTPUTS:
  result -- Array of structures [nstars], with each element being a 
    fully-populated star structure containing RA, Dec, magnitude, etc.
  NSTARS -- Number of stars found
  
 COMMON BLOCKS:
  None

 SIDE EFFECTS:
  None

 RESTRICTIONS:
  The proper environment variable must be set for the catalog called.
   $WCS_CATDIR/hd -- For HD catalog

 EXAMPLE:
  print, (oc_search_pos_single_hd(0.1, 0.1, 0.01, nstars)).ID
    [Locates three stars]

 MODIFICATION HISTORY:
  Written  10-Oct-2005 by Henry Throop, SwRI
  Modified  9-Dec-2005 by HBT. Improved to handle FULLCAT case.
  Modified 15-Dec-2005 by HBT.  Renamed oc_search_hd_single -> 
    oc_search_pos_single_hd
  Modified 27-Feb-2006 by HBT. Improved documentation and formatting.

(See hd/oc_search_pos_single_hd.pro)


OC_SEARCH_POS_SINGLE_SAO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  oc_search_pos_single_sao

 PURPOSE: (one line)
  Searches around a given position in the sao catalog.

 DESCRIPTION:
  This routine is a wrapper to oc_search_pos_fullcat/oc_search_pos_subcat .

 CATEGORY:
  Star catalogs

 CALLING SEQUENCE:
  oc_search_pos_single_sao, RA, DEC, RADIUS, NSTARS, 
   METHOD=method, _extra=extra

 INPUTS:
  RA     -- Right ascension of center of search position.  Radians, J2000.
  DEC    -- Declination     of center of search position.  Radians, J2000.
  RADIUS -- Search radius.  Radians. 

  Inputs are single values, not arrays.

 OPTIONAL INPUT PARAMETERS:
  METHOD -- either 'FULLCAT' or 'SUBCAT', for on search method requested.

 KEYWORD INPUT PARAMETERS:
  /VERBOSE -- If set, print diagnostics to screen.
  _extra -- Passed on 

 KEYWORD OUTPUT PARAMETERS:
  None

 OUTPUTS:
  result -- Array of structures [nstars], with each element being a 
    fully-populated star structure containing RA, Dec, magnitude, etc.
  NSTARS -- Number of stars found
  
 COMMON BLOCKS:
  None

 SIDE EFFECTS:
  None

 RESTRICTIONS:
  The proper environment variable must be set for the catalog called.
   $WCS_CATDIR/sao -- For sao catalog

 EXAMPLE:
  print, (oc_search_pos_single_sao(0.1, 0.1, 0.01, nstars)).ID
    [Locates three stars]

 MODIFICATION HISTORY:
  Written  10-Nov-2006 by Leslie Young, SwRI

(See sao/oc_search_pos_single_sao.pro)


OC_SEARCH_POS_SINGLE_TYC2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  oc_search_pos_single_tyc2

 PURPOSE: (one line)
 Searches for stars in the TYC2 catalog.

 DESCRIPTION:
 Searches for stars in the TYC2 catalog.

 CATEGORY:
  
 CALLING SEQUENCE:
  stars = oc_search_pos_single_tyc2(ra, dec, radius, nstars)

 INPUTS:
  ra:  J2000 RA  of search center (radians, double)
  dec: J2000 Dec of search center (radians, double)
  radius: Search radius (radians, double)


 OPTIONAL INPUT PARAMETERS:

 KEYWORD INPUT PARAMETERS:

 KEYWORD OUTPUT PARAMETERS:

 OUTPUTS:
  nstars: optional returned value which indicates number of stars found.

  Returned value:
    star: List of matching stars (array[nstars] of structures)

 RESTRICTIONS:

 PROCEDURES
   This routine searches the TYC2 catalog.  It is a wrapper routine to the 
   functions that actually do the searching.

 EXAMPLE:
     stars = oc_search_pos_single_tyc2(0.1, 0.1, 0.01, nstars)
 
 MODIFICATION HISTORY:
 Author: HBT
   30-Nov-2005: Original version HBT.  Based on oc_search_hd_single
   15-Dec-2005: Renamed from oc_search_tyc2_single.
  02-July-2006 Leslie Young; rewrite to call oc_scat

(See tyc2/oc_search_pos_single_tyc2.pro)


OC_SEARCH_POS_SINGLE_UCAC2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  oc_search_pos_single_ucac2
  
 PURPOSE: (one line)
  Searches around a given position in the UCAC2 catalog.

 DESCRIPTION:
  This routine is a wrapper to call oc_scat 
  (was a wrapper to oc_search_pos_fullcat).

 CATEGORY:
  Star catalogs

 CALLING SEQUENCE:
  oc_search_pos_single_ucac2, RA, DEC, RADIUS, NSTARS, _extra=extra

 INPUTS:
  RA     -- Right ascension of center of search position.  Radians, J2000.
  DEC    -- Declination     of center of search position.  Radians, J2000.
  RADIUS -- Search radius.  Radians. 

  Inputs are single values, not arrays.

 OPTIONAL INPUT PARAMETERS:
  None

 KEYWORD INPUT PARAMETERS:
  CATALOG= -- Name of the catalog to use; e.g., 'HD', 'TY2', 'UCAC2'.
    Defaults to 'HD' if not set.
  /VERBOSE -- If set, print error messages to screen.

 KEYWORD OUTPUT PARAMETERS:
  None

 OUTPUTS:
  result -- Array of structures [nstars], with each element being a 
    fully-populated star structure containing RA, Dec, magnitude, etc.
  NSTARS -- Number of stars found
  
 COMMON BLOCKS:
  None

 SIDE EFFECTS:
  None

 RESTRICTIONS:
  The proper environment variable must be set for the catalog called.
   $UCAC2_PATH -- For UCAC2 catalog

 EXAMPLE:
  print, (oc_search_pos_single_ucac2(0.1, 0.1, 0.01, nstars)).ID

 MODIFICATION HISTORY:
  Written 30-Jan-2006 by Henry Throop, SwRI
  02-July-2006 Leslie Young; rewrite to call oc_scat

(See ucac2/oc_search_pos_single_ucac2.pro)


OC_STAR_ISEMPTY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  oc_star_isempty

 PURPOSE: (one line)
  Indicates whether a star structure is empty or not.

 DESCRIPTION:
  Indicates whether a star structure is empty or not, based on the contents
  of numerous fields  within it.

  We make an educated guess as to whether the star is  empty or not, based
  on the number of fields that are 0, -999, 'none', or ''.  We could be
  wrong, but it's unlikely.  There is not a single field that indicates
  an empty star; we require all examined fields to be empty.

  This routine works for *stars*.  It does not work for, e.g., matching
  catalogs such as tyc2_hd.
  
 CATEGORY:
  Star catalogs
  
 CALLING SEQUENCE:
  result = is_empty(star)

 INPUTS:
  star -- Star structure(s).  Either scalar or vector.

 OPTIONAL INPUT PARAMETERS:
  None
  
 KEYWORD INPUT PARAMETERS:
  None

 KEYWORD OUTPUT PARAMETERS:
  None

 OUTPUTS:
  Boolean flag, 1 or 0.  Returned value is a double rather than an int,
  because IDL's not() function can return nonintuitive results on ints.

  Output is a scalar or vector, with one element for each element of input.
  
 COMMON BLOCKS:
  None

 SIDE EFFECTS:
  None

 RESTRICTIONS:
  None

 EXAMPLE:
  print, oc_star_isempty(oc_getstar_ucac2(['1.0', '1.1']))
    Returns "1.0 0.0" because first ID is invalid.
 
 MODIFICATION HISTORY:
  Written   7-Dec-2005 by Henry Throop, SwRI
  Modified 27-Feb-2006 by HBT. Improved documentation and formatting.
  Modified 14-Apr-2006 by Leslie Young. Made loop index long.

(See oc_star_isempty.pro)


OC_STAR_SET_EMPTY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  oc_star_set_empty

 PURPOSE: (one line)
  Sets a star structure(s) to be empty (i.e., invalid).

 DESCRIPTION:
  Sets a star structure(s) to be empty (i.e., invalid).

 CATEGORY:
  Star catalogs
  
 CALLING SEQUENCE:
  empty = oc_star_set_empty(stars)

 INPUTS:
  stars -- Star or array of stars to be set empty.

 OPTIONAL INPUT PARAMETERS:
  None
  
 KEYWORD INPUT PARAMETERS:
  None

 KEYWORD OUTPUT PARAMETERS:
  None

 OUTPUTS:
  Returns the newly-emptied stars.
  
 COMMON BLOCKS:
  None

 SIDE EFFECTS:
  None

 RESTRICTIONS:
  None

 EXAMPLE:
  print, oc_star_isempty(oc_star_set_empty(oc_getstar_hd('100')))
     [Prints 1, to indicate that star is empty]
 
 MODIFICATION HISTORY:
  Written   7-Dec-2005 by Henry Throop, SwRI
  Modified 28-Feb-2006 by HBT.  Improved documentation and formatting.
                                Renamed oc_star_set_invalid -> 
                                        oc_star_set_empty.
  Modified 14-Apr-2006 by Leslie Young. Made loop index long.

(See oc_star_set_empty.pro)


OC_TEST_HD_TYC2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  oc_test_hd_tyc2

 PURPOSE: (one line)
  Test to validate that HD -> TYC2 ID's can be properly matched.

 DESCRIPTION:
  Tests end-to-end HD search and matching to TYC2.  Makes a plot
  showing positions of HD and TYC2 stars.  This is a very
  extensive test, which validates many many routines.

  Program oc_test_tyc2_hd tests this in the opposite direction.

 CATEGORY:
  Star catalogs.
  
 CALLING SEQUENCE:
  oc_test_hd_tyc2

 INPUTS:
  None

 OPTIONAL INPUT PARAMETERS:
  None
  
 KEYWORD INPUT PARAMETERS:
  None

 KEYWORD OUTPUT PARAMETERS:
  None

 OUTPUTS:
  
 COMMON BLOCKS:
  None

 SIDE EFFECTS:
  None

 RESTRICTIONS:
  None

 EXAMPLE:
  oc_test_hd_tyc2
 
 MODIFICATION HISTORY:
  Written   4-Nov-2005 by Henry Throop, SwRI
  Modified 15-Dec-2005 by HBT. Minor changes.
  Modified 23-Feb-2006 by HBT. Improved documentation and formatting.

(See tyc2_hd/oc_test_hd_tyc2.pro)


OC_TEST_TYC2_HD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  oc_test_tyc2_hd

 PURPOSE: (one line)
  Test end-to-end TYC2 search and cross-matching with HD.

 DESCRIPTION:
  Makes plot showing positions of HD and TYC2 stars.

  Takes several minutes to run.

 CATEGORY:
  Star catalogs
  
 CALLING SEQUENCE:
  oc_test_tyc2_hd

 INPUTS:
  None

 OPTIONAL INPUT PARAMETERS:
  None
  
 KEYWORD INPUT PARAMETERS:
  None

 KEYWORD OUTPUT PARAMETERS:
  None

 OUTPUTS:
  
 COMMON BLOCKS:
  None

 SIDE EFFECTS:
  None

 RESTRICTIONS:
  None

 EXAMPLE:
  oc_test_tyc2_hd
 
 MODIFICATION HISTORY:
  Written  30-Nov-2005 by Henry Throop, SwRI.  Based on oc_test_hd_tyc2, 
                                which is the same in opposite direction.
  Modified  7-Dec-2005 by HBT.  Minor changes.
  Modified 23-Feb-2006 by HBT.  Improved documentation and formatting.

(See tyc2_hd/oc_test_tyc2_hd.pro)


OC_TYC2_HD_TEST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  oc_tyc2_hd_test

 PURPOSE: (one line)
  Test end-to-end TYC2 search and cross-matching with HD.

 DESCRIPTION:
  Makes plot showing positions of HD and TYC2 stars.

  Takes several minutes to run.

 CATEGORY:
  Star catalogs
  
 CALLING SEQUENCE:
  oc_tyc2_hd_test

 INPUTS:
  None

 OPTIONAL INPUT PARAMETERS:
  None
  
 KEYWORD INPUT PARAMETERS:
  None

 KEYWORD OUTPUT PARAMETERS:
  None

 OUTPUTS:
  
 COMMON BLOCKS:
  None

 SIDE EFFECTS:
  None

 RESTRICTIONS:
  None

 EXAMPLE:
  oc_tyc2_hd_test
 
 MODIFICATION HISTORY:
  Written  30-Nov-2005 by Henry Throop, SwRI.  Based on oc_test_hd_tyc2, 
                                which is the same in opposite direction.
  Modified  7-Dec-2005 by HBT.  Minor changes.
  Modified 23-Feb-2006 by HBT.  Improved documentation and formatting.
  Modified 24-Mar-2006 by HBT.  Renamed oc_test_tyc2_hd -> oc_tyc2_hd_test.

(See tyc2_hd/oc_tyc2_hd_test.pro)


OC_WHICH_UNIQEV

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
  oc_which_uniqev
 PURPOSE: (one line)
  find the unique events from a list of matching stars and positions
 DESCRIPTION:
 given a list of indexes and a list of values 
 return indices g s.t. j[g] has the smallest distance
 for a run of contiguous j's (one per group of contiguous j's)
 CATEGORY:
  occultation
 CALLING SEQUENCE:
  iuniq = oc_which_uniqev(ra, dec, posindex, stars, nstars, nuniq)
 INPUTS:
  ra - array of right ascention of ephemeris points (radians)
  dec - array of declination of ephemeris points (radians)
    ra and dec are implicitly assumed to be in chronological order
  posindex - array nstars long of index into ra and dec
    stars[i] is near ra[posindex[i]], dec[posindex[i]]
  stars - list of stars near ra, dec points
  nstars - number of stars
 OPTIONAL INPUT PARAMETERS:
  none
 KEYWORD INPUT PARAMETERS:
 KEYWORD OUTPUT PARAMETERS:
  none
 OUTPUTS:
  nuniq - number of unique stars near ra, dec
  iuniq - indices of unique stars
 COMMON BLOCKS:
  None
 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:
  A single star can be near more than one ra, dec.  If the ra, dec
  are continuous, then this is a single event, and the index is the
  index of minimum separation.  Discontinuous runs of ra, dec are
  treated as different events.
 MODIFICATION HISTORY:
  Written 2005 January, by Leslie Young, SwRI

(See oc_which_uniqev.pro)


OC_X2F_ROTMAT

[Previous Routine] [List of Routines]
 NAME:
  oc_x2f_rotmat
 PURPOSE: (one line)
  Return the matrix for rotating XYZ to FGH 
 DESCRIPTION:
  Return the matrix for rotating XYZ to FGH 
 CATEGORY:
  Occultations
 CALLING SEQUENCE:
  R = oc_x2f_rotmat(ra, dec)
 INPUTS:
  ra - right ascension of occultation star in radians
  dec - declination of occultation star in radians
 OPTIONAL INPUT PARAMETERS:
  none
 KEYWORD INPUT PARAMETERS:
  none
 KEYWORD OUTPUT PARAMETERS:
  none
 OUTPUTS:
  R - rotation matrix for rotating an XYZ vector to FGH
    XYZ are defined in the usual manner
     X = cos(ra_s) cos(dec_s)
     Y = sin(ra_s) cos(dec_s)
     Z =     sin(dec_s)

   FGH are defined as in Elliot et al. 1993. Astron. J. 106, 2544-2572
     H is toward the occultation star
     F is perpendicular to H and Z (Z x H)
     G completes the right hand system
 COMMON BLOCKS:
  None
 SIDE EFFECTS:
 RESTRICTIONS:
  None
 PROCEDURE:
  The function returns the matrix
           -sin(ra)               cos(ra)           0
       -cos(ra) sin(dec)  -sin(ra) sin(dec)  cos(dec)
        cos(ra) cos(dec)   sin(ra) cos(dec)  sin(dec)      
  
 USE:
  The matrix is defined so that
       fgh = R ## xyz     ; fgh, xyz column vectors
  where fgh and xyz are column vectors (Array[1,3]) and ## is the
  IDL operator for ordinary matrix multiplication (inner product).
  It is usually more convenient to use xyz and fgh as row vectors
  (Array[3]).  In this case we have
       fgh = transpose(R) # xyz     ; fgh, xyz row vectors

 MODIFICATION HISTORY:
  2005 Aug 19 Leslie A Young SwRI
  2005 Dec 28, LAY.  
    Added documentation, added function to $layoung/oc/. 

(See oc_x2f_rotmat.pro)