Home Download Tutorial 1 Tutorial 2 Tutorial 3 Tutorial 4 Tutorial 5

 

These routines are contributions from research projects, they are not part of the ULySS package. These programs are not necessarily as extensively documented nor as well tested as the main package routines. They are provided with the hope they can be helpful.

Feed-back and submission of other routines are welcome.

List of Routines

AUX_ALONG Derive age/metallicity profiles for long-slit spectra
AUX_PLONG Plot age/metallicity profiles for long-slit spectra
AUX_PSFH Plot the SFH resulting from n-SSPs fit
AUX_READ_GALAXEV Read a grid of GalaxEV models
AUX_READ_PEGASE Read a grid of Pegase.HR models
AUX_READ_VAZMILES Read a grid of Vazdekis models
AUX_SFH Determine a star formation history

Routine Descriptions

AUX_ALONG

[Next Routine] [List of Routines]
 NAME:
                  AUX_ALONG
 PURPOSE:
                  Derive age/metallicity profiles for long-slit spectra
 USAGE:
                  aux_along, <obs>, <cmp>, <target_sn>, <file_out>, /PLOT,
                        MD=md, KMOMENT=kmoment,
                        CENTER=center

 DESCRIPTION:
   <obs> shall be a spect structure containing the long-slit spectrum.
   The program search the peak of light (center of the galaxy),
   and analyse the data successively from each side of the peak.
   The data are binned together to reach <target_sn>, but if the 
   radial range assembled in one bin reach rmax/rmin=1.4 the target_sn
   is reduced. The profile is stopped when it is not possible to get
   a bin with sn>5.

   The output of this program is a series of FITS and res files, each
   of them corresponding to a single point of the profile.
   The file names are made by attaching 'r'<rad> to the prefix <file_out>,
   where <rad> is the value of the radius (positive or negative).

 ARGUMENTS:
  <spectrum> -  input 
                2d spectrum structure (definined with ULY_SPECT_ALLOC) 

  <cmp>      -  input
                Array of models' components, see ULY_FIT.
                Prior calls to ULY_STAR, ULY_TGM, ULY_SSP and/or ULY_LINE
                can define this array and set the guesses and constraints
                on the free parameters.
                MODEL_FILE can be given instead.

  <target_sn>-  input
                Targeted S/N ratio; data are binned together to rich
                this value

  <file_out> -  input, string
                output file name, to which suffix with the readious
                and '.res'/'.fits' are attached

 KEYWORDS:
   /PLOT
      Plot ulyss fit

    MD 
      Degree of multiplicative polynomial, to be passed to ulyss (see
      ulyss.pro documentation)

    KMOMENT 
      Number of terms in LOSVD, default 2 - velocity, velocity dispersion

    CENTER
      Index of the center line. By default it is automatically determined
      as the peak of light.

 HISTORY:
    MK: 2009/09  
      Creation 
   PhP: 2010/05/25
      Do the fit in 2 steps (first clean, after global minimization)
      Dismiss the bad fits (as much as I could)
   PhP: 2010/06/23
      Make the program more general, to be usable for any longslit
      spectra
    MK: 2012/10/24 
      Documentation

(See aux_along.pro)


AUX_PLONG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
                  AUX_PLONG
 PURPOSE:
                  Plot age/metallicity profiles for long-slit spectra
 USAGE:
                  aux_plong, <nm>, PS=ps, /NOLOSVD, /NOPOP, CHI2=chi2, HOR_AGE=hor_age, HOR_MET=hor_met, VER=ver, /NOYTIT, /NYLAB, /LOGF, XTIT=xtit, CODK=codk, IRAD=irad, GALNAME=galname, XRANGE=xrange, CZRANGE=czrange, SIGRANGE=sigrange, AGERANGE=agerange, METRANGE=metrange

 DESCRIPTION:
                Plot the kin+SSP profile generated with the program AUX_ALONG
                Each point is a separate '.res' file named as: <nm>'_r'<rad>'.res'
                where <nm> is the generic name of the analysed frame, and <rad>
                is the position along the slit, in arcsec.

 ARGUMENTS:
  <nm>       -  input 
                The prefix denoting the name (path+name) of the
                analysed frame; indentical to <file_out> in AUX_ALONG

 KEYWORDS:
    PS
      Save the plot in a postscript file named <ps>
    /NOLOSVD
      Do not plot the kinematics
    /NOPOP 
      Do not plot the age/metallicity profiles
    /CHI2
      Plot the chi2 values
    HOR_AGE [Gyr]
      Overplot age = [<real1>,<real2>]. For example the
      mean age at 1 arcsec and 1 effective radius
    HOR_MET [dex]
      Same as hor_age but for metallicity 
    VER [dimensionless]
      Overplot as a vertical line the effective radius of the galaxy, real
    /NOYTIT
      Do not plot the title of the y-axes
    /NYLAB
      Do not plot the labels of the y-axes
    /LOGF
      Plot the flux in log
    XTIT
      x-axis title, string 
    CODK [dimensionless]
      Coding of the symbols for each individual profile. Useful if
      few data sets are overplotted
        0 : red/blue
        1 : magenta/cyan
        2 : black 
        3 : continuous line
    IRAD
    GALNAME
      Name of the galaxy, to be overplotted in the right upper
      corner, string 
    XRANGE default = [0, abs(max(<rad>))]
      array with the x-axis plotting range
    CZRANGE [km/s]
      Plotting range for cz
    SIGRANGE [km/s]
      Velocity dispersion range
    AGERANGE [Gyr]
      Age range
    METRANGE [dex]
      metallicity range

 HISTORY:
    MK: 2009/09  
      Creation, used for 2009MNRAS.396.2133K
    PhP: 2010/05/26
      Modifications for 2011MNRAS.417.1643K
    MK: 2012/10/26 
      Documentation

(See aux_plong.pro)


AUX_PSFH

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

 PURPOSE:
                  Plot the SFH resulting from n-SSPs fit   

 USAGE:
                  plot_sfr, <filename>, PS=ps, \OVER, TIMESHIFT=timeshift, MULTCNST=multcnst, \NORMAL, FILL=fill, XTITLE=xtitle, YTITLE=ytitle, YRANGE=yrange, OVER=over, _EXTRA=extra

 INPUTS:
   <filename>     Name of a file containing results from multi-SSP
   fit with ULYSS, should end on ".res". string               

 KEYWORDS:
   \OVER          Overplot SFH

   TIMESHIFT      [Gyr] shift the age of the components by a constant

   NORMAL         Normilize the total mass to 1. It can be used
   together with MULTFRAC. In this case the total mass is first
   normilized to 1 and after multiplied by 

   MULTCNST       To get the total mass in Solar masses, multiply the
   component wieght by a constant. For example, in the case of
   standard input ulyss models and SDSS data, MULTCNST =
   0.3127e7*D^2, where D^2 is the distance in Mpc (see
   http://ulyss.univ-lyon1.fr/models.html) 

   FILL           color of the area under the SFH curve

   XTIT           x-axis title

   YTIT           y-axis title
 
   YRANGE         y-axis range

   _EXTRA         any keywords accepted by IDL PLOT procedure 

 OPTIONAL OUTPUTS:
   PS             name of the output postscript file. Note that
   '.eps' will be authomatically added 

 RESTRICTIONS:
    If a component without free parameters is used (for
 example a stellar spectrum) the program will fail because it looks
 for the parameters names to indentify the number of SSPs used for
 the fit


 PROCEDURE:



 EXAMPLE:
  aux_sfh, uly_root+'/data/VazMiles_z-0.40t07.94.fits', [uly_ssp(AL=[10,1000], AG=300.),uly_ssp(AL=[1000,13000])], 'test'
  loadct, 39
  aux_psfh, 'test.res', color=40, thick=5, fill=220

 HISTORY:
  200X/XX/XX: MK, creation
  2012/10/29: MK, documentation 
  

(See aux_psfh.pro)


AUX_READ_GALAXEV

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

 RESTRICTIONS:
 This routine is not approved part of the ULySS
               package. It is not tested and was designed for a
               particular purpose.

 PURPOSE:
                 Read a grid of GalaxEV models

 USAGE:
          grid = aux_read_galaxev( model_dir,          $
                       WAVERANGE=waverange, VELSCALE=velscale,   $
                       AGERANGE=agerange, METALRANGE=metalrange, $
                       MGFE=mgfe, QUIET=quiet )
 
 ARGUMENTS:
     model_dir:  string, directory where the SSP .txt files are located
                 To read models with 2 Mg/Fe enhancements, give
                 a string array with the two directories.
 KEYWORDS:
     WAVERANGE:  Two element array giving the limits of the range to read, 
                 in Angstrom. For example WAVERANGE=[4000d,4786d].
                 By default the whole data range is read.

     VELSCALE:   Size of the pixels in km/s. For example VELSCALE=30.
                 If VELSCALE is not given, the models are not rebinned, ie.
                 they are as stored in the disk file (in linear or
                 log scale).

     AGERANGE/METALRANGE:  Extracted region of the grid. Ages in
                 log(Myr) and metallicities in dex.
                 By default the whole data range is read.
                 For example
                 AGERANGE=alog([100,15000]),METALRANGE=[-1.4,+0.7]

     MGFE:       Mg/Fe ratio. A value to be added in the header

     QUIET:      Verbosity control

 RETURN:
         A structure containing the readed models with the
                 associeted WCS (see also ULY_SSP_ALLOC)  

 DESCRIPTION:
    This routine can be used to generate a new grid of models
                 by reading the txt files produced by the program GalaxEv/galaxpl.

                 It is useful when, for example, a new library, or a
                 new version becomes available.

                 The grid read by AUX_READ_GALAXEV can be saved to a file
                 and afterward used to define a component with ULY_SSP. 
                 The set of GalaxEv grids of models provided with
                 ULySS in the directory 'models/' were generated by
                 this program.
 
 EXAMPLE:
       To read the latest version of GalaxEv/Miles and save it
                grid = aux_read_galaxev(uly_root+'/models/galaxev/bc2003_hrs_miles_0p1_ssp')
                uly_ssp_write, grid, uly_root+'/models/test.fits'

 TESTS:
                test_models, uly_root+'/models/test.fits'
                sp = uly_spect_read(uly_root+'/data/VazMiles_z-0.40t07.94.fits')
                ulyss, sp, uly_ssp(model=uly_root+'/models/test.fits'), /plot

 HISTORY:
       Mina Koelva 2011/11/11, modified version of aux_read_pegase.pro

(See aux_read_galaxev.pro)


AUX_READ_PEGASE

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

 RESTRICTIONS:
   This routine is not approved part of the ULySS
                 package. It is not tested and was designed for a
                 particular purpose.

 PURPOSE:
                 Read a grid of Pegase.HR models

 USAGE:
          grid = aux_read_pegase( model_dir,          $
                       WAVERANGE=waverange, VELSCALE=velscale,   $
                       AGERANGE=agerange, METALRANGE=metalrange, $
                       MGFE=mgfe, QUIET=quiet )
 
 ARGUMENTS:
     model_dir:  string, directory where the SSP .FITS files are located
                 To read models with 2 Mg/Fe enhancements, give
                 a string array with the two directories.
 KEYWORDS:
     WAVERANGE:  Two element array giving the limits of the range to read, 
                 in Angstrom. For example WAVERANGE=[4000d,4786d].
                 By default the whole data range is read.

     VELSCALE:   Size of the pixels in km/s. For example VELSCALE=30.
                 If VELSCALE is not given, the models are not rebinned, ie.
                 they are as stored in the disk file (in linear or
                 log scale).

     AGERANGE/METALRANGE:  Extracted region of the grid. Ages in
                 log(Myr) and metallicities in dex.
                 By default the whole data range is read.
                 For example
                 AGERANGE=alog([100,15000]),METALRANGE=[-1.4,+0.7]

     MGFE:       Mg/Fe ratio. A value to be added in the header

     QUIET:      Verbosity control

 RETURN:
         A structure containing the readed models with the
                 associeted WCS (see also ULY_SSP_ALLOC)  

 DESCRIPTION:
    This routine can be used to generate a new grid of models
                 by reading the FITS files produced by the program PEGASE_HR.

                 It is useful when, for example, a new library, or a
                 new version becomes available.

                 The grid read by AUX_READ_PEGASE can be saved to a file
                 and afterward used to define a component with ULY_SSP. 
                 The set of PEGASE_HR grids of models provided with
                 ULySS in the directory 'models/' were generated by
                 this program.
 
 EXAMPLE:
       To read the latest version of PHR/Elodie and save it
                grid = aux_read_pegase(uly_root+'/models/PEG_/e32_Salp_SB')
                uly_ssp_write, grid, uly_root+'/models/PHR_E32_test.fits'
 
 TEST:
          test_models, uly_root+'/models/PHR_E32_test.fits'
                sp = uly_root+'/data/VazMiles_z-0.40t07.94.fits'
                ulyss, sp, uly_ssp(model=uly_root+'/models/PHR_E32_test.fits')
                test_models, uly_root+'/models/PHR_E32_test.fits'

 HISTORY:       Martin France, 2006, created
                Mina Koleva, 2007/10/18, debugged, upgraded

(See aux_read_pegase.pro)


AUX_READ_VAZMILES

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

 PURPOSE:        Read a grid of Vazdekis models

 USAGE:
          grid = aux_read_vazmiles (model_dir, $
                                WAVERANGE=waverange, VELSCALE=velscale, $
                                AGERANGE=agerange, METALRANGE=metalrange, $
                                QUIET=quiet)

 ARGUMENTS:
     model_dir:  string, directory where the SSP .FITS files are located
                 To read models with 2 Mg/Fe enhancements, give
                 a string array with the two directories.

 KEYWORDS:
     WAVERANGE:  Two element array giving the limits of the range to read, 
                 in Angstrom. For example WAVERANGE=[4000d,4786d].
                 By default is [3000,10000]

     VELSCALE:   Size of the pixels in km/s. For example VELSCALE=30.
                 If VELSCALE is not given, the models are not rebinned, ie.
                 they are as stored in the disk file (in linear or
                 log scale).

     AGERANGE/METALRANGE:  Extracted region of the grid. Ages in
                 Myr and metallicities in dex.
                 By default agerange=[0, 23000]Myr, metalrange = [-5.0, +3.0]dex.
                 For example
                 AGERANGE=[100,1500],METALRANGE=[-1.4,+0.2]

     QUIET:      Verbosity control

 RETURN:
         A structure containing the readed models with the
                 associeted WCS (see also ULY_SSP_ALLOC)  

 DESCRIPTION:
       This routine can be used to generate a new grid of models
       by reading a series of FITS files containing the Vazdekis models
       with the Miles or CaII libraries. It is an analogue to
       AUX_READ_PEGASE. See also ULY_SSP_READ. 
 
 EXAMPLE:
     Read and save a grid of Vaz/Miles to a single fits file
                grid = aux_read_vazmiles(uly_root+'/models/Vaz_/Miles')
                uly_ssp_write, grid, uly_root+'/models/Vaz_Miles.fits'

              Read and write the CaT library
                grid = aux_read_vazmiles(uly_root+'/models/Vaz_/caii')
                uly_ssp_write, grid, uly_root+'/models/Vaz_CaT.fits'

 LIMITATIONS:
   We hardcoded number of metallicity bins to 6 and number of age
                bins to 100. The program is working fine if the real
                numbers are equal or less than this but otherwise the
                user have to change. The same is true for the wave-,
                age-, metallicity- ranges. 

(See aux_read_vazmiles.pro)


AUX_SFH

[Previous Routine] [List of Routines]
 NAME:
                  AUX_SFH

 RESTRICTIONS:
   This routine is not approved part of the ULySS
                 package. It is not tested and was designed for a
                 particular purpose.
 
                 (Comments from PhP 2012/11/15) The determined SFHs
                 are highly unstable and sensitive to degeneracies
                 and the need for interations with various
                 decompositions adds to the instability. The user can
                 himself decide if it is reasonable to use this
                 approach. 

 PURPOSE:
                  Determine a star formation history
 USAGE:
                  aux_sfh, <nami>, <model>, <namo>, 
                  /CLEAN, DETECT_THRESHOLD=detect, STATUS=status, _EXTRA=_extra

 DESCRIPTION:
   The spectrum <nami> is decomposed in a series of bursts described 
   in <model>. If this decomposition is considered as inacceptable,
   the model is modified (e. g. consecutive bursts are merged),
   and the procedure is iteratively called (re-entrant call).

 ARGUMENTS:
    model - model component
    nami - input name
    namo - output name

 KEYWORDS:
   CLEAN - perform the fit twice - clean and then fit
   _EXTRA - keywords to be passed to ulyss

 HISTORY: 
   this program was send by Mina (2010/05/26)
   It is analysing some spectra to find the SFH in 3 bursts
   PhP: I modified this program to read the files from GMOS/Spolaor
        Do the fit in two passes (clean and then global minimisation)
   
   Rewrite the program to work for any number and characteristics of bursts
   in the SFH decomposition (PhP 2010/05/30 and 31st).

   Generelize the program to work for arbirary components (not
   only ssps). For the moment the component should consiste of
   ssps+other definitions (MK 2012/05/26)

(See aux_sfh.pro)


This page was created by the ULySS routine uly_html_help.
Contact: ulyss at obs.univ-lyon1.fr Last modified: Fri Mar 1 14:39:02 2013.