>  Docs Center  >  Libraries  >  ASTROLIB  >  READ_FMR
Libraries

READ_FMR

READ_FMR

Name


  READ_FMR

Purpose


  Read a journal (ApJ, AJ) machine-readable table into IDL

Explanation


  Given a machine readable table name and optionally column
  numbers, this FUNCTION reads the format information in the
  meta-header and outputs a IDL function containing either the
  complete table or only the requested columns.

Calling Sequence


  data = read_fmr(filename)

Inputs


  filename [STRING]: the name of the file containing the machine
  readable table. If filename is missing a dialog to select the
  filename will be presented

Input Keyword Parameters


  /HELP - if set show the help
  COLUMNS - [(array of) integers or strings] of column(s) to be returned.
    If columns is of type integer they represent indices for which
    column numbers to return, if they are strings the columns with the
    corresponding names will be returned in the order as given.
  MISSINGVALUE [float]: value with which to replace the missing values in the
        table, default is NaN.
  /USE_COLNUM - If specified and non-zero then column names will be generated
        as 'C1, C2, .... Cn' for the number of columns in the table, rather
        than using the table names.

Outputs


  The ouput data structure will look like:
    TYPE STRING 'mr_structure'
    NAME STRING Array[X]
    UNIT STRING Array[X]
    DESCRIPTION STRING Array[X]
    DATA STRUCT -> <Anonymous> Array[1]
  where name contains the names of each columns
  unit contains the given units
  description contains the short descriptions and
  data holds the values of the separate columns. By default the tag names are
  taken from the column names, with modifications necessary to make them a
  valid tag name. For example, the column name 'B-V' will be converted to
  'B_V' to become a valid tag name. If the /USE_COLNUM keyword is set, then
  the column will be named C0, C1, ... , CX, where X stands for the total
  number of columns read.

Restrictions


  (1) The file to be read should be formatted as a machine readable datafile.
  (2) Use of the COLUMN keyword currently requires use of the EXECUTE, and so
      cannot be used with the IDL Virtural machine.

Example


  meas = read_fmr('smith.dat',col=[2,5,6], /Use_colnum)
  plot,meas.data.c1,ytitle=meas.name[1]+' ('+meas.unit[1]+')'
  and
  data = read_fmr('smith.dat',col=['Name','Date'], /Use_colnum)
  print,meas.data.c0
 

Modification History


  Version 1:
  Written by Sacha Hony (ESA) Nov 14 2003
  Based heavily on mrcolextract by Greg Schwarz (AAS Journals
  staff scientist) on 8/16/00.
  Version 1.1:
    Fixed bug where column=[3,4] always returned the first few columns
  VErsion 2.0 By default use column names as tag names W. Landsman Feb 2010



© 2024 NV5 Geospatial Solutions, Inc. |  Legal
   Contact Us