Function dustem_plugin_stellar_population, key=key, val=val, scope=scope, help=help 

;+
; NAME:
;    dustem_plugin_stellar_population
; PURPOSE:
;    Produces a system variable called '!dustem_composite_stellar_population' in which a structure containing parameters pertaining to (a) stellar population(s) is placed
; CATEGORY:
;    DUSTEM Wrapper
; CALLING SEQUENCE:
;    dustem_create_plugin_population(key=key,val=val)
; INPUTS:
;    None
; OPTIONAL INPUT PARAMETERS:
;    key  = input parameter number
;    val  = input parameter value
; OUTPUTS:
;    None
; OPTIONAL OUTPUT PARAMETERS:
;    None
; ACCEPTED KEY-WORDS:
;    help                  = if set, print this help
; COMMON BLOCKS:
;    None
; SIDE EFFECTS:
;    None
; RESTRICTIONS:
;    The dustem fortran code must be installed
;    The dustem idl wrapper must be installed
; PROCEDURE:
;    This is a dustem plugin
;-

IF keyword_set(help) THEN BEGIN
  doc_library,'dustem_plugin_stellar_population'
  out=0.
  goto,the_end
ENDIF


out=0.
;===========Initializing the defaut stellar population structure===========
one_pop={radius:0.,temperature:0.,distance:0.,amplitude:0.,nstars:0.,popid:''} 

;===========Counters===========
popnumber = 0.
counto = 0.
countb = 0.
counta = 0.
countf = 0.
countg = 0.
;==============================

;===========Specifying whether to add the Mathis field (and its scaling via G0) to the composite ISRF===================
ismathis=0 ;this value will have to be manually changed at the present moment
defsysv, '!ismathis', ismathis
;====================================================================================================================== 

;===========Constants (in cgs)========== (except for the stellar population distance (in pc))
rsun2cm = 6.957e10 

;Stelar density constant to automate the computation of the number of stars. (It links the distance and the number of stars)
;The below stellar density will have to be modified as the density goes up towards the center, in globular clusters and goes down as we move out of the galactic plane
stellar_density = 0.14 ;stars/pc^3 stellar density in the SOLAR VICINITY     
;!!!This value will only be used if the number of stars is not set!!!
;============================================================================================ 
 
;================NOTA BENE========================================================================== 
;KM are not included because I assumed that their UV part was not that important to excite the dust. 
;This will help ease and shorten the fitting procedure
;===================================================================================================
;===================================================================================================


IF keyword_set(key) THEN BEGIN 
    
    lumclass = (strmid(key,2)).remove(-1) ; extracting the luminosity class strings
    params = strmid(key,0,/reverse_offset) ; extracting the indices (in the 'key' array) of the stellar parameters to fit 
   
    ;===========Locating the O3 stellar population parameters===========
    ;===================================================================
    
    ; Locating the O3IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'IA+',countindo3IA+)
    IF countindo3IA+ NE 0 THEN BEGIN 
        popnumber+=1
        counto+=1
        indo3IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 1, countindo3IA+_1); index of radius of this stellar population in the val array
        indo3IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 2, countindo3IA+_2); index of temperature of this stellar population in the val array
        indo3IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 3, countindo3IA+_3); index of distance of this stellar population in the val array
        indo3IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 4, countindo3IA+_4); index of the amplitude of this stellar population in the val array (Q: does it make sense to have an amplitude>1.? If not upper limiting it in the general fitting procedure might be handy)
        indo3IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 5, countindo3IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF

    ; Locating the O3IA stellar population parameters (Luminous supergIAnts)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'IA',countindo3IA)
    IF countindo3IA NE 0 THEN BEGIN 
        popnumber+=1
        counto+=1
        indo3IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 1, countindo3IA_1); index of radius of this stellar population in the val array
        indo3IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 2, countindo3IA_2); index of temperature of this stellar population in the val array
        indo3IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 3, countindo3IA_3); index of distance of this stellar population in the val array
        indo3IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 4, countindo3IA_4); index of the amplitude of this stellar population in the val array (Q: does it make sense to have an amplitude>1.? If not upper limiting it in the general fitting procedure might be handy)
        indo3IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 5, countindo3IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the O3IAB stellar population parameters (Intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'IAB',countindo3IAB)
    IF countindo3IAB NE 0 THEN BEGIN 
        popnumber+=1
        counto+=1
        indo3IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 1, countindo3IAB_1); index of radius of this stellar population in the val array
        indo3IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 2, countindo3IAB_2); index of temperature of this stellar population in the val array
        indo3IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 3, countindo3IAB_3); index of distance of this stellar population in the val array
        indo3IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 4, countindo3IAB_4); index of the amplitude of this stellar population in the val array (Q: does it make sense to have an amplitude>1.? If not upper limiting it in the general fitting procedure might be handy)
        indo3IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 5, countindo3IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the O3IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'IB',countindo3IB)
    IF countindo3IB NE 0 THEN BEGIN 
        popnumber+=1
        counto+=1
        indo3IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 1, countindo3IB_1); index of radius of this stellar population in the val array
        indo3IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 2, countindo3IB_2); index of temperature of this stellar population in the val array
        indo3IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 3, countindo3IB_3); index of distance of this stellar population in the val array
        indo3IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 4, countindo3IB_4); index of the amplitude of this stellar population in the val array (Q: does it make sense to have an amplitude>1.? If not upper limiting it in the general fitting procedure might be handy)
        indo3IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 5, countindo3IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the O3II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'II',countindo3II)
    IF countindo3II NE 0 THEN BEGIN 
        popnumber+=1
        counto+=1
        indo3II_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 1, countindo3II_1); index of radius of this stellar population in the val array
        indo3II_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 2, countindo3II_2); index of temperature of this stellar population in the val array
        indo3II_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 3, countindo3II_3); index of distance of this stellar population in the val array
        indo3II_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 4, countindo3II_4); index of the amplitude of this stellar population in the val array (Q: does it make sense to have an amplitude>1.? If not upper limiting it in the general fitting procedure might be handy)
        indo3II_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 5, countindo3II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the O3III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'III',countindo3III)
    IF countindo3III NE 0 THEN BEGIN 
        popnumber+=1
        counto+=1
        indo3III_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 1, countindo3III_1); index of radius of this stellar population in the val array
        indo3III_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 2, countindo3III_2); index of temperature of this stellar population in the val array
        indo3III_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 3, countindo3III_3); index of distance of this stellar population in the val array
        indo3III_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 4, countindo3III_4); index of the amplitude of this stellar population in the val array (Q: does it make sense to have an amplitude>1.? If not upper limiting it in the general fitting procedure might be handy)
        indo3III_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 5, countindo3III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the O3IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'IV',countindo3IV)
    IF countindo3IV NE 0 THEN BEGIN 
        popnumber+=1
        counto+=1
        indo3IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 1, countindo3IV_1); index of radius of this stellar population in the val array
        indo3IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 2, countindo3IV_2); index of temperature of this stellar population in the val array
        indo3IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 3, countindo3IV_3); index of distance of this stellar population in the val array
        indo3IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 4, countindo3IV_4); index of the amplitude of this stellar population in the val array (Q: does it make sense to have an amplitude>1.? If not upper limiting it in the general fitting procedure might be handy)
        indo3IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 5, countindo3IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the O3V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'V',countindo3V)
    IF countindo3V NE 0 THEN BEGIN 
        popnumber+=1
        counto+=1
        indo3V_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 1, countindo3V_1); index of radius of this stellar population in the val array
        indo3V_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 2, countindo3V_2); index of temperature of this stellar population in the val array
        indo3V_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 3, countindo3V_3); index of distance of this stellar population in the val array
        indo3V_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 4, countindo3V_4); index of the amplitude of this stellar population in the val array (Q: does it make sense to have an amplitude>1.? If not upper limiting it in the general fitting procedure might be handy)
        indo3V_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 5, countindo3V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the O3VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'VI',countindo3VI)
    IF countindo3VI NE 0 THEN BEGIN 
        popnumber+=1
        counto+=1
        indo3VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 1, countindo3VI_1); index of radius of this stellar population in the val array
        indo3VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 2, countindo3VI_2); index of temperature of this stellar population in the val array
        indo3VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 3, countindo3VI_3); index of distance of this stellar population in the val array
        indo3VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 4, countindo3VI_4); index of the amplitude of this stellar population in the val array (Q: does it make sense to have an amplitude>1.? If not upper limiting it in the general fitting procedure might be handy)
        indo3VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 5, countindo3VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the O3VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'VII',countindo3VII)
    IF countindo3VII NE 0 THEN BEGIN 
        popnumber+=1
        counto+=1
        indo3VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 1, countindo3VII_1); index of radius of this stellar population in the val array
        indo3VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 2, countindo3VII_2); index of temperature of this stellar population in the val array
        indo3VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 3, countindo3VII_3); index of distance of this stellar population in the val array
        indo3VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 4, countindo3VII_4); index of the amplitude of this stellar population in the val array (Q: does it make sense to have an amplitude>1.? If not upper limiting it in the general fitting procedure might be handy)
        indo3VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 3 and params EQ 5, countindo3VII_5); index of the number of stars of this stellar population in the val array
    ENDIF    
    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the O4 stellar population parameters===========
    ;===================================================================
    
    
    ; Locating the O4IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'IA+',countindo4IA+)
    IF countindo4IA+ NE 0 THEN BEGIN 
        popnumber+=1
        counto+=1
        indo4IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 1, countindo4IA+_1); index of radius of this stellar population in the val array
        indo4IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 2, countindo4IA+_2); index of temperature of this stellar population in the val array
        indo4IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 3, countindo4IA+_3); index of distance of this stellar population in the val array
        indo4IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 4, countindo4IA+_4); index of the amplitude of this stellar population in the val array
        indo4IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 5, countindo4IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
        
   ; Locating the O4IA stellar population parameters (Luminous supergIAnts)
   ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'IA',countindo4IA)
   IF countindo4IA NE 0 THEN BEGIN 
       popnumber+=1
       counto+=1
       indo4IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 1, countindo4IA_1); index of radius of this stellar population in the val array
       indo4IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 2, countindo4IA_2); index of temperature of this stellar population in the val array
       indo4IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 3, countindo4IA_3); index of distance of this stellar population in the val array
       indo4IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 4, countindo4IA_4); index of the amplitude of this stellar population in the val array
       indo4IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 5, countindo4IA_5); index of the number of stars of this stellar population in the val array
   ENDIF        

   ; Locating the O4IAB stellar population parameters (Intermediate-size luminous supergiants)
   ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'IAB',countindo4IAB)
   IF countindo4IAB NE 0 THEN BEGIN 
       popnumber+=1
       counto+=1
       indo4IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 1, countindo4IAB_1); index of radius of this stellar population in the val array
       indo4IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 2, countindo4IAB_2); index of temperature of this stellar population in the val array
       indo4IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 3, countindo4IAB_3); index of distance of this stellar population in the val array
       indo4IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 4, countindo4IAB_4); index of the amplitude of this stellar population in the val array
       indo4IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 5, countindo4IAB_5); index of the number of stars of this stellar population in the val array
   ENDIF 
    
   ; Locating the O4IB stellar population parameters (Less luminous supergiants)
   ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'IB',countindo4IB)
   IF countindo4IB NE 0 THEN BEGIN 
       popnumber+=1
       counto+=1
       indo4IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 1, countindo4IB_1); index of radius of this stellar population in the val array
       indo4IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 2, countindo4IB_2); index of temperature of this stellar population in the val array
       indo4IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 3, countindo4IB_3); index of distance of this stellar population in the val array
       indo4IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 4, countindo4IB_4); index of the amplitude of this stellar population in the val array
       indo4IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 5, countindo4IB_5); index of the number of stars of this stellar population in the val array
   ENDIF    
    
   ; Locating the O4II stellar population parameters (Bright giants)
   ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'II',countindo4II)
   IF countindo4II NE 0 THEN BEGIN 
       popnumber+=1
       counto+=1
       indo4II_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 1, countindo4II_1); index of radius of this stellar population in the val array
       indo4II_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 2, countindo4II_2); index of temperature of this stellar population in the val array
       indo4II_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 3, countindo4II_3); index of distance of this stellar population in the val array
       indo4II_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 4, countindo4II_4); index of the amplitude of this stellar population in the val array
       indo4II_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 5, countindo4II_5); index of the number of stars of this stellar population in the val array
   ENDIF 


   ; Locating the O4III stellar population parameters (Normal giants)
   ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'III',countindo4III)
   IF countindo4III NE 0 THEN BEGIN 
       popnumber+=1
       counto+=1
       indo4III_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 1, countindo4III_1); index of radius of this stellar population in the val array
       indo4III_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 2, countindo4III_2); index of temperature of this stellar population in the val array
       indo4III_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 3, countindo4III_3); index of distance of this stellar population in the val array
       indo4III_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 4, countindo4III_4); index of the amplitude of this stellar population in the val array
       indo4III_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 5, countindo4III_5); index of the number of stars of this stellar population in the val array
   ENDIF

   ; Locating the O4IV stellar population parameters (Subgiants)
   ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'IV',countindo4IV)
   IF countindo4IV NE 0 THEN BEGIN 
       popnumber+=1
       counto+=1
       indo4IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 1, countindo4IV_1); index of radius of this stellar population in the val array
       indo4IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 2, countindo4IV_2); index of temperature of this stellar population in the val array
       indo4IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 3, countindo4IV_3); index of distance of this stellar population in the val array
       indo4IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 4, countindo4IV_4); index of the amplitude of this stellar population in the val array
       indo4IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 5, countindo4IV_5); index of the number of stars of this stellar population in the val array
   ENDIF 

   ; Locating the O4V stellar population parameters (Dwarfs: Main-sequence stars)
   ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'V',countindo4V)
   IF countindo4V NE 0 THEN BEGIN 
       popnumber+=1
       counto+=1
       indo4V_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 1, countindo4V_1); index of radius of this stellar population in the val array
       indo4V_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 2, countindo4V_2); index of temperature of this stellar population in the val array
       indo4V_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 3, countindo4V_3); index of distance of this stellar population in the val array
       indo4V_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 4, countindo4V_4); index of the amplitude of this stellar population in the val array
       indo4V_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 5, countindo4V_5); index of the number of stars of this stellar population in the val array
   ENDIF
   
   ; Locating the O4VI stellar population parameters (Subdwarfs)
   ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'VI',countindo4VI)
   IF countindo4VI NE 0 THEN BEGIN 
       popnumber+=1
       counto+=1
       indo4VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 1, countindo4VI_1); index of radius of this stellar population in the val array
       indo4VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 2, countindo4VI_2); index of temperature of this stellar population in the val array
       indo4VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 3, countindo4VI_3); index of distance of this stellar population in the val array
       indo4VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 4, countindo4VI_4); index of the amplitude of this stellar population in the val array
       indo4VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 5, countindo4VI_5); index of the number of stars of this stellar population in the val array
   ENDIF
   
   ; Locating the O4VII stellar population parameters (White dwarfs)
   ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'VII',countindo4VII)
   IF countindo4VII NE 0 THEN BEGIN 
       popnumber+=1
       counto+=1
       indo4VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 1, countindo4VII_1); index of radius of this stellar population in the val array
       indo4VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 2, countindo4VII_2); index of temperature of this stellar population in the val array
       indo4VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 3, countindo4VII_3); index of distance of this stellar population in the val array
       indo4VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 4, countindo4VII_4); index of the amplitude of this stellar population in the val array
       indo4VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 4 and params EQ 5, countindo4VII_5); index of the number of stars of this stellar population in the val array
   ENDIF
   
   ;===================================================================
   ;===================================================================
   
   
   ;===========Locating the O5 stellar population parameters===========
   ;===================================================================

   
    
    ; Locating the O5IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'IA+',countindo5Ia+)
    IF countindo5IA+ NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo5IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 1, countindo5IA+_1); index of radius of this stellar population in the val array
        indo5IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 2, countindo5IA+_2); index of temperature of this stellar population in the val array
        indo5IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 3, countindo5IA+_3); index of distance of this stellar population in the val array
        indo5IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 4, countindo5IA+_4); index of the amplitude of this stellar population in the val array
        indo5IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 5, countindo5IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the O5Ia stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'IA',countindo5IA)
    IF countindo5IA NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo5IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 1, countindo5IA_1); index of radius of this stellar population in the val array
        indo5IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 2, countindo5IA_2); index of temperature of this stellar population in the val array
        indo5IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 3, countindo5IA_3); index of distance of this stellar population in the val array
        indo5IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 4, countindo5IA_4); index of the amplitude of this stellar population in the val array
        indo5IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 5, countindo5IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the O5IAB stellar population parameters (Intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'IAB',countindo5IAB)
    IF countindo5IAB NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo5IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 1, countindo5IAB_1); index of radius of this stellar population in the val array
        indo5IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 2, countindo5IAB_2); index of temperature of this stellar population in the val array
        indo5IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 3, countindo5IAB_3); index of distance of this stellar population in the val array
        indo5IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 4, countindo5IAB_4); index of the amplitude of this stellar population in the val array
        indo5IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 5, countindo5IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the O5IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'IB',countindo5IB)
    IF countindo5IB NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo5IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 1, countindo5IB_1); index of radius of this stellar population in the val array
        indo5IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 2, countindo5IB_2); index of temperature of this stellar population in the val array
        indo5IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 3, countindo5IB_3); index of distance of this stellar population in the val array
        indo5IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 4, countindo5IB_4); index of the amplitude of this stellar population in the val array
        indo5IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 5, countindo5IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the O5II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'II',countindo5II)
    IF countindo5II NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo5II_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 1, countindo5II_1); index of radius of this stellar population in the val array
        indo5II_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 2, countindo5II_2); index of temperature of this stellar population in the val array
        indo5II_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 3, countindo5II_3); index of distance of this stellar population in the val array
        indo5II_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 4, countindo5II_4); index of the amplitude of this stellar population in the val array
        indo5II_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 5, countindo5II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the O5III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'III',countindo5III)
    IF countindo5III NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo5III_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 1, countindo5III_1); index of radius of this stellar population in the val array
        indo5III_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 2, countindo5III_2); index of temperature of this stellar population in the val array
        indo5III_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 3, countindo5III_3); index of distance of this stellar population in the val array
        indo5III_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 4, countindo5III_4); index of the amplitude of this stellar population in the val array
        indo5III_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 5, countindo5III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the O5IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'IV',countindo5IV)
    IF countindo5IV NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo5IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 1, countindo5IV_1); index of radius of this stellar population in the val array
        indo5IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 2, countindo5IV_2); index of temperature of this stellar population in the val array
        indo5IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 3, countindo5IV_3); index of distance of this stellar population in the val array
        indo5IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 4, countindo5IV_4); index of the amplitude of this stellar population in the val array
        indo5IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 5, countindo5IV_5); index of the number of stars of this stellar population in the val array
    ENDIF    
        
    ; Locating the O5IV stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'V',countindo5V)
    IF countindo5V NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo5V_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 1, countindo5V_1); index of radius of this stellar population in the val array
        indo5V_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 2, countindo5V_2); index of temperature of this stellar population in the val array
        indo5V_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 3, countindo5V_3); index of distance of this stellar population in the val array
        indo5V_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 4, countindo5V_4); index of the amplitude of this stellar population in the val array
        indo5V_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 5, countindo5V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the O5IVI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'VI',countindo5VI)
    IF countindo5VI NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo5VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 1, countindo5VI_1); index of radius of this stellar population in the VIal array
        indo5VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 2, countindo5VI_2); index of temperature of this stellar population in the VIal array
        indo5VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 3, countindo5VI_3); index of distance of this stellar population in the VIal array
        indo5VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 4, countindo5VI_4); index of the amplitude of this stellar population in the VIal array
        indo5VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 5, countindo5VI_5); index of the number of stars of this stellar population in the VIal array
    ENDIF
    

    ; Locating the O5IVII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'VII',countindo5VII)
    IF countindo5VII NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo5VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 1, countindo5VII_1); index of radius of this stellar population in the VIIal array
        indo5VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 2, countindo5VII_2); index of temperature of this stellar population in the VIIal array
        indo5VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 3, countindo5VII_3); index of distance of this stellar population in the VIIal array
        indo5VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 4, countindo5VII_4); index of the amplitude of this stellar population in the VIIal array
        indo5VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 5 and params EQ 5, countindo5VII_5); index of the number of stars of this stellar population in the VIIal array
    ENDIF
        
    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the O6 stellar population parameters===========
    ;===================================================================
    
    ; Locating the O6IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'IA+',countindo6IA+)
    IF countindo6IA+ NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo6IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 1, countindo6IA+_1); index of radius of this stellar population in the val array
        indo6IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 2, countindo6IA+_2); index of temperature of this stellar population in the val array
        indo6IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 3, countindo6IA+_3); index of distance of this stellar population in the val array
        indo6IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 4, countindo6IA+_4); index of the amplitude of this stellar population in the val array
        indo6IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 5, countindo6IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the O6IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'IA',countindo6IA)
    IF countindo6IA NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo6IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 1, countindo6IA_1); index of radius of this stellar population in the val array
        indo6IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 2, countindo6IA_2); index of temperature of this stellar population in the val array
        indo6IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 3, countindo6IA_3); index of distance of this stellar population in the val array
        indo6IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 4, countindo6IA_4); index of the amplitude of this stellar population in the val array
        indo6IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 5, countindo6IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the O6IAB stellar population parameters (Intermidiate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'IAB',countindo6IAB)
    IF countindo6IAB NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo6IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 1, countindo6IAB_1); index of radius of this stellar population in the val array
        indo6IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 2, countindo6IAB_2); index of temperature of this stellar population in the val array
        indo6IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 3, countindo6IAB_3); index of distance of this stellar population in the val array
        indo6IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 4, countindo6IAB_4); index of the amplitude of this stellar population in the val array
        indo6IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 5, countindo6IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the O6IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'IB',countindo6IB)
    IF countindo6IB NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo6IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 1, countindo6IB_1); index of radius of this stellar population in the val array
        indo6IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 2, countindo6IB_2); index of temperature of this stellar population in the val array
        indo6IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 3, countindo6IB_3); index of distance of this stellar population in the val array
        indo6IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 4, countindo6IB_4); index of the amplitude of this stellar population in the val array
        indo6IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 5, countindo6IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the O6II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'II',countindo6II)
    IF countindo6II NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo6II_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 1, countindo6II_1); index of radius of this stellar population in the val array
        indo6II_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 2, countindo6II_2); index of temperature of this stellar population in the val array
        indo6II_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 3, countindo6II_3); index of distance of this stellar population in the val array
        indo6II_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 4, countindo6II_4); index of the amplitude of this stellar population in the val array
        indo6II_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 5, countindo6II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the O6III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'III',countindo6III)
    IF countindo6III NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo6III_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 1, countindo6III_1); index of radius of this stellar population in the val array
        indo6III_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 2, countindo6III_2); index of temperature of this stellar population in the val array
        indo6III_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 3, countindo6III_3); index of distance of this stellar population in the val array
        indo6III_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 4, countindo6III_4); index of the amplitude of this stellar population in the val array
        indo6III_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 5, countindo6III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the O6IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'IV',countindo6IV)
    IF countindo6IV NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo6IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 1, countindo6IV_1); index of radius of this stellar population in the val array
        indo6IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 2, countindo6IV_2); index of temperature of this stellar population in the val array
        indo6IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 3, countindo6IV_3); index of distance of this stellar population in the val array
        indo6IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 4, countindo6IV_4); index of the amplitude of this stellar population in the val array
        indo6IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 5, countindo6IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the O6V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'V',countindo6V)
    IF countindo6V NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo6V_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 1, countindo6V_1); index of radius of this stellar population in the val array
        indo6V_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 2, countindo6V_2); index of temperature of this stellar population in the val array
        indo6V_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 3, countindo6V_3); index of distance of this stellar population in the val array
        indo6V_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 4, countindo6V_4); index of the amplitude of this stellar population in the val array
        indo6V_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 5, countindo6V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the O6VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'VI',countindo6VI)
    IF countindo6VI NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo6VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 1, countindo6VI_1); index of radius of this stellar population in the val array
        indo6VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 2, countindo6VI_2); index of temperature of this stellar population in the val array
        indo6VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 3, countindo6VI_3); index of distance of this stellar population in the val array
        indo6VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 4, countindo6VI_4); index of the amplitude of this stellar population in the val array
        indo6VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 5, countindo6VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the O6VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'VII',countindo6VII)
    IF countindo6VII NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo6VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 1, countindo6VII_1); index of radius of this stellar population in the val array
        indo6VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 2, countindo6VII_2); index of temperature of this stellar population in the val array
        indo6VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 3, countindo6VII_3); index of distance of this stellar population in the val array
        indo6VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 4, countindo6VII_4); index of the amplitude of this stellar population in the val array
        indo6VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 6 and params EQ 5, countindo6VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the O7 stellar population parameters===========
    ;===================================================================
    
    ; Locating the O7IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'IA+',countindo7IA+)
    IF countindo7IA+ NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo7IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 1, countindo7IA+_1); index of radius of this stellar population in the val array
        indo7IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 2, countindo7IA+_2); index of temperature of this stellar population in the val array
        indo7IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 3, countindo7IA+_3); index of distance of this stellar population in the val array
        indo7IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 4, countindo7IA+_4); index of the amplitude of this stellar population in the val array
        indo7IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 5, countindo7IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the O7IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'IA',countindo7IA)
    IF countindo7IA NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo7IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 1, countindo7IA_1); index of radius of this stellar population in the val array
        indo7IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 2, countindo7IA_2); index of temperature of this stellar population in the val array
        indo7IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 3, countindo7IA_3); index of distance of this stellar population in the val array
        indo7IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 4, countindo7IA_4); index of the amplitude of this stellar population in the val array
        indo7IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 5, countindo7IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the O7IAB stellar population parameters (Intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'IAB',countindo7IAB)
    IF countindo7IAB NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo7IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 1, countindo7IAB_1); index of radius of this stellar population in the val array
        indo7IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 2, countindo7IAB_2); index of temperature of this stellar population in the val array
        indo7IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 3, countindo7IAB_3); index of distance of this stellar population in the val array
        indo7IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 4, countindo7IAB_4); index of the amplitude of this stellar population in the val array
        indo7IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 5, countindo7IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF    
            
    ; Locating the O7IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'IB',countindo7IB)
    IF countindo7IB NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo7IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 1, countindo7IB_1); index of radius of this stellar population in the val array
        indo7IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 2, countindo7IB_2); index of temperature of this stellar population in the val array
        indo7IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 3, countindo7IB_3); index of distance of this stellar population in the val array
        indo7IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 4, countindo7IB_4); index of the amplitude of this stellar population in the val array
        indo7IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 5, countindo7IB_5); index of the number of stars of this stellar population in the val array
    ENDIF    
    
    ; Locating the O7II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'II',countindo7II)
    IF countindo7II NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo7II_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 1, countindo7II_1); index of radius of this stellar population in the val array
        indo7II_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 2, countindo7II_2); index of temperature of this stellar population in the val array
        indo7II_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 3, countindo7II_3); index of distance of this stellar population in the val array
        indo7II_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 4, countindo7II_4); index of the amplitude of this stellar population in the val array
        indo7II_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 5, countindo7II_5); index of the number of stars of this stellar population in the val array
    ENDIF

    ; Locating the O7III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'III',countindo7III)
    IF countindo7III NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo7III_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 1, countindo7III_1); index of radius of this stellar population in the val array
        indo7III_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 2, countindo7III_2); index of temperature of this stellar population in the val array
        indo7III_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 3, countindo7III_3); index of distance of this stellar population in the val array
        indo7III_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 4, countindo7III_4); index of the amplitude of this stellar population in the val array
        indo7III_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 5, countindo7III_5); index of the number of stars of this stellar population in the val array
    ENDIF

    ; Locating the O7IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'IV',countindo7IV)
    IF countindo7IV NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo7IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 1, countindo7IV_1); index of radius of this stellar population in the val array
        indo7IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 2, countindo7IV_2); index of temperature of this stellar population in the val array
        indo7IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 3, countindo7IV_3); index of distance of this stellar population in the val array
        indo7IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 4, countindo7IV_4); index of the amplitude of this stellar population in the val array
        indo7IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 5, countindo7IV_5); index of the number of stars of this stellar population in the val array
    ENDIF

    ; Locating the O7V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'V',countindo7V)
    IF countindo7V NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo7V_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 1, countindo7V_1); index of radius of this stellar population in the val array
        indo7V_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 2, countindo7V_2); index of temperature of this stellar population in the val array
        indo7V_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 3, countindo7V_3); index of distance of this stellar population in the val array
        indo7V_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 4, countindo7V_4); index of the amplitude of this stellar population in the val array
        indo7V_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 5, countindo7V_5); index of the number of stars of this stellar population in the val array
    ENDIF

    ; Locating the O7VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'VI',countindo7VI)
    IF countindo7VI NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo7VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 1, countindo7VI_1); index of radius of this stellar population in the val array
        indo7VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 2, countindo7VI_2); index of temperature of this stellar population in the val array
        indo7VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 3, countindo7VI_3); index of distance of this stellar population in the val array
        indo7VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 4, countindo7VI_4); index of the amplitude of this stellar population in the val array
        indo7VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 5, countindo7VI_5); index of the number of stars of this stellar population in the val array
    ENDIF

    ; Locating the O7VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'VII',countindo7VII)
    IF countindo7VII NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo7VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 1, countindo7VII_1); index of radius of this stellar population in the val array
        indo7VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 2, countindo7VII_2); index of temperature of this stellar population in the val array
        indo7VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 3, countindo7VII_3); index of distance of this stellar population in the val array
        indo7VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 4, countindo7VII_4); index of the amplitude of this stellar population in the val array
        indo7VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 7 and params EQ 5, countindo7VII_5); index of the number of stars of this stellar population in the val array
    ENDIF

    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the O8 stellar population parameters===========
    ;===================================================================
    
    ; Locating the O8IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'IA+',countindo8IA+)
    IF countindo8IA+ NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo8IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 1, countindo8IA+_1); index of radius of this stellar population in the val array
        indo8IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 2, countindo8IA+_2); index of temperature of this stellar population in the val array
        indo8IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 3, countindo8IA+_3); index of distance of this stellar population in the val array
        indo8IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 4, countindo8IA+_4); index of the amplitude of this stellar population in the val array
        indo8IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 5, countindo8IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the O8IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'IA',countindo8IA)
    IF countindo8IA NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo8IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 1, countindo8IA_1); index of radius of this stellar population in the val array
        indo8IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 2, countindo8IA_2); index of temperature of this stellar population in the val array
        indo8IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 3, countindo8IA_3); index of distance of this stellar population in the val array
        indo8IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 4, countindo8IA_4); index of the amplitude of this stellar population in the val array
        indo8IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 5, countindo8IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the O8IAB stellar population parameters (Intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'IAB',countindo8IAB)
    IF countindo8IAB NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo8IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 1, countindo8IAB_1); index of radius of this stellar population in the val array
        indo8IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 2, countindo8IAB_2); index of temperature of this stellar population in the val array
        indo8IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 3, countindo8IAB_3); index of distance of this stellar population in the val array
        indo8IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 4, countindo8IAB_4); index of the amplitude of this stellar population in the val array
        indo8IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 5, countindo8IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the O8IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'IB',countindo8IB)
    IF countindo8IB NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo8IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 1, countindo8IB_1); index of radius of this stellar population in the val array
        indo8IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 2, countindo8IB_2); index of temperature of this stellar population in the val array
        indo8IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 3, countindo8IB_3); index of distance of this stellar population in the val array
        indo8IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 4, countindo8IB_4); index of the amplitude of this stellar population in the val array
        indo8IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 5, countindo8IB_5); index of the number of stars of this stellar population in the val array
    ENDIF

    ; Locating the O8II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'II',countindo8II)
    IF countindo8II NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo8II_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 1, countindo8II_1); index of radius of this stellar population in the val array
        indo8II_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 2, countindo8II_2); index of temperature of this stellar population in the val array
        indo8II_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 3, countindo8II_3); index of distance of this stellar population in the val array
        indo8II_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 4, countindo8II_4); index of the amplitude of this stellar population in the val array
        indo8II_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 5, countindo8II_5); index of the number of stars of this stellar population in the val array
    ENDIF

    
    ; Locating the O8III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'III',countindo8III)
    IF countindo8III NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo8III_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 1, countindo8III_1); index of radius of this stellar population in the val array
        indo8III_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 2, countindo8III_2); index of temperature of this stellar population in the val array
        indo8III_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 3, countindo8III_3); index of distance of this stellar population in the val array
        indo8III_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 4, countindo8III_4); index of the amplitude of this stellar population in the val array
        indo8III_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 5, countindo8III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the O8IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'IV',countindo8IV)
    IF countindo8IV NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo8IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 1, countindo8IV_1); index of radius of this stellar population in the val array
        indo8IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 2, countindo8IV_2); index of temperature of this stellar population in the val array
        indo8IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 3, countindo8IV_3); index of distance of this stellar population in the val array
        indo8IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 4, countindo8IV_4); index of the amplitude of this stellar population in the val array
        indo8IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 5, countindo8IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the O8V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'V',countindo8V)
    IF countindo8V NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo8V_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 1, countindo8V_1); index of radius of this stellar population in the val array
        indo8V_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 2, countindo8V_2); index of temperature of this stellar population in the val array
        indo8V_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 3, countindo8V_3); index of distance of this stellar population in the val array
        indo8V_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 4, countindo8V_4); index of the amplitude of this stellar population in the val array
        indo8V_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 5, countindo8V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the O8VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'VI',countindo8VI)
    IF countindo8VI NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo8VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 1, countindo8VI_1); index of radius of this stellar population in the val array
        indo8VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 2, countindo8VI_2); index of temperature of this stellar population in the val array
        indo8VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 3, countindo8VI_3); index of distance of this stellar population in the val array
        indo8VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 4, countindo8VI_4); index of the amplitude of this stellar population in the val array
        indo8VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 5, countindo8VI_5); index of the number of stars of this stellar population in the val array
    ENDIF

    ; Locating the O8VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'VII',countindo8VII)
    IF countindo8VII NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo8VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 1, countindo8VII_1); index of radius of this stellar population in the val array
        indo8VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 2, countindo8VII_2); index of temperature of this stellar population in the val array
        indo8VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 3, countindo8VII_3); index of distance of this stellar population in the val array
        indo8VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 4, countindo8VII_4); index of the amplitude of this stellar population in the val array
        indo8VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 8 and params EQ 5, countindo8VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    

    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the O9 stellar population parameters===========
    ;===================================================================
    
    ; Locating the O9IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'IA+',countindo9IA+)
    IF countindo9IA+ NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo9IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 1, countindo9IA+_1); index of radius of this stellar population in the val array
        indo9IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 2, countindo9IA+_2); index of temperature of this stellar population in the val array
        indo9IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 3, countindo9IA+_3); index of distance of this stellar population in the val array
        indo9IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 4, countindo9IA+_4); index of the amplitude of this stellar population in the val array
        indo9IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 5, countindo9IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the O9IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'IA',countindo9IA)
    IF countindo9IA NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo9IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 1, countindo9IA_1); index of radius of this stellar population in the val array
        indo9IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 2, countindo9IA_2); index of temperature of this stellar population in the val array
        indo9IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 3, countindo9IA_3); index of distance of this stellar population in the val array
        indo9IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 4, countindo9IA_4); index of the amplitude of this stellar population in the val array
        indo9IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 5, countindo9IA_5); index of the number of stars of this stellar population in the val array
    ENDIF 
    
    ; Locating the O9IAB stellar population parameters (Intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'IAB',countindo9IAB)
    IF countindo9IAB NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo9IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 1, countindo9IAB_1); index of radius of this stellar population in the val array
        indo9IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 2, countindo9IAB_2); index of temperature of this stellar population in the val array
        indo9IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 3, countindo9IAB_3); index of distance of this stellar population in the val array
        indo9IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 4, countindo9IAB_4); index of the amplitude of this stellar population in the val array
        indo9IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 5, countindo9IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the O9IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'IB',countindo9IB)
    IF countindo9IB NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo9IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 1, countindo9IB_1); index of radius of this stellar population in the val array
        indo9IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 2, countindo9IB_2); index of temperature of this stellar population in the val array
        indo9IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 3, countindo9IB_3); index of distance of this stellar population in the val array
        indo9IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 4, countindo9IB_4); index of the amplitude of this stellar population in the val array
        indo9IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 5, countindo9IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the O9II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'II',countindo9II)
    IF countindo9II NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo9II_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 1, countindo9II_1); index of radius of this stellar population in the val array
        indo9II_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 2, countindo9II_2); index of temperature of this stellar population in the val array
        indo9II_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 3, countindo9II_3); index of distance of this stellar population in the val array
        indo9II_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 4, countindo9II_4); index of the amplitude of this stellar population in the val array
        indo9II_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 5, countindo9II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the O9III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'III',countindo9III)
    IF countindo9III NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo9III_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 1, countindo9III_1); index of radius of this stellar population in the val array
        indo9III_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 2, countindo9III_2); index of temperature of this stellar population in the val array
        indo9III_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 3, countindo9III_3); index of distance of this stellar population in the val array
        indo9III_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 4, countindo9III_4); index of the amplitude of this stellar population in the val array
        indo9III_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 5, countindo9III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the O9IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'IV',countindo9IV)
    IF countindo9IV NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo9IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 1, countindo9IV_1); index of radius of this stellar population in the val array
        indo9IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 2, countindo9IV_2); index of temperature of this stellar population in the val array
        indo9IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 3, countindo9IV_3); index of distance of this stellar population in the val array
        indo9IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 4, countindo9IV_4); index of the amplitude of this stellar population in the val array
        indo9IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 5, countindo9IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the O9V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'V',countindo9V)
    IF countindo9V NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo9V_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 1, countindo9V_1); index of radius of this stellar population in the val array
        indo9V_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 2, countindo9V_2); index of temperature of this stellar population in the val array
        indo9V_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 3, countindo9V_3); index of distance of this stellar population in the val array
        indo9V_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 4, countindo9V_4); index of the amplitude of this stellar population in the val array
        indo9V_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 5, countindo9V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the O9VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'VI',countindo9VI)
    IF countindo9VI NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo9VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 1, countindo9VI_1); index of radius of this stellar population in the val array
        indo9VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 2, countindo9VI_2); index of temperature of this stellar population in the val array
        indo9VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 3, countindo9VI_3); index of distance of this stellar population in the val array
        indo9VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 4, countindo9VI_4); index of the amplitude of this stellar population in the val array
        indo9VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 5, countindo9VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the O9VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'VII',countindo9VII)
    IF countindo9VII NE 0 THEN BEGIN
        popnumber+=1
        counto+=1
        indo9VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 1, countindo9VII_1); index of radius of this stellar population in the val array
        indo9VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 2, countindo9VII_2); index of temperature of this stellar population in the val array
        indo9VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 3, countindo9VII_3); index of distance of this stellar population in the val array
        indo9VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 4, countindo9VII_4); index of the amplitude of this stellar population in the val array
        indo9VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'O' and strmid(key,1,1) EQ 9 and params EQ 5, countindo9VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the B0 stellar population parameters===========
    ;===================================================================



    ; Locating the B0IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'IA+' ,countindb0IA+)
    IF countindb0IA+ NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb0IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 1, countindb0IA+_1); index of radius of this stellar population in the val array
        indb0IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 2, countindb0IA+_2); index of temperature of this stellar population in the val array
        indb0IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 3, countindb0IA+_3); index of distance of this stellar population in the val array
        indb0IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 4, countindb0IA+_4); index of the amplitude of this stellar population in the val array
        indb0IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 5, countindb0IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B0IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'IA' ,countindb0IA)
    IF countindb0IA NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb0IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 1, countindb0IA_1); index of radius of this stellar population in the val array
        indb0IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 2, countindb0IA_2); index of temperature of this stellar population in the val array
        indb0IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 3, countindb0IA_3); index of distance of this stellar population in the val array
        indb0IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 4, countindb0IA_4); index of the amplitude of this stellar population in the val array
        indb0IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 5, countindb0IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B0IAB stellar population parameters (Intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'IAB' ,countindb0IAB)
    IF countindb0IAB NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb0IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 1, countindb0IAB_1); index of radius of this stellar population in the val array
        indb0IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 2, countindb0IAB_2); index of temperature of this stellar population in the val array
        indb0IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 3, countindb0IAB_3); index of distance of this stellar population in the val array
        indb0IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 4, countindb0IAB_4); index of the amplitude of this stellar population in the val array
        indb0IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 5, countindb0IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B0IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'IB' ,countindb0IB)
    IF countindb0IB NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb0IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 1, countindb0IB_1); index of radius of this stellar population in the val array
        indb0IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 2, countindb0IB_2); index of temperature of this stellar population in the val array
        indb0IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 3, countindb0IB_3); index of distance of this stellar population in the val array
        indb0IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 4, countindb0IB_4); index of the amplitude of this stellar population in the val array
        indb0IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 5, countindb0IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B0II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'II' ,countindb0II)
    IF countindb0II NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb0II_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 1, countindb0II_1); index of radius of this stellar population in the val array
        indb0II_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 2, countindb0II_2); index of temperature of this stellar population in the val array
        indb0II_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 3, countindb0II_3); index of distance of this stellar population in the val array
        indb0II_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 4, countindb0II_4); index of the amplitude of this stellar population in the val array
        indb0II_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 5, countindb0II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B0III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'III' ,countindb0III)
    IF countindb0III NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb0III_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 1, countindb0III_1); index of radius of this stellar population in the val array
        indb0III_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 2, countindb0III_2); index of temperature of this stellar population in the val array
        indb0III_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 3, countindb0III_3); index of distance of this stellar population in the val array
        indb0III_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 4, countindb0III_4); index of the amplitude of this stellar population in the val array
        indb0III_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 5, countindb0III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B0IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'IV' ,countindb0IV)
    IF countindb0IV NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb0IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 1, countindb0IV_1); index of radius of this stellar population in the val array
        indb0IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 2, countindb0IV_2); index of temperature of this stellar population in the val array
        indb0IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 3, countindb0IV_3); index of distance of this stellar population in the val array
        indb0IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 4, countindb0IV_4); index of the amplitude of this stellar population in the val array
        indb0IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 5, countindb0IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B0V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'V' ,countindb0V)
    IF countindb0V NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb0V_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 1, countindb0V_1); index of radius of this stellar population in the val array
        indb0V_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 2, countindb0V_2); index of temperature of this stellar population in the val array
        indb0V_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 3, countindb0V_3); index of distance of this stellar population in the val array
        indb0V_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 4, countindb0V_4); index of the amplitude of this stellar population in the val array
        indb0V_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 5, countindb0V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the B0VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'VI' ,countindb0VI)
    IF countindb0VI NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb0VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 1, countindb0VI_1); index of radius of this stellar population in the val array
        indb0VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 2, countindb0VI_2); index of temperature of this stellar population in the val array
        indb0VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 3, countindb0VI_3); index of distance of this stellar population in the val array
        indb0VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 4, countindb0VI_4); index of the amplitude of this stellar population in the val array
        indb0VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 5, countindb0VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B0VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'VII' ,countindb0VII)
    IF countindb0VII NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb0VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 1, countindb0VII_1); index of radius of this stellar population in the val array
        indb0VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 2, countindb0VII_2); index of temperature of this stellar population in the val array
        indb0VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 3, countindb0VII_3); index of distance of this stellar population in the val array
        indb0VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 4, countindb0VII_4); index of the amplitude of this stellar population in the val array
        indb0VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 0 and params EQ 5, countindb0VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the B1 stellar population parameters===========
    ;===================================================================
    
    ; Locating the B1IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'IA+',countindb1IA+)
    IF countindb1IA+ NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb1IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 1, countindb1IA+_1); index of radius of this stellar population in the val array
        indb1IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 2, countindb1IA+_2); index of temperature of this stellar population in the val array
        indb1IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 3, countindb1IA+_3); index of distance of this stellar population in the val array
        indb1IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 4, countindb1IA+_4); index of the amplitude of this stellar population in the val array
        indb1IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 5, countindb1IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the B1IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'IA',countindb1IA)
    IF countindb1IA NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb1IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 1, countindb1IA_1); index of radius of this stellar population in the val array
        indb1IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 2, countindb1IA_2); index of temperature of this stellar population in the val array
        indb1IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 3, countindb1IA_3); index of distance of this stellar population in the val array
        indb1IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 4, countindb1IA_4); index of the amplitude of this stellar population in the val array
        indb1IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 5, countindb1IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the B1IAB stellar population parameters (Intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'IAB',countindb1IAB)
    IF countindb1IAB NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb1IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 1, countindb1IAB_1); index of radius of this stellar population in the val array
        indb1IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 2, countindb1IAB_2); index of temperature of this stellar population in the val array
        indb1IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 3, countindb1IAB_3); index of distance of this stellar population in the val array
        indb1IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 4, countindb1IAB_4); index of the amplitude of this stellar population in the val array
        indb1IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 5, countindb1IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B1IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'IB',countindb1IB)
    IF countindb1IB NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb1IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 1, countindb1IB_1); index of radius of this stellar population in the val array
        indb1IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 2, countindb1IB_2); index of temperature of this stellar population in the val array
        indb1IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 3, countindb1IB_3); index of distance of this stellar population in the val array
        indb1IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 4, countindb1IB_4); index of the amplitude of this stellar population in the val array
        indb1IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 5, countindb1IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B1II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'II',countindb1II)
    IF countindb1II NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb1II_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 1, countindb1II_1); index of radius of this stellar population in the val array
        indb1II_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 2, countindb1II_2); index of temperature of this stellar population in the val array
        indb1II_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 3, countindb1II_3); index of distance of this stellar population in the val array
        indb1II_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 4, countindb1II_4); index of the amplitude of this stellar population in the val array
        indb1II_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 5, countindb1II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B1III stellar population parameters (Normal giant)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'III',countindb1III)
    IF countindb1III NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb1III_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 1, countindb1III_1); index of radius of this stellar population in the val array
        indb1III_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 2, countindb1III_2); index of temperature of this stellar population in the val array
        indb1III_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 3, countindb1III_3); index of distance of this stellar population in the val array
        indb1III_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 4, countindb1III_4); index of the amplitude of this stellar population in the val array
        indb1III_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 5, countindb1III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the B1IV stellar population parameters (Subgiant)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'IV',countindb1IV)
    IF countindb1IV NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb1IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 1, countindb1IV_1); index of radius of this stellar population in the val array
        indb1IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 2, countindb1IV_2); index of temperature of this stellar population in the val array
        indb1IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 3, countindb1IV_3); index of distance of this stellar population in the val array
        indb1IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 4, countindb1IV_4); index of the amplitude of this stellar population in the val array
        indb1IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 5, countindb1IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B1V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'V',countindb1V)
    IF countindb1V NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb1V_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 1, countindb1V_1); index of radius of this stellar population in the val array
        indb1V_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 2, countindb1V_2); index of temperature of this stellar population in the val array
        indb1V_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 3, countindb1V_3); index of distance of this stellar population in the val array
        indb1V_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 4, countindb1V_4); index of the amplitude of this stellar population in the val array
        indb1V_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 5, countindb1V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the B1VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'VI',countindb1VI)
    IF countindb1VI NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb1VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 1, countindb1VI_1); index of radius of this stellar population in the val array
        indb1VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 2, countindb1VI_2); index of temperature of this stellar population in the val array
        indb1VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 3, countindb1VI_3); index of distance of this stellar population in the val array
        indb1VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 4, countindb1VI_4); index of the amplitude of this stellar population in the val array
        indb1VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 5, countindb1VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B1IA+ stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'IA+',countindb1IA+)
    IF countindb1IA+ NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb1IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 1, countindb1IA+_1); index of radius of this stellar population in the val array
        indb1IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 2, countindb1IA+_2); index of temperature of this stellar population in the val array
        indb1IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 3, countindb1IA+_3); index of distance of this stellar population in the val array
        indb1IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 4, countindb1IA+_4); index of the amplitude of this stellar population in the val array
        indb1IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 1 and params EQ 5, countindb1IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the B2 stellar population parameters===========
    ;===================================================================
    
    ; Locating the B2IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'IA+',countindb2IA+)
    IF countindb2IA+ NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb2IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 1, countindb2IA+_1); index of radius of this stellar population in the val array
        indb2IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 2, countindb2IA+_2); index of temperature of this stellar population in the val array
        indb2IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 3, countindb2IA+_3); index of distance of this stellar population in the val array
        indb2IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 4, countindb2IA+_4); index of the amplitude of this stellar population in the val array
        indb2IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 5, countindb2IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B2IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'IA',countindb2IA)
    IF countindb2IA NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb2IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 1, countindb2IA_1); index of radius of this stellar population in the val array
        indb2IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 2, countindb2IA_2); index of temperature of this stellar population in the val array
        indb2IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 3, countindb2IA_3); index of distance of this stellar population in the val array
        indb2IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 4, countindb2IA_4); index of the amplitude of this stellar population in the val array
        indb2IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 5, countindb2IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B2IAB stellar population parameters (Intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'IAB',countindb2IAB)
    IF countindb2IAB NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb2IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 1, countindb2IAB_1); index of radius of this stellar population in the val array
        indb2IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 2, countindb2IAB_2); index of temperature of this stellar population in the val array
        indb2IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 3, countindb2IAB_3); index of distance of this stellar population in the val array
        indb2IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 4, countindb2IAB_4); index of the amplitude of this stellar population in the val array
        indb2IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 5, countindb2IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B2IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'IB',countindb2IB)
    IF countindb2IB NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb2IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 1, countindb2IB_1); index of radius of this stellar population in the val array
        indb2IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 2, countindb2IB_2); index of temperature of this stellar population in the val array
        indb2IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 3, countindb2IB_3); index of distance of this stellar population in the val array
        indb2IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 4, countindb2IB_4); index of the amplitude of this stellar population in the val array
        indb2IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 5, countindb2IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B2II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'II',countindb2II)
    IF countindb2II NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb2II_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 1, countindb2II_1); index of radius of this stellar population in the val array
        indb2II_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 2, countindb2II_2); index of temperature of this stellar population in the val array
        indb2II_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 3, countindb2II_3); index of distance of this stellar population in the val array
        indb2II_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 4, countindb2II_4); index of the amplitude of this stellar population in the val array
        indb2II_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 5, countindb2II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B2III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'III',countindb2III)
    IF countindb2III NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb2III_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 1, countindb2III_1); index of radius of this stellar population in the val array
        indb2III_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 2, countindb2III_2); index of temperature of this stellar population in the val array
        indb2III_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 3, countindb2III_3); index of distance of this stellar population in the val array
        indb2III_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 4, countindb2III_4); index of the amplitude of this stellar population in the val array
        indb2III_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 5, countindb2III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B2IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'IV',countindb2IV)
    IF countindb2IV NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb2IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 1, countindb2IV_1); index of radius of this stellar population in the val array
        indb2IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 2, countindb2IV_2); index of temperature of this stellar population in the val array
        indb2IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 3, countindb2IV_3); index of distance of this stellar population in the val array
        indb2IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 4, countindb2IV_4); index of the amplitude of this stellar population in the val array
        indb2IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 5, countindb2IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B2V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'V',countindb2V)
    IF countindb2V NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb2V_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 1, countindb2V_1); index of radius of this stellar population in the val array
        indb2V_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 2, countindb2V_2); index of temperature of this stellar population in the val array
        indb2V_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 3, countindb2V_3); index of distance of this stellar population in the val array
        indb2V_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 4, countindb2V_4); index of the amplitude of this stellar population in the val array
        indb2V_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 5, countindb2V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B2VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'VI',countindb2VI)
    IF countindb2VI NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb2VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 1, countindb2VI_1); index of radius of this stellar population in the val array
        indb2VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 2, countindb2VI_2); index of temperature of this stellar population in the val array
        indb2VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 3, countindb2VI_3); index of distance of this stellar population in the val array
        indb2VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 4, countindb2VI_4); index of the amplitude of this stellar population in the val array
        indb2VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 5, countindb2VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B2VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'VII',countindb2VII)
    IF countindb2VII NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb2VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 1, countindb2VII_1); index of radius of this stellar population in the val array
        indb2VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 2, countindb2VII_2); index of temperature of this stellar population in the val array
        indb2VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 3, countindb2VII_3); index of distance of this stellar population in the val array
        indb2VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 4, countindb2VII_4); index of the amplitude of this stellar population in the val array
        indb2VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 2 and params EQ 5, countindb2VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the B3 stellar population parameters===========
    ;===================================================================
    
    ; Locating the B3IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'IA+',countindb3IA+)
    IF countindb3IA+ NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb3IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 1, countindb3IA+_1); index of radius of this stellar population in the val array
        indb3IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 2, countindb3IA+_2); index of temperature of this stellar population in the val array
        indb3IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 3, countindb3IA+_3); index of distance of this stellar population in the val array
        indb3IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 4, countindb3IA+_4); index of the amplitude of this stellar population in the val array
        indb3IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 5, countindb3IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B3IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'IA',countindb3IA)
    IF countindb3IA NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb3IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 1, countindb3IA_1); index of radius of this stellar population in the val array
        indb3IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 2, countindb3IA_2); index of temperature of this stellar population in the val array
        indb3IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 3, countindb3IA_3); index of distance of this stellar population in the val array
        indb3IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 4, countindb3IA_4); index of the amplitude of this stellar population in the val array
        indb3IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 5, countindb3IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B3IAB stellar population parameters (Intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'IAB',countindb3IAB)
    IF countindb3IAB NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb3IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 1, countindb3IAB_1); index of radius of this stellar population in the val array
        indb3IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 2, countindb3IAB_2); index of temperature of this stellar population in the val array
        indb3IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 3, countindb3IAB_3); index of distance of this stellar population in the val array
        indb3IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 4, countindb3IAB_4); index of the amplitude of this stellar population in the val array
        indb3IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 5, countindb3IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B3IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'IB',countindb3IB)
    IF countindb3IB NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb3IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 1, countindb3IB_1); index of radius of this stellar population in the val array
        indb3IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 2, countindb3IB_2); index of temperature of this stellar population in the val array
        indb3IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 3, countindb3IB_3); index of distance of this stellar population in the val array
        indb3IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 4, countindb3IB_4); index of the amplitude of this stellar population in the val array
        indb3IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 5, countindb3IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B3II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'II',countindb3II)
    IF countindb3II NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb3II_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 1, countindb3II_1); index of radius of this stellar population in the val array
        indb3II_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 2, countindb3II_2); index of temperature of this stellar population in the val array
        indb3II_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 3, countindb3II_3); index of distance of this stellar population in the val array
        indb3II_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 4, countindb3II_4); index of the amplitude of this stellar population in the val array
        indb3II_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 5, countindb3II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B3III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'III',countindb3III)
    IF countindb3III NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb3III_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 1, countindb3III_1); index of radius of this stellar population in the val array
        indb3III_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 2, countindb3III_2); index of temperature of this stellar population in the val array
        indb3III_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 3, countindb3III_3); index of distance of this stellar population in the val array
        indb3III_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 4, countindb3III_4); index of the amplitude of this stellar population in the val array
        indb3III_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 5, countindb3III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B3IA+ stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'IA+',countindb3IA+)
    IF countindb3IA+ NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb3IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 1, countindb3IA+_1); index of radius of this stellar population in the val array
        indb3IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 2, countindb3IA+_2); index of temperature of this stellar population in the val array
        indb3IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 3, countindb3IA+_3); index of distance of this stellar population in the val array
        indb3IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 4, countindb3IA+_4); index of the amplitude of this stellar population in the val array
        indb3IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 5, countindb3IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B3V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'V',countindb3V)
    IF countindb3V NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb3V_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 1, countindb3V_1); index of radius of this stellar population in the val array
        indb3V_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 2, countindb3V_2); index of temperature of this stellar population in the val array
        indb3V_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 3, countindb3V_3); index of distance of this stellar population in the val array
        indb3V_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 4, countindb3V_4); index of the amplitude of this stellar population in the val array
        indb3V_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 5, countindb3V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B3VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'VI',countindb3VI)
    IF countindb3VI NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb3VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 1, countindb3VI_1); index of radius of this stellar population in the val array
        indb3VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 2, countindb3VI_2); index of temperature of this stellar population in the val array
        indb3VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 3, countindb3VI_3); index of distance of this stellar population in the val array
        indb3VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 4, countindb3VI_4); index of the amplitude of this stellar population in the val array
        indb3VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 5, countindb3VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B3VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'VII',countindb3VII)
    IF countindb3VII NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb3VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 1, countindb3VII_1); index of radius of this stellar population in the val array
        indb3VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 2, countindb3VII_2); index of temperature of this stellar population in the val array
        indb3VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 3, countindb3VII_3); index of distance of this stellar population in the val array
        indb3VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 4, countindb3VII_4); index of the amplitude of this stellar population in the val array
        indb3VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 3 and params EQ 5, countindb3VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the B4 stellar population parameters===========
    ;===================================================================
    
    ; Locating the B4IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'IA+',countindb4IA+)
    IF countindbIA+4 NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb4IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 1, countindb4IA+_1); index of radius of this stellar population in the val array
        indb4IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 2, countindb4IA+_2); index of temperature of this stellar population in the val array
        indb4IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 3, countindb4IA+_3); index of distance of this stellar population in the val array
        indb4IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 4, countindb4IA+_4); index of the amplitude of this stellar population in the val array
        indb4IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 5, countindb4IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
   ; Locating the B4IA stellar population parameters (Luminous supergiants)
   ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'IA',countindb4IA)
   IF countindbIA4 NE 0 THEN BEGIN
       popnumber+=1
       countb+=1
       indb4IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 1, countindb4IA_1); index of radius of this stellar population in the val array
       indb4IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 2, countindb4IA_2); index of temperature of this stellar population in the val array
       indb4IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 3, countindb4IA_3); index of distance of this stellar population in the val array
       indb4IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 4, countindb4IA_4); index of the amplitude of this stellar population in the val array
       indb4IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 5, countindb4IA_5); index of the number of stars of this stellar population in the val array
   ENDIF
   
   
   ; Locating the B4IAB stellar population parameters (Intermediate-size luminous supergiants)
   ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'IAB',countindb4IAB)
   IF countindbIAB4 NE 0 THEN BEGIN
       popnumber+=1
       countb+=1
       indb4IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 1, countindb4IAB_1); index of radius of this stellar population in the val array
       indb4IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 2, countindb4IAB_2); index of temperature of this stellar population in the val array
       indb4IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 3, countindb4IAB_3); index of distance of this stellar population in the val array
       indb4IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 4, countindb4IAB_4); index of the amplitude of this stellar population in the val array
       indb4IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 5, countindb4IAB_5); index of the number of stars of this stellar population in the val array
   ENDIF
   
   ; Locating the B4IB stellar population parameters (Less luminous supergiants)
   ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'IB',countindb4IB)
   IF countindbIB4 NE 0 THEN BEGIN
       popnumber+=1
       countb+=1
       indb4IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 1, countindb4IB_1); index of radius of this stellar population in the val array
       indb4IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 2, countindb4IB_2); index of temperature of this stellar population in the val array
       indb4IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 3, countindb4IB_3); index of distance of this stellar population in the val array
       indb4IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 4, countindb4IB_4); index of the amplitude of this stellar population in the val array
       indb4IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 5, countindb4IB_5); index of the number of stars of this stellar population in the val array
   ENDIF
   
   
   ; Locating the B4II stellar population parameters (Bright giants)
   ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'II',countindb4II)
   IF countindbII4 NE 0 THEN BEGIN
       popnumber+=1
       countb+=1
       indb4II_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 1, countindb4II_1); index of radius of this stellar population in the val array
       indb4II_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 2, countindb4II_2); index of temperature of this stellar population in the val array
       indb4II_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 3, countindb4II_3); index of distance of this stellar population in the val array
       indb4II_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 4, countindb4II_4); index of the amplitude of this stellar population in the val array
       indb4II_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 5, countindb4II_5); index of the number of stars of this stellar population in the val array
   ENDIF
   
   
   ; Locating the B4III stellar population parameters (Normal giants)
   ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'III',countindb4III)
   IF countindbIII4 NE 0 THEN BEGIN
       popnumber+=1
       countb+=1
       indb4III_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 1, countindb4III_1); index of radius of this stellar population in the val array
       indb4III_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 2, countindb4III_2); index of temperature of this stellar population in the val array
       indb4III_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 3, countindb4III_3); index of distance of this stellar population in the val array
       indb4III_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 4, countindb4III_4); index of the amplitude of this stellar population in the val array
       indb4III_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 5, countindb4III_5); index of the number of stars of this stellar population in the val array
   ENDIF
   
   
   ; Locating the B4IV stellar population parameters (Subgiants)
   ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'IV',countindb4IV)
   IF countindbIV4 NE 0 THEN BEGIN
       popnumber+=1
       countb+=1
       indb4IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 1, countindb4IV_1); index of radius of this stellar population in the val array
       indb4IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 2, countindb4IV_2); index of temperature of this stellar population in the val array
       indb4IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 3, countindb4IV_3); index of distance of this stellar population in the val array
       indb4IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 4, countindb4IV_4); index of the amplitude of this stellar population in the val array
       indb4IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 5, countindb4IV_5); index of the number of stars of this stellar population in the val array
   ENDIF
   
   ; Locating the B4V stellar population parameters (Dwarfs: Main-sequence stars)
   ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'V',countindb4V)
   IF countindbV4 NE 0 THEN BEGIN
       popnumber+=1
       countb+=1
       indb4V_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 1, countindb4V_1); index of radius of this stellar population in the val array
       indb4V_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 2, countindb4V_2); index of temperature of this stellar population in the val array
       indb4V_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 3, countindb4V_3); index of distance of this stellar population in the val array
       indb4V_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 4, countindb4V_4); index of the amplitude of this stellar population in the val array
       indb4V_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 5, countindb4V_5); index of the number of stars of this stellar population in the val array
   ENDIF
   
   ; Locating the B4VI stellar population parameters (Subdwarfs)
   ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'VI',countindb4VI)
   IF countindbVI4 NE 0 THEN BEGIN
       popnumber+=1
       countb+=1
       indb4VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 1, countindb4VI_1); index of radius of this stellar population in the val array
       indb4VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 2, countindb4VI_2); index of temperature of this stellar population in the val array
       indb4VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 3, countindb4VI_3); index of distance of this stellar population in the val array
       indb4VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 4, countindb4VI_4); index of the amplitude of this stellar population in the val array
       indb4VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 5, countindb4VI_5); index of the number of stars of this stellar population in the val array
   ENDIF
   
   ; Locating the B4VII stellar population parameters (White dwarfs)
   ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'VII',countindb4VII)
   IF countindbVII4 NE 0 THEN BEGIN
       popnumber+=1
       countb+=1
       indb4VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 1, countindb4VII_1); index of radius of this stellar population in the val array
       indb4VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 2, countindb4VII_2); index of temperature of this stellar population in the val array
       indb4VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 3, countindb4VII_3); index of distance of this stellar population in the val array
       indb4VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 4, countindb4VII_4); index of the amplitude of this stellar population in the val array
       indb4VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 4 and params EQ 5, countindb4VII_5); index of the number of stars of this stellar population in the val array
   ENDIF  
    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the B5 stellar population parameters===========
    ;===================================================================
    
    ; Locating the B5IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'IA+',countindb5IA+)
    IF countindb5IA+ NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb5IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 1, countindb5IA+_1); index of radius of this stellar population in the val array
        indb5IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 2, countindb5IA+_2); index of temperature of this stellar population in the val array
        indb5IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 3, countindb5IA+_3); index of distance of this stellar population in the val array
        indb5IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 4, countindb5IA+_4); index of the amplitude of this stellar population in the val array
        indb5IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 5, countindb5IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the B5IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'IA',countindb5IA)
    IF countindb5IA NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb5IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 1, countindb5IA_1); index of radius of this stellar population in the val array
        indb5IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 2, countindb5IA_2); index of temperature of this stellar population in the val array
        indb5IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 3, countindb5IA_3); index of distance of this stellar population in the val array
        indb5IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 4, countindb5IA_4); index of the amplitude of this stellar population in the val array
        indb5IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 5, countindb5IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the B5IAB stellar population parameters (Intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'IAB',countindb5IAB)
    IF countindb5IAB NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb5IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 1, countindb5IAB_1); index of radius of this stellar population in the val array
        indb5IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 2, countindb5IAB_2); index of temperature of this stellar population in the val array
        indb5IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 3, countindb5IAB_3); index of distance of this stellar population in the val array
        indb5IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 4, countindb5IAB_4); index of the amplitude of this stellar population in the val array
        indb5IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 5, countindb5IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the B5IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'IB',countindb5IB)
    IF countindb5IB NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb5IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 1, countindb5IB_1); index of radius of this stellar population in the val array
        indb5IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 2, countindb5IB_2); index of temperature of this stellar population in the val array
        indb5IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 3, countindb5IB_3); index of distance of this stellar population in the val array
        indb5IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 4, countindb5IB_4); index of the amplitude of this stellar population in the val array
        indb5IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 5, countindb5IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B5II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'II',countindb5II)
    IF countindb5II NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb5II_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 1, countindb5II_1); index of radius of this stellar population in the val array
        indb5II_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 2, countindb5II_2); index of temperature of this stellar population in the val array
        indb5II_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 3, countindb5II_3); index of distance of this stellar population in the val array
        indb5II_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 4, countindb5II_4); index of the amplitude of this stellar population in the val array
        indb5II_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 5, countindb5II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the B5III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'III',countindb5III)
    IF countindb5III NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb5III_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 1, countindb5III_1); index of radius of this stellar population in the val array
        indb5III_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 2, countindb5III_2); index of temperature of this stellar population in the val array
        indb5III_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 3, countindb5III_3); index of distance of this stellar population in the val array
        indb5III_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 4, countindb5III_4); index of the amplitude of this stellar population in the val array
        indb5III_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 5, countindb5III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B5IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'IV',countindb5IV)
    IF countindb5IV NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb5IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 1, countindb5IV_1); index of radius of this stellar population in the val array
        indb5IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 2, countindb5IV_2); index of temperature of this stellar population in the val array
        indb5IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 3, countindb5IV_3); index of distance of this stellar population in the val array
        indb5IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 4, countindb5IV_4); index of the amplitude of this stellar population in the val array
        indb5IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 5, countindb5IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the B5V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'V',countindb5V)
    IF countindb5V NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb5V_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 1, countindb5V_1); index of radius of this stellar population in the val array
        indb5V_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 2, countindb5V_2); index of temperature of this stellar population in the val array
        indb5V_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 3, countindb5V_3); index of distance of this stellar population in the val array
        indb5V_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 4, countindb5V_4); index of the amplitude of this stellar population in the val array
        indb5V_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 5, countindb5V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the B5VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'VI',countindb5VI)
    IF countindb5VI NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb5VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 1, countindb5VI_1); index of radius of this stellar population in the val array
        indb5VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 2, countindb5VI_2); index of temperature of this stellar population in the val array
        indb5VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 3, countindb5VI_3); index of distance of this stellar population in the val array
        indb5VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 4, countindb5VI_4); index of the amplitude of this stellar population in the val array
        indb5VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 5, countindb5VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the B5VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'VII',countindb5VII)
    IF countindb5VII NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb5VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 1, countindb5VII_1); index of radius of this stellar population in the val array
        indb5VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 2, countindb5VII_2); index of temperature of this stellar population in the val array
        indb5VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 3, countindb5VII_3); index of distance of this stellar population in the val array
        indb5VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 4, countindb5VII_4); index of the amplitude of this stellar population in the val array
        indb5VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 5 and params EQ 5, countindb5VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the B6 stellar population parameters===========
    ;===================================================================
    
    ; Locating the B6IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'IA+',countindb6IA+)
    IF countindb6IA+ NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb6IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 1, countindb6IA+_1); index of radius of this stellar population in the val array
        indb6IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 2, countindb6IA+_2); index of temperature of this stellar population in the val array
        indb6IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 3, countindb6IA+_3); index of distance of this stellar population in the val array
        indb6IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 4, countindb6IA+_4); index of the amplitude of this stellar population in the val array
        indb6IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 5, countindb6IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B6IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'IA',countindb6IA)
    IF countindb6IA NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb6IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 1, countindb6IA_1); index of radius of this stellar population in the val array
        indb6IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 2, countindb6IA_2); index of temperature of this stellar population in the val array
        indb6IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 3, countindb6IA_3); index of distance of this stellar population in the val array
        indb6IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 4, countindb6IA_4); index of the amplitude of this stellar population in the val array
        indb6IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 5, countindb6IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B6IAB stellar population parameters (Intermediate-size supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'IAB',countindb6IAB)
    IF countindb6IAB NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb6IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 1, countindb6IAB_1); index of radius of this stellar population in the val array
        indb6IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 2, countindb6IAB_2); index of temperature of this stellar population in the val array
        indb6IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 3, countindb6IAB_3); index of distance of this stellar population in the val array
        indb6IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 4, countindb6IAB_4); index of the amplitude of this stellar population in the val array
        indb6IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 5, countindb6IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the B6IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'IB',countindb6IB)
    IF countindb6IB NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb6IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 1, countindb6IB_1); index of radius of this stellar population in the val array
        indb6IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 2, countindb6IB_2); index of temperature of this stellar population in the val array
        indb6IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 3, countindb6IB_3); index of distance of this stellar population in the val array
        indb6IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 4, countindb6IB_4); index of the amplitude of this stellar population in the val array
        indb6IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 5, countindb6IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the B6II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'II',countindb6II)
    IF countindb6II NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb6II_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 1, countindb6II_1); index of radius of this stellar population in the val array
        indb6II_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 2, countindb6II_2); index of temperature of this stellar population in the val array
        indb6II_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 3, countindb6II_3); index of distance of this stellar population in the val array
        indb6II_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 4, countindb6II_4); index of the amplitude of this stellar population in the val array
        indb6II_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 5, countindb6II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B6III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'III',countindb6III)
    IF countindb6III NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb6III_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 1, countindb6III_1); index of radius of this stellar population in the val array
        indb6III_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 2, countindb6III_2); index of temperature of this stellar population in the val array
        indb6III_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 3, countindb6III_3); index of distance of this stellar population in the val array
        indb6III_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 4, countindb6III_4); index of the amplitude of this stellar population in the val array
        indb6III_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 5, countindb6III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B6IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'IV',countindb6IV)
    IF countindb6IV NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb6IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 1, countindb6IV_1); index of radius of this stellar population in the val array
        indb6IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 2, countindb6IV_2); index of temperature of this stellar population in the val array
        indb6IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 3, countindb6IV_3); index of distance of this stellar population in the val array
        indb6IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 4, countindb6IV_4); index of the amplitude of this stellar population in the val array
        indb6IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 5, countindb6IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B6V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'V',countindb6V)
    IF countindb6V NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb6V_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 1, countindb6V_1); index of radius of this stellar population in the val array
        indb6V_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 2, countindb6V_2); index of temperature of this stellar population in the val array
        indb6V_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 3, countindb6V_3); index of distance of this stellar population in the val array
        indb6V_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 4, countindb6V_4); index of the amplitude of this stellar population in the val array
        indb6V_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 5, countindb6V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the B6VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'VI',countindb6VI)
    IF countindb6VI NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb6VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 1, countindb6VI_1); index of radius of this stellar population in the VIal array
        indb6VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 2, countindb6VI_2); index of temperature of this stellar population in the VIal array
        indb6VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 3, countindb6VI_3); index of distance of this stellar population in the VIal array
        indb6VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 4, countindb6VI_4); index of the amplitude of this stellar population in the VIal array
        indb6VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 5, countindb6VI_5); index of the number of stars of this stellar population in the VIal array
    ENDIF
    
    ; Locating the B6VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'VII',countindb6VII)
    IF countindb6VII NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb6VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 1, countindb6VII_1); index of radius of this stellar population in the VIIal array
        indb6VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 2, countindb6VII_2); index of temperature of this stellar population in the VIIal array
        indb6VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 3, countindb6VII_3); index of distance of this stellar population in the VIIal array
        indb6VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 4, countindb6VII_4); index of the amplitude of this stellar population in the VIIal array
        indb6VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 6 and params EQ 5, countindb6VII_5); index of the number of stars of this stellar population in the VIIal array
    ENDIF
    
    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the B7 stellar population parameters===========
    ;===================================================================
    
    ; Locating the B7IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'IA+',countindb7IA+)
    IF countindbIA+7 NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb7IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 1, countindb7IA+_1); index of radius of this stellar population in the val array
        indb7IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 2, countindb7IA+_2); index of temperature of this stellar population in the val array
        indb7IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 3, countindb7IA+_3); index of distance of this stellar population in the val array
        indb7IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 4, countindb7IA+_4); index of the amplitude of this stellar population in the val array
        indb7IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 5, countindb7IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the B7IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'IA',countindb7IA)
    IF countindbIA7 NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb7IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 1, countindb7IA_1); index of radius of this stellar population in the val array
        indb7IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 2, countindb7IA_2); index of temperature of this stellar population in the val array
        indb7IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 3, countindb7IA_3); index of distance of this stellar population in the val array
        indb7IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 4, countindb7IA_4); index of the amplitude of this stellar population in the val array
        indb7IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 5, countindb7IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the B7IAB stellar population parameters (Intermediate-size luminous sumergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'IAB',countindb7IAB)
    IF countindbIAB7 NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb7IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 1, countindb7IAB_1); index of radius of this stellar population in the val array
        indb7IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 2, countindb7IAB_2); index of temperature of this stellar population in the val array
        indb7IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 3, countindb7IAB_3); index of distance of this stellar population in the val array
        indb7IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 4, countindb7IAB_4); index of the amplitude of this stellar population in the val array
        indb7IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 5, countindb7IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the B7IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'IB',countindb7IB)
    IF countindbIB7 NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb7IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 1, countindb7IB_1); index of radius of this stellar population in the val array
        indb7IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 2, countindb7IB_2); index of temperature of this stellar population in the val array
        indb7IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 3, countindb7IB_3); index of distance of this stellar population in the val array
        indb7IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 4, countindb7IB_4); index of the amplitude of this stellar population in the val array
        indb7IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 5, countindb7IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the B7II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'II',countindb7II)
    IF countindbII7 NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb7II_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 1, countindb7II_1); index of radius of this stellar population in the val array
        indb7II_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 2, countindb7II_2); index of temperature of this stellar population in the val array
        indb7II_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 3, countindb7II_3); index of distance of this stellar population in the val array
        indb7II_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 4, countindb7II_4); index of the amplitude of this stellar population in the val array
        indb7II_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 5, countindb7II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B7III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'III',countindb7III)
    IF countindbIII7 NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb7III_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 1, countindb7III_1); index of radius of this stellar population in the val array
        indb7III_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 2, countindb7III_2); index of temperature of this stellar population in the val array
        indb7III_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 3, countindb7III_3); index of distance of this stellar population in the val array
        indb7III_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 4, countindb7III_4); index of the amplitude of this stellar population in the val array
        indb7III_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 5, countindb7III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B7IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'IV',countindb7IV)
    IF countindbIV7 NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb7IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 1, countindb7IV_1); index of radius of this stellar population in the val array
        indb7IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 2, countindb7IV_2); index of temperature of this stellar population in the val array
        indb7IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 3, countindb7IV_3); index of distance of this stellar population in the val array
        indb7IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 4, countindb7IV_4); index of the amplitude of this stellar population in the val array
        indb7IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 5, countindb7IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B7V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'V',countindb7V)
    IF countindbV7 NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb7V_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 1, countindb7V_1); index of radius of this stellar population in the val array
        indb7V_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 2, countindb7V_2); index of temperature of this stellar population in the val array
        indb7V_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 3, countindb7V_3); index of distance of this stellar population in the val array
        indb7V_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 4, countindb7V_4); index of the amplitude of this stellar population in the val array
        indb7V_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 5, countindb7V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B7VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'VI',countindb7VI)
    IF countindbVI7 NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb7VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 1, countindb7VI_1); index of radius of this stellar population in the val array
        indb7VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 2, countindb7VI_2); index of temperature of this stellar population in the val array
        indb7VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 3, countindb7VI_3); index of distance of this stellar population in the val array
        indb7VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 4, countindb7VI_4); index of the amplitude of this stellar population in the val array
        indb7VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 5, countindb7VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B7VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'VII',countindb7VII)
    IF countindbVII7 NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb7VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 1, countindb7VII_1); index of radius of this stellar population in the val array
        indb7VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 2, countindb7VII_2); index of temperature of this stellar population in the val array
        indb7VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 3, countindb7VII_3); index of distance of this stellar population in the val array
        indb7VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 4, countindb7VII_4); index of the amplitude of this stellar population in the val array
        indb7VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 7 and params EQ 5, countindb7VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the B8 stellar population parameters===========
    ;===================================================================
    
    ; Locating the B8IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'IA+',countindb8IA+)
    IF countindb8IA+ NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb8IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 1, countindb8IA+_1); index of radius of this stellar population in the val array
        indb8IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 2, countindb8IA+_2); index of temperature of this stellar population in the val array
        indb8IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 3, countindb8IA+_3); index of distance of this stellar population in the val array
        indb8IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 4, countindb8IA+_4); index of the amplitude of this stellar population in the val array
        indb8IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 5, countindb8IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the B8IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'IA',countindb8IA)
    IF countindb8IA NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb8IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 1, countindb8IA_1); index of radius of this stellar population in the val array
        indb8IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 2, countindb8IA_2); index of temperature of this stellar population in the val array
        indb8IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 3, countindb8IA_3); index of distance of this stellar population in the val array
        indb8IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 4, countindb8IA_4); index of the amplitude of this stellar population in the val array
        indb8IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 5, countindb8IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the B8IAB stellar population parameters (Intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'IAB',countindb8IAB)
    IF countindb8IAB NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb8IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 1, countindb8IAB_1); index of radius of this stellar population in the val array
        indb8IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 2, countindb8IAB_2); index of temperature of this stellar population in the val array
        indb8IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 3, countindb8IAB_3); index of distance of this stellar population in the val array
        indb8IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 4, countindb8IAB_4); index of the amplitude of this stellar population in the val array
        indb8IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 5, countindb8IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B8IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'IB',countindb8IB)
    IF countindb8IB NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb8IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 1, countindb8IB_1); index of radius of this stellar population in the val array
        indb8IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 2, countindb8IB_2); index of temperature of this stellar population in the val array
        indb8IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 3, countindb8IB_3); index of distance of this stellar population in the val array
        indb8IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 4, countindb8IB_4); index of the amplitude of this stellar population in the val array
        indb8IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 5, countindb8IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the B8II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'II',countindb8II)
    IF countindb8II NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb8II_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 1, countindb8II_1); index of radius of this stellar population in the val array
        indb8II_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 2, countindb8II_2); index of temperature of this stellar population in the val array
        indb8II_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 3, countindb8II_3); index of distance of this stellar population in the val array
        indb8II_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 4, countindb8II_4); index of the amplitude of this stellar population in the val array
        indb8II_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 5, countindb8II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the B8III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'III',countindb8III)
    IF countindb8III NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb8III_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 1, countindb8III_1); index of radius of this stellar population in the val array
        indb8III_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 2, countindb8III_2); index of temperature of this stellar population in the val array
        indb8III_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 3, countindb8III_3); index of distance of this stellar population in the val array
        indb8III_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 4, countindb8III_4); index of the amplitude of this stellar population in the val array
        indb8III_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 5, countindb8III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B8IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'IV',countindb8IV)
    IF countindb8IV NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb8IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 1, countindb8IV_1); index of radius of this stellar population in the val array
        indb8IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 2, countindb8IV_2); index of temperature of this stellar population in the val array
        indb8IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 3, countindb8IV_3); index of distance of this stellar population in the val array
        indb8IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 4, countindb8IV_4); index of the amplitude of this stellar population in the val array
        indb8IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 5, countindb8IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B8V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'V',countindb8V)
    IF countindb8V NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb8V_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 1, countindb8V_1); index of radius of this stellar population in the val array
        indb8V_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 2, countindb8V_2); index of temperature of this stellar population in the val array
        indb8V_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 3, countindb8V_3); index of distance of this stellar population in the val array
        indb8V_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 4, countindb8V_4); index of the amplitude of this stellar population in the val array
        indb8V_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 5, countindb8V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B8VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'VI',countindb8VI)
    IF countindb8VI NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb8VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 1, countindb8VI_1); index of radius of this stellar population in the val array
        indb8VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 2, countindb8VI_2); index of temperature of this stellar population in the val array
        indb8VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 3, countindb8VI_3); index of distance of this stellar population in the val array
        indb8VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 4, countindb8VI_4); index of the amplitude of this stellar population in the val array
        indb8VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 5, countindb8VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B8VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'VII',countindb8VII)
    IF countindb8VII NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb8VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 1, countindb8VII_1); index of radius of this stellar population in the val array
        indb8VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 2, countindb8VII_2); index of temperature of this stellar population in the val array
        indb8VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 3, countindb8VII_3); index of distance of this stellar population in the val array
        indb8VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 4, countindb8VII_4); index of the amplitude of this stellar population in the val array
        indb8VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 8 and params EQ 5, countindb8VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the B9 stellar population parameters===========
    ;===================================================================
    
    ; Locating the B9IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'IA+',countindb9IA+)
    IF countindb9IA+ NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb9IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 1, countindb9IA+_1); index of radius of this stellar population in the val array
        indb9IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 2, countindb9IA+_2); index of temperature of this stellar population in the val array
        indb9IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 3, countindb9IA+_3); index of distance of this stellar population in the val array
        indb9IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 4, countindb9IA+_4); index of the amplitude of this stellar population in the val array
        indb9IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and parmas EQ 5, countindb9IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the B9IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'IA',countindb9IA)
    IF countindb9IA NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb9IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 1, countindb9IA_1); index of radius of this stellar population in the val array
        indb9IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 2, countindb9IA_2); index of temperature of this stellar population in the val array
        indb9IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 3, countindb9IA_3); index of distance of this stellar population in the val array
        indb9IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 4, countindb9IA_4); index of the amplitude of this stellar population in the val array
        indb9IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and parmas EQ 5, countindb9IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the B9IAB stellar population parameters (Intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'IAB',countindb9IAB)
    IF countindb9IAB NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb9IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 1, countindb9IAB_1); index of radius of this stellar population in the val array
        indb9IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 2, countindb9IAB_2); index of temperature of this stellar population in the val array
        indb9IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 3, countindb9IAB_3); index of distance of this stellar population in the val array
        indb9IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 4, countindb9IAB_4); index of the amplitude of this stellar population in the val array
        indb9IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and parmas EQ 5, countindb9IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B9IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'IB',countindb9IB)
    IF countindb9IB NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb9IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 1, countindb9IB_1); index of radius of this stellar population in the val array
        indb9IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 2, countindb9IB_2); index of temperature of this stellar population in the val array
        indb9IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 3, countindb9IB_3); index of distance of this stellar population in the val array
        indb9IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 4, countindb9IB_4); index of the amplitude of this stellar population in the val array
        indb9IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and parmas EQ 5, countindb9IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B9II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'II',countindb9II)
    IF countindb9II NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb9II_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 1, countindb9II_1); index of radius of this stellar population in the val array
        indb9II_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 2, countindb9II_2); index of temperature of this stellar population in the val array
        indb9II_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 3, countindb9II_3); index of distance of this stellar population in the val array
        indb9II_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 4, countindb9II_4); index of the amplitude of this stellar population in the val array
        indb9II_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and parmas EQ 5, countindb9II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the B9III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'III',countindb9III)
    IF countindb9III NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb9III_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 1, countindb9III_1); index of radius of this stellar population in the val array
        indb9III_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 2, countindb9III_2); index of temperature of this stellar population in the val array
        indb9III_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 3, countindb9III_3); index of distance of this stellar population in the val array
        indb9III_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 4, countindb9III_4); index of the amplitude of this stellar population in the val array
        indb9III_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and parmas EQ 5, countindb9III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the B9IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'IV',countindb9IV)
    IF countindb9IV NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb9IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 1, countindb9IV_1); index of radius of this stellar population in the val array
        indb9IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 2, countindb9IV_2); index of temperature of this stellar population in the val array
        indb9IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 3, countindb9IV_3); index of distance of this stellar population in the val array
        indb9IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 4, countindb9IV_4); index of the amplitude of this stellar population in the val array
        indb9IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and parmas EQ 5, countindb9IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the B9V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'V',countindb9V)
    IF countindb9V NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb9V_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 1, countindb9V_1); index of radius of this stellar population in the val array
        indb9V_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 2, countindb9V_2); index of temperature of this stellar population in the val array
        indb9V_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 3, countindb9V_3); index of distance of this stellar population in the val array
        indb9V_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 4, countindb9V_4); index of the amplitude of this stellar population in the val array
        indb9V_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and parmas EQ 5, countindb9V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the B9VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'VI',countindb9VI)
    IF countindb9VI NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb9VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 1, countindb9VI_1); index of radius of this stellar population in the val array
        indb9VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 2, countindb9VI_2); index of temperature of this stellar population in the val array
        indb9VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 3, countindb9VI_3); index of distance of this stellar population in the val array
        indb9VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 4, countindb9VI_4); index of the amplitude of this stellar population in the val array
        indb9VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and parmas EQ 5, countindb9VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the B9VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'VII',countindb9VII)
    IF countindb9VII NE 0 THEN BEGIN
        popnumber+=1
        countb+=1
        indb9VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 1, countindb9VII_1); index of radius of this stellar population in the val array
        indb9VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 2, countindb9VII_2); index of temperature of this stellar population in the val array
        indb9VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 3, countindb9VII_3); index of distance of this stellar population in the val array
        indb9VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and params EQ 4, countindb9VII_4); index of the amplitude of this stellar population in the val array
        indb9VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'B' and strmid(key,1,1) EQ 9 and parmas EQ 5, countindb9VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the A0 stellar population parameters===========
    ;===================================================================
    
    ; Locating the A0IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'IA+',countinda0IA+)
    IF countinda0IA+ NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda0IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 1, countinda0IA+_1); index of radius of this stellar population in the val array
        inda0IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 2, countinda0IA+_2); index of temperature of this stellar population in the val array
        inda0IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 3, countinda0IA+_3); index of distance of this stellar population in the val array
        inda0IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 4, countinda0IA+_4); index of the amplitude of this stellar population in the val array
        inda0IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 5, countinda0IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A0IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'IA',countinda0IA)
    IF countinda0IA NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda0IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 1, countinda0IA_1); index of radius of this stellar population in the val array
        inda0IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 2, countinda0IA_2); index of temperature of this stellar population in the val array
        inda0IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 3, countinda0IA_3); index of distance of this stellar population in the val array
        inda0IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 4, countinda0IA_4); index of the amplitude of this stellar population in the val array
        inda0IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 5, countinda0IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A0IAB stellar population parameters (Intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'IAB',countinda0IAB)
    IF countinda0IAB NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda0IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 1, countinda0IAB_1); index of radius of this stellar population in the val array
        inda0IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 2, countinda0IAB_2); index of temperature of this stellar population in the val array
        inda0IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 3, countinda0IAB_3); index of distance of this stellar population in the val array
        inda0IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 4, countinda0IAB_4); index of the amplitude of this stellar population in the val array
        inda0IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 5, countinda0IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A0IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'IB',countinda0IB)
    IF countinda0IB NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda0IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 1, countinda0IB_1); index of radius of this stellar population in the val array
        inda0IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 2, countinda0IB_2); index of temperature of this stellar population in the val array
        inda0IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 3, countinda0IB_3); index of distance of this stellar population in the val array
        inda0IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 4, countinda0IB_4); index of the amplitude of this stellar population in the val array
        inda0IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 5, countinda0IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the A0II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'II',countinda0II)
    IF countinda0II NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda0II_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 1, countinda0II_1); index of radius of this stellar population in the val array
        inda0II_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 2, countinda0II_2); index of temperature of this stellar population in the val array
        inda0II_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 3, countinda0II_3); index of distance of this stellar population in the val array
        inda0II_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 4, countinda0II_4); index of the amplitude of this stellar population in the val array
        inda0II_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 5, countinda0II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the A0III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'III',countinda0III)
    IF countinda0III NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda0III_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 1, countinda0III_1); index of radius of this stellar population in the val array
        inda0III_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 2, countinda0III_2); index of temperature of this stellar population in the val array
        inda0III_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 3, countinda0III_3); index of distance of this stellar population in the val array
        inda0III_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 4, countinda0III_4); index of the amplitude of this stellar population in the val array
        inda0III_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 5, countinda0III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A0IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'IV',countinda0IV)
    IF countinda0IV NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda0IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 1, countinda0IV_1); index of radius of this stellar population in the val array
        inda0IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 2, countinda0IV_2); index of temperature of this stellar population in the val array
        inda0IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 3, countinda0IV_3); index of distance of this stellar population in the val array
        inda0IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 4, countinda0IV_4); index of the amplitude of this stellar population in the val array
        inda0IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 5, countinda0IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A0V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'V',countinda0V)
    IF countinda0V NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda0V_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 1, countinda0V_1); index of radius of this stellar population in the val array
        inda0V_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 2, countinda0V_2); index of temperature of this stellar population in the val array
        inda0V_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 3, countinda0V_3); index of distance of this stellar population in the val array
        inda0V_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 4, countinda0V_4); index of the amplitude of this stellar population in the val array
        inda0V_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 5, countinda0V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A0VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'VI',countinda0VI)
    IF countinda0VI NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda0VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 1, countinda0VI_1); index of radius of this stellar population in the val array
        inda0VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 2, countinda0VI_2); index of temperature of this stellar population in the val array
        inda0VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 3, countinda0VI_3); index of distance of this stellar population in the val array
        inda0VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 4, countinda0VI_4); index of the amplitude of this stellar population in the val array
        inda0VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 5, countinda0VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the A0VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'VII',countinda0VII)
    IF countinda0VII NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda0VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 1, countinda0VII_1); index of radius of this stellar population in the val array
        inda0VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 2, countinda0VII_2); index of temperature of this stellar population in the val array
        inda0VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 3, countinda0VII_3); index of distance of this stellar population in the val array
        inda0VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 4, countinda0VII_4); index of the amplitude of this stellar population in the val array
        inda0VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 0 and params EQ 5, countinda0VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
       
    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the A1 stellar population parameters===========
    ;===================================================================
    
    ; Locating the A1IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'IA+',countinda1IA+)
    IF countinda1IA+ NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda1IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 1, countinda1IA+_1); index of radius of this stellar population in the val array
        inda1IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 2, countinda1IA+_2); index of temperature of this stellar population in the val array
        inda1IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 3, countinda1IA+_3); index of distance of this stellar population in the val array
        inda1IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 4, countinda1IA+_4); index of the amplitude of this stellar population in the val array
        inda1IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 5, countinda1IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A1IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'IA',countinda1IA)
    IF countinda1IA NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda1IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 1, countinda1IA_1); index of radius of this stellar population in the val array
        inda1IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 2, countinda1IA_2); index of temperature of this stellar population in the val array
        inda1IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 3, countinda1IA_3); index of distance of this stellar population in the val array
        inda1IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 4, countinda1IA_4); index of the amplitude of this stellar population in the val array
        inda1IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 5, countinda1IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the A1IAB stellar population parameters (Intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'IAB',countinda1IAB)
    IF countinda1IAB NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda1IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 1, countinda1IAB_1); index of radius of this stellar population in the val array
        inda1IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 2, countinda1IAB_2); index of temperature of this stellar population in the val array
        inda1IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 3, countinda1IAB_3); index of distance of this stellar population in the val array
        inda1IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 4, countinda1IAB_4); index of the amplitude of this stellar population in the val array
        inda1IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 5, countinda1IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A1IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'IB',countinda1IB)
    IF countinda1IB NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda1IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 1, countinda1IB_1); index of radius of this stellar population in the val array
        inda1IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 2, countinda1IB_2); index of temperature of this stellar population in the val array
        inda1IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 3, countinda1IB_3); index of distance of this stellar population in the val array
        inda1IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 4, countinda1IB_4); index of the amplitude of this stellar population in the val array
        inda1IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 5, countinda1IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the A1II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'II',countinda1II)
    IF countinda1II NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda1II_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 1, countinda1II_1); index of radius of this stellar population in the val array
        inda1II_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 2, countinda1II_2); index of temperature of this stellar population in the val array
        inda1II_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 3, countinda1II_3); index of distance of this stellar population in the val array
        inda1II_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 4, countinda1II_4); index of the amplitude of this stellar population in the val array
        inda1II_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 5, countinda1II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A1III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'III',countinda1III)
    IF countinda1III NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda1III_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 1, countinda1III_1); index of radius of this stellar population in the val array
        inda1III_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 2, countinda1III_2); index of temperature of this stellar population in the val array
        inda1III_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 3, countinda1III_3); index of distance of this stellar population in the val array
        inda1III_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 4, countinda1III_4); index of the amplitude of this stellar population in the val array
        inda1III_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 5, countinda1III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A1IV stellar population parameters (Subgiant)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'IV',countinda1IV)
    IF countinda1IV NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda1IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 1, countinda1IV_1); index of radius of this stellar population in the val array
        inda1IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 2, countinda1IV_2); index of temperature of this stellar population in the val array
        inda1IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 3, countinda1IV_3); index of distance of this stellar population in the val array
        inda1IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 4, countinda1IV_4); index of the amplitude of this stellar population in the val array
        inda1IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 5, countinda1IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the A1V stellar population parameters (Dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'V',countinda1V)
    IF countinda1V NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda1V_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 1, countinda1V_1); index of radius of this stellar population in the val array
        inda1V_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 2, countinda1V_2); index of temperature of this stellar population in the val array
        inda1V_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 3, countinda1V_3); index of distance of this stellar population in the val array
        inda1V_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 4, countinda1V_4); index of the amplitude of this stellar population in the val array
        inda1V_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 5, countinda1V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the A1VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'VI',countinda1VI)
    IF countinda1VI NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda1VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 1, countinda1VI_1); index of radius of this stellar population in the val array
        inda1VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 2, countinda1VI_2); index of temperature of this stellar population in the val array
        inda1VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 3, countinda1VI_3); index of distance of this stellar population in the val array
        inda1VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 4, countinda1VI_4); index of the amplitude of this stellar population in the val array
        inda1VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 5, countinda1VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A1VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'VII',countinda1VII)
    IF countinda1VII NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda1VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 1, countinda1VII_1); index of radius of this stellar population in the val array
        inda1VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 2, countinda1VII_2); index of temperature of this stellar population in the val array
        inda1VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 3, countinda1VII_3); index of distance of this stellar population in the val array
        inda1VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 4, countinda1VII_4); index of the amplitude of this stellar population in the val array
        inda1VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 1 and params EQ 5, countinda1VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the A2 stellar population parameters===========
    ;===================================================================
    
    ; Locating the A2IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'IA+',countinda2IA+)
    IF countinda2IA+ NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda2IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 1, countinda2IA+_1); index of radius of this stellar population in the val array
        inda2IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 2, countinda2IA+_2); index of temperature of this stellar population in the val array
        inda2IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 3, countinda2IA+_3); index of distance of this stellar population in the val array
        inda2IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 4, countinda2IA+_4); index of the amplitude of this stellar population in the val array
        inda2IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 5, countinda2IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A2IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'IA',countinda2IA)
    IF countinda2IA NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda2IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 1, countinda2IA_1); index of radius of this stellar population in the val array
        inda2IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 2, countinda2IA_2); index of temperature of this stellar population in the val array
        inda2IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 3, countinda2IA_3); index of distance of this stellar population in the val array
        inda2IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 4, countinda2IA_4); index of the amplitude of this stellar population in the val array
        inda2IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 5, countinda2IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A2IAB stellar population parameters (Intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'IAB',countinda2IAB)
    IF countinda2IAB NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda2IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 1, countinda2IAB_1); index of radius of this stellar population in the val array
        inda2IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 2, countinda2IAB_2); index of temperature of this stellar population in the val array
        inda2IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 3, countinda2IAB_3); index of distance of this stellar population in the val array
        inda2IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 4, countinda2IAB_4); index of the amplitude of this stellar population in the val array
        inda2IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 5, countinda2IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A2IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'IB',countinda2IB)
    IF countinda2IB NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda2IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 1, countinda2IB_1); index of radius of this stellar population in the val array
        inda2IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 2, countinda2IB_2); index of temperature of this stellar population in the val array
        inda2IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 3, countinda2IB_3); index of distance of this stellar population in the val array
        inda2IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 4, countinda2IB_4); index of the amplitude of this stellar population in the val array
        inda2IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 5, countinda2IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A2II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'II',countinda2II)
    IF countinda2II NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda2II_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 1, countinda2II_1); index of radius of this stellar population in the val array
        inda2II_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 2, countinda2II_2); index of temperature of this stellar population in the val array
        inda2II_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 3, countinda2II_3); index of distance of this stellar population in the val array
        inda2II_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 4, countinda2II_4); index of the amplitude of this stellar population in the val array
        inda2II_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 5, countinda2II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the A2III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'III',countinda2III)
    IF countinda2III NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda2III_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 1, countinda2III_1); index of radius of this stellar population in the val array
        inda2III_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 2, countinda2III_2); index of temperature of this stellar population in the val array
        inda2III_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 3, countinda2III_3); index of distance of this stellar population in the val array
        inda2III_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 4, countinda2III_4); index of the amplitude of this stellar population in the val array
        inda2III_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 5, countinda2III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A2IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'IV',countinda2IV)
    IF countinda2IV NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda2IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 1, countinda2IV_1); index of radius of this stellar population in the val array
        inda2IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 2, countinda2IV_2); index of temperature of this stellar population in the val array
        inda2IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 3, countinda2IV_3); index of distance of this stellar population in the val array
        inda2IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 4, countinda2IV_4); index of the amplitude of this stellar population in the val array
        inda2IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 5, countinda2IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A2V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'V',countinda2V)
    IF countinda2V NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda2V_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 1, countinda2V_1); index of radius of this stellar population in the val array
        inda2V_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 2, countinda2V_2); index of temperature of this stellar population in the val array
        inda2V_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 3, countinda2V_3); index of distance of this stellar population in the val array
        inda2V_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 4, countinda2V_4); index of the amplitude of this stellar population in the val array
        inda2V_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 5, countinda2V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A2VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'VI',countinda2VI)
    IF countinda2VI NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda2VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 1, countinda2VI_1); index of radius of this stellar population in the val array
        inda2VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 2, countinda2VI_2); index of temperature of this stellar population in the val array
        inda2VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 3, countinda2VI_3); index of distance of this stellar population in the val array
        inda2VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 4, countinda2VI_4); index of the amplitude of this stellar population in the val array
        inda2VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 5, countinda2VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A2VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'VII',countinda2VII)
    IF countinda2VII NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda2VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 1, countinda2VII_1); index of radius of this stellar population in the val array
        inda2VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 2, countinda2VII_2); index of temperature of this stellar population in the val array
        inda2VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 3, countinda2VII_3); index of distance of this stellar population in the val array
        inda2VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 4, countinda2VII_4); index of the amplitude of this stellar population in the val array
        inda2VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 2 and params EQ 5, countinda2VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the A3 stellar population parameters===========
    ;===================================================================
    
    ; Locating the A3IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'IA+',countinda3IA+)
    IF countinda3IA+ NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda3IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 1, countinda3IA+_1); index of radius of this stellar population in the val array
        inda3IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 2, countinda3IA+_2); index of temperature of this stellar population in the val array
        inda3IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 3, countinda3IA+_3); index of distance of this stellar population in the val array
        inda3IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 4, countinda3IA+_4); index of the amplitude of this stellar population in the val array
        inda3IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 5, countinda3IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the A3IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'IA',countinda3IA)
    IF countinda3IA NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda3IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 1, countinda3IA_1); index of radius of this stellar population in the val array
        inda3IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 2, countinda3IA_2); index of temperature of this stellar population in the val array
        inda3IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 3, countinda3IA_3); index of distance of this stellar population in the val array
        inda3IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 4, countinda3IA_4); index of the amplitude of this stellar population in the val array
        inda3IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 5, countinda3IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the A3IAB stellar population parameters (Intermediate-size luminous supergiant)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'IAB',countinda3IAB)
    IF countinda3IAB NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda3IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 1, countinda3IAB_1); index of radius of this stellar population in the val array
        inda3IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 2, countinda3IAB_2); index of temperature of this stellar population in the val array
        inda3IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 3, countinda3IAB_3); index of distance of this stellar population in the val array
        inda3IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 4, countinda3IAB_4); index of the amplitude of this stellar population in the val array
        inda3IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 5, countinda3IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the A3IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'IB',countinda3IB)
    IF countinda3IB NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda3IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 1, countinda3IB_1); index of radius of this stellar population in the val array
        inda3IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 2, countinda3IB_2); index of temperature of this stellar population in the val array
        inda3IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 3, countinda3IB_3); index of distance of this stellar population in the val array
        inda3IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 4, countinda3IB_4); index of the amplitude of this stellar population in the val array
        inda3IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 5, countinda3IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the A3II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'II',countinda3II)
    IF countinda3II NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda3II_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 1, countinda3II_1); index of radius of this stellar population in the val array
        inda3II_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 2, countinda3II_2); index of temperature of this stellar population in the val array
        inda3II_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 3, countinda3II_3); index of distance of this stellar population in the val array
        inda3II_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 4, countinda3II_4); index of the amplitude of this stellar population in the val array
        inda3II_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 5, countinda3II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A3III stellar population parameters (Normal giant)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'III',countinda3III)
    IF countinda3III NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda3III_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 1, countinda3III_1); index of radius of this stellar population in the val array
        inda3III_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 2, countinda3III_2); index of temperature of this stellar population in the val array
        inda3III_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 3, countinda3III_3); index of distance of this stellar population in the val array
        inda3III_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 4, countinda3III_4); index of the amplitude of this stellar population in the val array
        inda3III_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 5, countinda3III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    
    ; Locating the A3IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'IV',countinda3IV)
    IF countinda3IV NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda3IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 1, countinda3IV_1); index of radius of this stellar population in the val array
        inda3IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 2, countinda3IV_2); index of temperature of this stellar population in the val array
        inda3IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 3, countinda3IV_3); index of distance of this stellar population in the val array
        inda3IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 4, countinda3IV_4); index of the amplitude of this stellar population in the val array
        inda3IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 5, countinda3IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A3V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'V',countinda3V)
    IF countinda3V NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda3V_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 1, countinda3V_1); index of radius of this stellar population in the val array
        inda3V_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 2, countinda3V_2); index of temperature of this stellar population in the val array
        inda3V_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 3, countinda3V_3); index of distance of this stellar population in the val array
        inda3V_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 4, countinda3V_4); index of the amplitude of this stellar population in the val array
        inda3V_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 5, countinda3V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the A3VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'VI',countinda3VI)
    IF countinda3VI NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda3VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 1, countinda3VI_1); index of radius of this stellar population in the val array
        inda3VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 2, countinda3VI_2); index of temperature of this stellar population in the val array
        inda3VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 3, countinda3VI_3); index of distance of this stellar population in the val array
        inda3VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 4, countinda3VI_4); index of the amplitude of this stellar population in the val array
        inda3VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 5, countinda3VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the A3VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'VII',countinda3VII)
    IF countinda3VII NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda3VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 1, countinda3VII_1); index of radius of this stellar population in the val array
        inda3VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 2, countinda3VII_2); index of temperature of this stellar population in the val array
        inda3VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 3, countinda3VII_3); index of distance of this stellar population in the val array
        inda3VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 4, countinda3VII_4); index of the amplitude of this stellar population in the val array
        inda3VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 3 and params EQ 5, countinda3VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the A4 stellar population parameters===========
    ;===================================================================
    
    ; Locating the A4IA+ stellar population parameters (hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'IA+',countinda4IA+)
    IF countinda4IA+ NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda4IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 1, countinda4IA+_1); index of radius of this stellar population in the val array
        inda4IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 2, countinda4IA+_2); index of temperature of this stellar population in the val array
        inda4IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 3, countinda4IA+_3); index of distance of this stellar population in the val array
        inda4IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 4, countinda4IA+_4); index of the amplitude of this stellar population in the val array
        inda4IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 5, countinda4IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the A4IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'IA',countinda4IA)
    IF countinda4IA NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda4IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 1, countinda4IA_1); index of radius of this stellar population in the val array
        inda4IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 2, countinda4IA_2); index of temperature of this stellar population in the val array
        inda4IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 3, countinda4IA_3); index of distance of this stellar population in the val array
        inda4IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 4, countinda4IA_4); index of the amplitude of this stellar population in the val array
        inda4IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 5, countinda4IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A4IAB stellar population parameters (Intermediate-size luminous super giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'IAB',countinda4IAB)
    IF countinda4IAB NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda4IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 1, countinda4IAB_1); index of radius of this stellar population in the val array
        inda4IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 2, countinda4IAB_2); index of temperature of this stellar population in the val array
        inda4IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 3, countinda4IAB_3); index of distance of this stellar population in the val array
        inda4IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 4, countinda4IAB_4); index of the amplitude of this stellar population in the val array
        inda4IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 5, countinda4IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the A4IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'IB',countinda4IB)
    IF countinda4IB NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda4IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 1, countinda4IB_1); index of radius of this stellar population in the val array
        inda4IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 2, countinda4IB_2); index of temperature of this stellar population in the val array
        inda4IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 3, countinda4IB_3); index of distance of this stellar population in the val array
        inda4IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 4, countinda4IB_4); index of the amplitude of this stellar population in the val array
        inda4IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 5, countinda4IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A4II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'II',countinda4II)
    IF countinda4II NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda4II_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 1, countinda4II_1); index of radius of this stellar population in the val array
        inda4II_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 2, countinda4II_2); index of temperature of this stellar population in the val array
        inda4II_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 3, countinda4II_3); index of distance of this stellar population in the val array
        inda4II_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 4, countinda4II_4); index of the amplitude of this stellar population in the val array
        inda4II_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 5, countinda4II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A4III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'III',countinda4III)
    IF countinda4III NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda4III_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 1, countinda4III_1); index of radius of this stellar population in the val array
        inda4III_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 2, countinda4III_2); index of temperature of this stellar population in the val array
        inda4III_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 3, countinda4III_3); index of distance of this stellar population in the val array
        inda4III_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 4, countinda4III_4); index of the amplitude of this stellar population in the val array
        inda4III_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 5, countinda4III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A4IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'IV',countinda4IV)
    IF countinda4IV NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda4IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 1, countinda4IV_1); index of radius of this stellar population in the val array
        inda4IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 2, countinda4IV_2); index of temperature of this stellar population in the val array
        inda4IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 3, countinda4IV_3); index of distance of this stellar population in the val array
        inda4IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 4, countinda4IV_4); index of the amplitude of this stellar population in the val array
        inda4IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 5, countinda4IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the A4V stellar population parameters (Dwrafs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'V',countinda4V)
    IF countinda4V NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda4V_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 1, countinda4V_1); index of radius of this stellar population in the val array
        inda4V_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 2, countinda4V_2); index of temperature of this stellar population in the val array
        inda4V_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 3, countinda4V_3); index of distance of this stellar population in the val array
        inda4V_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 4, countinda4V_4); index of the amplitude of this stellar population in the val array
        inda4V_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 5, countinda4V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the A4VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'VI',countinda4VI)
    IF countinda4VI NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda4VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 1, countinda4VI_1); index of radius of this stellar population in the val array
        inda4VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 2, countinda4VI_2); index of temperature of this stellar population in the val array
        inda4VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 3, countinda4VI_3); index of distance of this stellar population in the val array
        inda4VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 4, countinda4VI_4); index of the amplitude of this stellar population in the val array
        inda4VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 5, countinda4VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A4VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'VII',countinda4VII)
    IF countinda4VII NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda4VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 1, countinda4VII_1); index of radius of this stellar population in the val array
        inda4VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 2, countinda4VII_2); index of temperature of this stellar population in the val array
        inda4VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 3, countinda4VII_3); index of distance of this stellar population in the val array
        inda4VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 4, countinda4VII_4); index of the amplitude of this stellar population in the val array
        inda4VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 4 and params EQ 5, countinda4VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the A5 stellar population parameters===========
    ;===================================================================
    
    ; Locating the A5IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'IA+',countinda5IA+)
    IF countinda5IA+ NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda5IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 1, countinda5IA+_1); index of radius of this stellar population in the val array
        inda5IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 2, countinda5IA+_2); index of temperature of this stellar population in the val array
        inda5IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 3, countinda5IA+_3); index of distance of this stellar population in the val array
        inda5IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 4, countinda5IA+_4); index of the amplitude of this stellar population in the val array
        inda5IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 5, countinda5IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A5IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'IA',countinda5IA)
    IF countinda5IA NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda5IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 1, countinda5IA_1); index of radius of this stellar population in the val array
        inda5IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 2, countinda5IA_2); index of temperature of this stellar population in the val array
        inda5IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 3, countinda5IA_3); index of distance of this stellar population in the val array
        inda5IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 4, countinda5IA_4); index of the amplitude of this stellar population in the val array
        inda5IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 5, countinda5IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A5IAB stellar population parameters (intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'IAB',countinda5IAB)
    IF countinda5IAB NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda5IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 1, countinda5IAB_1); index of radius of this stellar population in the val array
        inda5IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 2, countinda5IAB_2); index of temperature of this stellar population in the val array
        inda5IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 3, countinda5IAB_3); index of distance of this stellar population in the val array
        inda5IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 4, countinda5IAB_4); index of the amplitude of this stellar population in the val array
        inda5IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 5, countinda5IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the A5IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'IB',countinda5IB)
    IF countinda5IB NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda5IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 1, countinda5IB_1); index of radius of this stellar population in the val array
        inda5IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 2, countinda5IB_2); index of temperature of this stellar population in the val array
        inda5IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 3, countinda5IB_3); index of distance of this stellar population in the val array
        inda5IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 4, countinda5IB_4); index of the amplitude of this stellar population in the val array
        inda5IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 5, countinda5IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A5II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'II',countinda5II)
    IF countinda5II NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda5II_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 1, countinda5II_1); index of radius of this stellar population in the val array
        inda5II_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 2, countinda5II_2); index of temperature of this stellar population in the val array
        inda5II_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 3, countinda5II_3); index of distance of this stellar population in the val array
        inda5II_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 4, countinda5II_4); index of the amplitude of this stellar population in the val array
        inda5II_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 5, countinda5II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the A5III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'III',countinda5III)
    IF countinda5III NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda5III_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 1, countinda5III_1); index of radius of this stellar population in the val array
        inda5III_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 2, countinda5III_2); index of temperature of this stellar population in the val array
        inda5III_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 3, countinda5III_3); index of distance of this stellar population in the val array
        inda5III_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 4, countinda5III_4); index of the amplitude of this stellar population in the val array
        inda5III_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 5, countinda5III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A5IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'IV',countinda5IV)
    IF countinda5IV NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda5IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 1, countinda5IV_1); index of radius of this stellar population in the val array
        inda5IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 2, countinda5IV_2); index of temperature of this stellar population in the val array
        inda5IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 3, countinda5IV_3); index of distance of this stellar population in the val array
        inda5IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 4, countinda5IV_4); index of the amplitude of this stellar population in the val array
        inda5IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 5, countinda5IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the A5V stellar population parameters (Dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'V',countinda5V)
    IF countinda5V NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda5V_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 1, countinda5V_1); index of radius of this stellar population in the val array
        inda5V_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 2, countinda5V_2); index of temperature of this stellar population in the val array
        inda5V_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 3, countinda5V_3); index of distance of this stellar population in the val array
        inda5V_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 4, countinda5V_4); index of the amplitude of this stellar population in the val array
        inda5V_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 5, countinda5V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A5VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'VI',countinda5VI)
    IF countinda5VI NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda5VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 1, countinda5VI_1); index of radius of this stellar population in the val array
        inda5VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 2, countinda5VI_2); index of temperature of this stellar population in the val array
        inda5VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 3, countinda5VI_3); index of distance of this stellar population in the val array
        inda5VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 4, countinda5VI_4); index of the amplitude of this stellar population in the val array
        inda5VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 5, countinda5VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A5VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'VII',countinda5VII)
    IF countinda5VII NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda5VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 1, countinda5VII_1); index of radius of this stellar population in the val array
        inda5VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 2, countinda5VII_2); index of temperature of this stellar population in the val array
        inda5VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 3, countinda5VII_3); index of distance of this stellar population in the val array
        inda5VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 4, countinda5VII_4); index of the amplitude of this stellar population in the val array
        inda5VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 5 and params EQ 5, countinda5VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the A6 stellar population parameters===========
    ;===================================================================
    
    ; Locating the A6IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'IA+',countinda6IA+)
    IF countinda6IA+ NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda6IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 1, countinda6IA+_1); index of radius of this stellar population in the val array
        inda6IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 2, countinda6IA+_2); index of temperature of this stellar population in the val array
        inda6IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 3, countinda6IA+_3); index of distance of this stellar population in the val array
        inda6IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 4, countinda6IA+_4); index of the amplitude of this stellar population in the val array
        inda6IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 5, countinda6IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A6IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'IA',countinda6IA)
    IF countinda6IA NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda6IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 1, countinda6IA_1); index of radius of this stellar population in the val array
        inda6IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 2, countinda6IA_2); index of temperature of this stellar population in the val array
        inda6IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 3, countinda6IA_3); index of distance of this stellar population in the val array
        inda6IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 4, countinda6IA_4); index of the amplitude of this stellar population in the val array
        inda6IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 5, countinda6IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A6IAB stellar population parameters (intermediate_size supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'IAB',countinda6IAB)
    IF countinda6IAB NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda6IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 1, countinda6IAB_1); index of radius of this stellar population in the val array
        inda6IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 2, countinda6IAB_2); index of temperature of this stellar population in the val array
        inda6IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 3, countinda6IAB_3); index of distance of this stellar population in the val array
        inda6IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 4, countinda6IAB_4); index of the amplitude of this stellar population in the val array
        inda6IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 5, countinda6IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A6IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'IB',countinda6IB)
    IF countinda6IB NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda6IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 1, countinda6IB_1); index of radius of this stellar population in the val array
        inda6IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 2, countinda6IB_2); index of temperature of this stellar population in the val array
        inda6IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 3, countinda6IB_3); index of distance of this stellar population in the val array
        inda6IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 4, countinda6IB_4); index of the amplitude of this stellar population in the val array
        inda6IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 5, countinda6IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the A6II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'II',countinda6II)
    IF countinda6II NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda6II_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 1, countinda6II_1); index of radius of this stellar population in the val array
        inda6II_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 2, countinda6II_2); index of temperature of this stellar population in the val array
        inda6II_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 3, countinda6II_3); index of distance of this stellar population in the val array
        inda6II_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 4, countinda6II_4); index of the amplitude of this stellar population in the val array
        inda6II_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 5, countinda6II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A6III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'III',countinda6III)
    IF countinda6III NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda6III_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 1, countinda6III_1); index of radius of this stellar population in the val array
        inda6III_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 2, countinda6III_2); index of temperature of this stellar population in the val array
        inda6III_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 3, countinda6III_3); index of distance of this stellar population in the val array
        inda6III_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 4, countinda6III_4); index of the amplitude of this stellar population in the val array
        inda6III_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 5, countinda6III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the A6IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'IV',countinda6IV)
    IF countinda6IV NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda6IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 1, countinda6IV_1); index of radius of this stellar population in the val array
        inda6IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 2, countinda6IV_2); index of temperature of this stellar population in the val array
        inda6IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 3, countinda6IV_3); index of distance of this stellar population in the val array
        inda6IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 4, countinda6IV_4); index of the amplitude of this stellar population in the val array
        inda6IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 5, countinda6IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the A6V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'V',countinda6V)
    IF countinda6V NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda6V_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 1, countinda6V_1); index of radius of this stellar population in the val array
        inda6V_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 2, countinda6V_2); index of temperature of this stellar population in the val array
        inda6V_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 3, countinda6V_3); index of distance of this stellar population in the val array
        inda6V_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 4, countinda6V_4); index of the amplitude of this stellar population in the val array
        inda6V_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 5, countinda6V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A6VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'VI',countinda6VI)
    IF countinda6VI NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda6VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 1, countinda6VI_1); index of radius of this stellar population in the val array
        inda6VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 2, countinda6VI_2); index of temperature of this stellar population in the val array
        inda6VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 3, countinda6VI_3); index of distance of this stellar population in the val array
        inda6VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 4, countinda6VI_4); index of the amplitude of this stellar population in the val array
        inda6VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 5, countinda6VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the A6VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'VII',countinda6VII)
    IF countinda6VII NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda6VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 1, countinda6VII_1); index of radius of this stellar population in the val array
        inda6VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 2, countinda6VII_2); index of temperature of this stellar population in the val array
        inda6VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 3, countinda6VII_3); index of distance of this stellar population in the val array
        inda6VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 4, countinda6VII_4); index of the amplitude of this stellar population in the val array
        inda6VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 6 and params EQ 5, countinda6VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the A7 stellar population parameters===========
    ;===================================================================
    
    ; Locating the A7IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'IA+',countinda7IA+)
    IF countinda7IA+ NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda7IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 1, countinda7IA+_1); index of radius of this stellar population in the val array
        inda7IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 2, countinda7IA+_2); index of temperature of this stellar population in the val array
        inda7IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 3, countinda7IA+_3); index of distance of this stellar population in the val array
        inda7IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 4, countinda7IA+_4); index of the amplitude of this stellar population in the val array
        inda7IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 5, countinda7IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the A7IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'IA',countinda7IA)
    IF countinda7IA NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda7IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 1, countinda7IA_1); index of radius of this stellar population in the val array
        inda7IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 2, countinda7IA_2); index of temperature of this stellar population in the val array
        inda7IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 3, countinda7IA_3); index of distance of this stellar population in the val array
        inda7IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 4, countinda7IA_4); index of the amplitude of this stellar population in the val array
        inda7IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 5, countinda7IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the A7IAB stellar population parameters (Intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'IAB',countinda7IAB)
    IF countinda7IAB NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda7IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 1, countinda7IAB_1); index of radius of this stellar population in the val array
        inda7IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 2, countinda7IAB_2); index of temperature of this stellar population in the val array
        inda7IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 3, countinda7IAB_3); index of distance of this stellar population in the val array
        inda7IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 4, countinda7IAB_4); index of the amplitude of this stellar population in the val array
        inda7IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 5, countinda7IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A7IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'IB',countinda7IB)
    IF countinda7IB NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda7IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 1, countinda7IB_1); index of radius of this stellar population in the val array
        inda7IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 2, countinda7IB_2); index of temperature of this stellar population in the val array
        inda7IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 3, countinda7IB_3); index of distance of this stellar population in the val array
        inda7IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 4, countinda7IB_4); index of the amplitude of this stellar population in the val array
        inda7IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 5, countinda7IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A7II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'II',countinda7II)
    IF countinda7II NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda7II_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 1, countinda7II_1); index of radius of this stellar population in the val array
        inda7II_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 2, countinda7II_2); index of temperature of this stellar population in the val array
        inda7II_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 3, countinda7II_3); index of distance of this stellar population in the val array
        inda7II_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 4, countinda7II_4); index of the amplitude of this stellar population in the val array
        inda7II_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 5, countinda7II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the A7III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'III',countinda7III)
    IF countinda7III NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda7III_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 1, countinda7III_1); index of radius of this stellar population in the val array
        inda7III_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 2, countinda7III_2); index of temperature of this stellar population in the val array
        inda7III_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 3, countinda7III_3); index of distance of this stellar population in the val array
        inda7III_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 4, countinda7III_4); index of the amplitude of this stellar population in the val array
        inda7III_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 5, countinda7III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A7IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'IV',countinda7IV)
    IF countinda7IV NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda7IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 1, countinda7IV_1); index of radius of this stellar population in the val array
        inda7IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 2, countinda7IV_2); index of temperature of this stellar population in the val array
        inda7IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 3, countinda7IV_3); index of distance of this stellar population in the val array
        inda7IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 4, countinda7IV_4); index of the amplitude of this stellar population in the val array
        inda7IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 5, countinda7IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A7V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'V',countinda7V)
    IF countinda7V NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda7V_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 1, countinda7V_1); index of radius of this stellar population in the val array
        inda7V_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 2, countinda7V_2); index of temperature of this stellar population in the val array
        inda7V_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 3, countinda7V_3); index of distance of this stellar population in the val array
        inda7V_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 4, countinda7V_4); index of the amplitude of this stellar population in the val array
        inda7V_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 5, countinda7V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A7VI stellar population parameters (Subwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'VI',countinda7VI)
    IF countinda7VI NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda7VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 1, countinda7VI_1); index of radius of this stellar population in the val array
        inda7VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 2, countinda7VI_2); index of temperature of this stellar population in the val array
        inda7VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 3, countinda7VI_3); index of distance of this stellar population in the val array
        inda7VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 4, countinda7VI_4); index of the amplitude of this stellar population in the val array
        inda7VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 5, countinda7VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the A7VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'VII',countinda7VII)
    IF countinda7VII NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda7VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 1, countinda7VII_1); index of radius of this stellar population in the val array
        inda7VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 2, countinda7VII_2); index of temperature of this stellar population in the val array
        inda7VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 3, countinda7VII_3); index of distance of this stellar population in the val array
        inda7VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 4, countinda7VII_4); index of the amplitude of this stellar population in the val array
        inda7VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 7 and params EQ 5, countinda7VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
     
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the A8 stellar population parameters===========
    ;===================================================================
    
    ; Locating the A8IA+ stellar population parameters (Hypergiants and extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'IA+',countinda8IA+)
    IF countinda8IA+ NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda8IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 1, countinda8IA+_1); index of radius of this stellar population in the val array
        inda8IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 2, countinda8IA+_2); index of temperature of this stellar population in the val array
        inda8IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 3, countinda8IA+_3); index of distance of this stellar population in the val array
        inda8IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 4, countinda8IA+_4); index of the amplitude of this stellar population in the val array
        inda8IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 5, countinda8IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A8IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'IA',countinda8IA)
    IF countinda8IA NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda8IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 1, countinda8IA_1); index of radius of this stellar population in the val array
        inda8IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 2, countinda8IA_2); index of temperature of this stellar population in the val array
        inda8IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 3, countinda8IA_3); index of distance of this stellar population in the val array
        inda8IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 4, countinda8IA_4); index of the amplitude of this stellar population in the val array
        inda8IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 5, countinda8IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the A8IAB stellar population parameters (Intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'IAB',countinda8IAB)
    IF countinda8IAB NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda8IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 1, countinda8IAB_1); index of radius of this stellar population in the val array
        inda8IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 2, countinda8IAB_2); index of temperature of this stellar population in the val array
        inda8IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 3, countinda8IAB_3); index of distance of this stellar population in the val array
        inda8IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 4, countinda8IAB_4); index of the amplitude of this stellar population in the val array
        inda8IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 5, countinda8IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    

    ; Locating the A8IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'IB',countinda8IB)
    IF countinda8IB NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda8IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 1, countinda8IB_1); index of radius of this stellar population in the val array
        inda8IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 2, countinda8IB_2); index of temperature of this stellar population in the val array
        inda8IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 3, countinda8IB_3); index of distance of this stellar population in the val array
        inda8IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 4, countinda8IB_4); index of the amplitude of this stellar population in the val array
        inda8IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 5, countinda8IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A8II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'II',countinda8II)
    IF countinda8II NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda8II_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 1, countinda8II_1); index of radius of this stellar population in the val array
        inda8II_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 2, countinda8II_2); index of temperature of this stellar population in the val array
        inda8II_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 3, countinda8II_3); index of distance of this stellar population in the val array
        inda8II_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 4, countinda8II_4); index of the amplitude of this stellar population in the val array
        inda8II_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 5, countinda8II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the A8III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'III',countinda8III)
    IF countinda8III NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda8III_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 1, countinda8III_1); index of radius of this stellar population in the val array
        inda8III_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 2, countinda8III_2); index of temperature of this stellar population in the val array
        inda8III_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 3, countinda8III_3); index of distance of this stellar population in the val array
        inda8III_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 4, countinda8III_4); index of the amplitude of this stellar population in the val array
        inda8III_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 5, countinda8III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A8IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'IV',countinda8IV)
    IF countinda8IV NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda8IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 1, countinda8IV_1); index of radius of this stellar population in the val array
        inda8IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 2, countinda8IV_2); index of temperature of this stellar population in the val array
        inda8IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 3, countinda8IV_3); index of distance of this stellar population in the val array
        inda8IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 4, countinda8IV_4); index of the amplitude of this stellar population in the val array
        inda8IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 5, countinda8IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A8V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'V',countinda8V)
    IF countinda8V NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda8V_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 1, countinda8V_1); index of radius of this stellar population in the val array
        inda8V_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 2, countinda8V_2); index of temperature of this stellar population in the val array
        inda8V_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 3, countinda8V_3); index of distance of this stellar population in the val array
        inda8V_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 4, countinda8V_4); index of the amplitude of this stellar population in the val array
        inda8V_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 5, countinda8V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A8VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'VI',countinda8VI)
    IF countinda8VI NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda8VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 1, countinda8VI_1); index of radius of this stellar population in the val array
        inda8VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 2, countinda8VI_2); index of temperature of this stellar population in the val array
        inda8VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 3, countinda8VI_3); index of distance of this stellar population in the val array
        inda8VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 4, countinda8VI_4); index of the amplitude of this stellar population in the val array
        inda8VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 5, countinda8VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A8VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'VII',countinda8VII)
    IF countinda8VII NE 0 THEN BEGIN
        popnumber+=1
        counta+=1
        inda8VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 1, countinda8VII_1); index of radius of this stellar population in the val array
        inda8VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 2, countinda8VII_2); index of temperature of this stellar population in the val array
        inda8VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 3, countinda8VII_3); index of distance of this stellar population in the val array
        inda8VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 4, countinda8VII_4); index of the amplitude of this stellar population in the val array
        inda8VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 8 and params EQ 5, countinda8VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the A9 stellar population parameters===========
    ;===================================================================
       
    ; Locating the A9IA+ stellar population parameters (hypergiants and extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'IA+',countinda9IA+)
    IF countinda9IA+ NE 0 THEN BEGIN
        popnumber+=1  
        counta+=1
        inda9IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 1, countinda9IA+_1); index of radius of this stellar population in the val array
        inda9IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 2, countinda9IA+_2); index of temperature of this stellar population in the val array
        inda9IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 3, countinda9IA+_3); index of distance of this stellar population in the val array
        inda9IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 4, countinda9IA+_4); index of the amplitude of this stellar population in the val array
        inda9IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 5, countinda9IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A9IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'IA',countinda9IA)
    IF countinda9IA NE 0 THEN BEGIN
        popnumber+=1  
        counta+=1
        inda9IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 1, countinda9IA_1); index of radius of this stellar population in the val array
        inda9IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 2, countinda9IA_2); index of temperature of this stellar population in the val array
        inda9IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 3, countinda9IA_3); index of distance of this stellar population in the val array
        inda9IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 4, countinda9IA_4); index of the amplitude of this stellar population in the val array
        inda9IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 5, countinda9IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A9IAB stellar population parameters (Intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'IAB',countinda9IAB)
    IF countinda9IAB NE 0 THEN BEGIN
        popnumber+=1  
        counta+=1
        inda9IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 1, countinda9IAB_1); index of radius of this stellar population in the val array
        inda9IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 2, countinda9IAB_2); index of temperature of this stellar population in the val array
        inda9IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 3, countinda9IAB_3); index of distance of this stellar population in the val array
        inda9IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 4, countinda9IAB_4); index of the amplitude of this stellar population in the val array
        inda9IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 5, countinda9IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A9IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'IB',countinda9IB)
    IF countinda9IB NE 0 THEN BEGIN
        popnumber+=1  
        counta+=1
        inda9IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 1, countinda9IB_1); index of radius of this stellar population in the val array
        inda9IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 2, countinda9IB_2); index of temperature of this stellar population in the val array
        inda9IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 3, countinda9IB_3); index of distance of this stellar population in the val array
        inda9IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 4, countinda9IB_4); index of the amplitude of this stellar population in the val array
        inda9IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 5, countinda9IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A9II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'II',countinda9II)
    IF countinda9II NE 0 THEN BEGIN
        popnumber+=1  
        counta+=1
        inda9II_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 1, countinda9II_1); index of radius of this stellar population in the val array
        inda9II_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 2, countinda9II_2); index of temperature of this stellar population in the val array
        inda9II_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 3, countinda9II_3); index of distance of this stellar population in the val array
        inda9II_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 4, countinda9II_4); index of the amplitude of this stellar population in the val array
        inda9II_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 5, countinda9II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A9III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'III',countinda9III)
    IF countinda9III NE 0 THEN BEGIN
        popnumber+=1  
        counta+=1
        inda9III_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 1, countinda9III_1); index of radius of this stellar population in the val array
        inda9III_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 2, countinda9III_2); index of temperature of this stellar population in the val array
        inda9III_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 3, countinda9III_3); index of distance of this stellar population in the val array
        inda9III_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 4, countinda9III_4); index of the amplitude of this stellar population in the val array
        inda9III_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 5, countinda9III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A9IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'IV',countinda9IV)
    IF countinda9IV NE 0 THEN BEGIN
        popnumber+=1  
        counta+=1
        inda9IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 1, countinda9IV_1); index of radius of this stellar population in the val array
        inda9IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 2, countinda9IV_2); index of temperature of this stellar population in the val array
        inda9IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 3, countinda9IV_3); index of distance of this stellar population in the val array
        inda9IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 4, countinda9IV_4); index of the amplitude of this stellar population in the val array
        inda9IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 5, countinda9IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A9V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'V',countinda9V)
    IF countinda9V NE 0 THEN BEGIN
        popnumber+=1  
        counta+=1
        inda9V_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 1, countinda9V_1); index of radius of this stellar population in the val array
        inda9V_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 2, countinda9V_2); index of temperature of this stellar population in the val array
        inda9V_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 3, countinda9V_3); index of distance of this stellar population in the val array
        inda9V_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 4, countinda9V_4); index of the amplitude of this stellar population in the val array
        inda9V_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 5, countinda9V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A9VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'VI',countinda9VI)
    IF countinda9VI NE 0 THEN BEGIN
        popnumber+=1  
        counta+=1
        inda9VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 1, countinda9VI_1); index of radius of this stellar population in the val array
        inda9VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 2, countinda9VI_2); index of temperature of this stellar population in the val array
        inda9VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 3, countinda9VI_3); index of distance of this stellar population in the val array
        inda9VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 4, countinda9VI_4); index of the amplitude of this stellar population in the val array
        inda9VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 5, countinda9VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the A9VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'VII',countinda9VII)
    IF countinda9VII NE 0 THEN BEGIN
        popnumber+=1  
        counta+=1
        inda9VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 1, countinda9VII_1); index of radius of this stellar population in the val array
        inda9VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 2, countinda9VII_2); index of temperature of this stellar population in the val array
        inda9VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 3, countinda9VII_3); index of distance of this stellar population in the val array
        inda9VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 4, countinda9VII_4); index of the amplitude of this stellar population in the val array
        inda9VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'A' and strmid(key,1,1) EQ 9 and params EQ 5, countinda9VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
   
    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the F0 stellar population parameters===========
    ;===================================================================
     
    ; Locating the F0IA+ stellar population parameters (Hypergiantes or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'IA+',countindf0IA+)
    IF countindf0IA+ NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf0IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 1, countindf0IA+_1); index of radius of this stellar population in the val array
        indf0IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 2, countindf0IA+_2); index of temperature of this stellar population in the val array
        indf0IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 3, countindf0IA+_3); index of distance of this stellar population in the val array
        indf0IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 4, countindf0IA+_4); index of the amplitude of this stellar population in the val array
        indf0IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 5, countindf0IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F0IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'IA',countindf0IA)
    IF countindf0IA NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf0IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 1, countindf0IA_1); index of radius of this stellar population in the val array
        indf0IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 2, countindf0IA_2); index of temperature of this stellar population in the val array
        indf0IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 3, countindf0IA_3); index of distance of this stellar population in the val array
        indf0IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 4, countindf0IA_4); index of the amplitude of this stellar population in the val array
        indf0IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 5, countindf0IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F0IAB stellar population parameters (intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'IAB',countindf0IAB)
    IF countindf0IAB NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf0IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 1, countindf0IAB_1); index of radius of this stellar population in the val array
        indf0IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 2, countindf0IAB_2); index of temperature of this stellar population in the val array
        indf0IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 3, countindf0IAB_3); index of distance of this stellar population in the val array
        indf0IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 4, countindf0IAB_4); index of the amplitude of this stellar population in the val array
        indf0IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 5, countindf0IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F0IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'IB',countindf0IB)
    IF countindf0IB NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf0IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 1, countindf0IB_1); index of radius of this stellar population in the val array
        indf0IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 2, countindf0IB_2); index of temperature of this stellar population in the val array
        indf0IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 3, countindf0IB_3); index of distance of this stellar population in the val array
        indf0IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 4, countindf0IB_4); index of the amplitude of this stellar population in the val array
        indf0IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 5, countindf0IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F0II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'II',countindf0II)
    IF countindf0II NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf0II_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 1, countindf0II_1); index of radius of this stellar population in the val array
        indf0II_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 2, countindf0II_2); index of temperature of this stellar population in the val array
        indf0II_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 3, countindf0II_3); index of distance of this stellar population in the val array
        indf0II_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 4, countindf0II_4); index of the amplitude of this stellar population in the val array
        indf0II_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 5, countindf0II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F0III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'III',countindf0III)
    IF countindf0III NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf0III_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 1, countindf0III_1); index of radius of this stellar population in the val array
        indf0III_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 2, countindf0III_2); index of temperature of this stellar population in the val array
        indf0III_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 3, countindf0III_3); index of distance of this stellar population in the val array
        indf0III_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 4, countindf0III_4); index of the amplitude of this stellar population in the val array
        indf0III_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 5, countindf0III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the F0IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'IV',countindf0IV)
    IF countindf0IV NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf0IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 1, countindf0IV_1); index of radius of this stellar population in the val array
        indf0IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 2, countindf0IV_2); index of temperature of this stellar population in the val array
        indf0IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 3, countindf0IV_3); index of distance of this stellar population in the val array
        indf0IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 4, countindf0IV_4); index of the amplitude of this stellar population in the val array
        indf0IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 5, countindf0IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F0V stellar population parameters (Dwrafs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'V',countindf0V)
    IF countindf0V NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf0V_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 1, countindf0V_1); index of radius of this stellar population in the val array
        indf0V_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 2, countindf0V_2); index of temperature of this stellar population in the val array
        indf0V_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 3, countindf0V_3); index of distance of this stellar population in the val array
        indf0V_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 4, countindf0V_4); index of the amplitude of this stellar population in the val array
        indf0V_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 5, countindf0V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F0VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'VI',countindf0VI)
    IF countindf0VI NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf0VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 1, countindf0VI_1); index of radius of this stellar population in the val array
        indf0VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 2, countindf0VI_2); index of temperature of this stellar population in the val array
        indf0VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 3, countindf0VI_3); index of distance of this stellar population in the val array
        indf0VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 4, countindf0VI_4); index of the amplitude of this stellar population in the val array
        indf0VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 5, countindf0VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F0VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'VII',countindf0VII)
    IF countindf0VII NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf0VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 1, countindf0VII_1); index of radius of this stellar population in the val array
        indf0VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 2, countindf0VII_2); index of temperature of this stellar population in the val array
        indf0VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 3, countindf0VII_3); index of distance of this stellar population in the val array
        indf0VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 4, countindf0VII_4); index of the amplitude of this stellar population in the val array
        indf0VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 0 and params EQ 5, countindf0VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the F1 stellar population parameters===========
    ;===================================================================
    
    ; Locating the F1IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'IA+',countindf1IA+)
    IF countindf1IA+ NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf1IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 1, countindf1IA+_1); index of radius of this stellar population in the val array
        indf1IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 2, countindf1IA+_2); index of temperature of this stellar population in the val array
        indf1IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 3, countindf1IA+_3); index of distance of this stellar population in the val array
        indf1IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 4, countindf1IA+_4); index of the amplitude of this stellar population in the val array
        indf1IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 5, countindf1IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F1IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'IA',countindf1IA)
    IF countindf1IA NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf1IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 1, countindf1IA_1); index of radius of this stellar population in the val array
        indf1IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 2, countindf1IA_2); index of temperature of this stellar population in the val array
        indf1IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 3, countindf1IA_3); index of distance of this stellar population in the val array
        indf1IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 4, countindf1IA_4); index of the amplitude of this stellar population in the val array
        indf1IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 5, countindf1IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F1IAB stellar population parameters (intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'IAB',countindf1IAB)
    IF countindf1IAB NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf1IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 1, countindf1IAB_1); index of radius of this stellar population in the val array
        indf1IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 2, countindf1IAB_2); index of temperature of this stellar population in the val array
        indf1IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 3, countindf1IAB_3); index of distance of this stellar population in the val array
        indf1IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 4, countindf1IAB_4); index of the amplitude of this stellar population in the val array
        indf1IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 5, countindf1IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F1IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'IB',countindf1IB)
    IF countindf1IB NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf1IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 1, countindf1IB_1); index of radius of this stellar population in the val array
        indf1IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 2, countindf1IB_2); index of temperature of this stellar population in the val array
        indf1IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 3, countindf1IB_3); index of distance of this stellar population in the val array
        indf1IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 4, countindf1IB_4); index of the amplitude of this stellar population in the val array
        indf1IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 5, countindf1IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F1II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'II',countindf1II)
    IF countindf1II NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf1II_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 1, countindf1II_1); index of radius of this stellar population in the val array
        indf1II_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 2, countindf1II_2); index of temperature of this stellar population in the val array
        indf1II_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 3, countindf1II_3); index of distance of this stellar population in the val array
        indf1II_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 4, countindf1II_4); index of the amplitude of this stellar population in the val array
        indf1II_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 5, countindf1II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F1III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'III',countindf1III)
    IF countindf1III NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf1III_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 1, countindf1III_1); index of radius of this stellar population in the val array
        indf1III_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 2, countindf1III_2); index of temperature of this stellar population in the val array
        indf1III_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 3, countindf1III_3); index of distance of this stellar population in the val array
        indf1III_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 4, countindf1III_4); index of the amplitude of this stellar population in the val array
        indf1III_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 5, countindf1III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F1IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'IV',countindf1IV)
    IF countindf1IV NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf1IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 1, countindf1IV_1); index of radius of this stellar population in the val array
        indf1IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 2, countindf1IV_2); index of temperature of this stellar population in the val array
        indf1IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 3, countindf1IV_3); index of distance of this stellar population in the val array
        indf1IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 4, countindf1IV_4); index of the amplitude of this stellar population in the val array
        indf1IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 5, countindf1IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F1V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'V',countindf1V)
    IF countindf1V NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf1V_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 1, countindf1V_1); index of radius of this stellar population in the val array
        indf1V_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 2, countindf1V_2); index of temperature of this stellar population in the val array
        indf1V_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 3, countindf1V_3); index of distance of this stellar population in the val array
        indf1V_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 4, countindf1V_4); index of the amplitude of this stellar population in the val array
        indf1V_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 5, countindf1V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F1VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'VI',countindf1VI)
    IF countindf1VI NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf1VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 1, countindf1VI_1); index of radius of this stellar population in the val array
        indf1VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 2, countindf1VI_2); index of temperature of this stellar population in the val array
        indf1VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 3, countindf1VI_3); index of distance of this stellar population in the val array
        indf1VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 4, countindf1VI_4); index of the amplitude of this stellar population in the val array
        indf1VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 5, countindf1VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F1VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'VII',countindf1VII)
    IF countindf1VII NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf1VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 1, countindf1VII_1); index of radius of this stellar population in the val array
        indf1VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 2, countindf1VII_2); index of temperature of this stellar population in the val array
        indf1VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 3, countindf1VII_3); index of distance of this stellar population in the val array
        indf1VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 4, countindf1VII_4); index of the amplitude of this stellar population in the val array
        indf1VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 1 and params EQ 5, countindf1VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the F2 stellar population parameters===========
    ;===================================================================
    
    ; Locating the F2IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'IA+',countindf2IA+)
    IF countindf2IA+ NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf2IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 1, countindf2IA+_1); index of radius of this stellar population in the val array
        indf2IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 2, countindf2IA+_2); index of temperature of this stellar population in the val array
        indf2IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 3, countindf2IA+_3); index of distance of this stellar population in the val array
        indf2IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 4, countindf2IA+_4); index of the amplitude of this stellar population in the val array
        indf2IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 5, countindf2IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F2IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'IA',countindf2IA)
    IF countindf2IA NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf2IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 1, countindf2IA_1); index of radius of this stellar population in the val array
        indf2IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 2, countindf2IA_2); index of temperature of this stellar population in the val array
        indf2IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 3, countindf2IA_3); index of distance of this stellar population in the val array
        indf2IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 4, countindf2IA_4); index of the amplitude of this stellar population in the val array
        indf2IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 5, countindf2IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F2IAB stellar population parameters (Intermediate_size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'IAB',countindf2IAB)
    IF countindf2IAB NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf2IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 1, countindf2IAB_1); index of radius of this stellar population in the val array
        indf2IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 2, countindf2IAB_2); index of temperature of this stellar population in the val array
        indf2IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 3, countindf2IAB_3); index of distance of this stellar population in the val array
        indf2IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 4, countindf2IAB_4); index of the amplitude of this stellar population in the val array
        indf2IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 5, countindf2IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F2IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'IB',countindf2IB)
    IF countindf2IB NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf2IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 1, countindf2IB_1); index of radius of this stellar population in the val array
        indf2IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 2, countindf2IB_2); index of temperature of this stellar population in the val array
        indf2IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 3, countindf2IB_3); index of distance of this stellar population in the val array
        indf2IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 4, countindf2IB_4); index of the amplitude of this stellar population in the val array
        indf2IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 5, countindf2IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F2II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'II',countindf2II)
    IF countindf2II NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf2II_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 1, countindf2II_1); index of radius of this stellar population in the val array
        indf2II_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 2, countindf2II_2); index of temperature of this stellar population in the val array
        indf2II_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 3, countindf2II_3); index of distance of this stellar population in the val array
        indf2II_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 4, countindf2II_4); index of the amplitude of this stellar population in the val array
        indf2II_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 5, countindf2II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the F2III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'III',countindf2III)
    IF countindf2III NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf2III_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 1, countindf2III_1); index of radius of this stellar population in the val array
        indf2III_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 2, countindf2III_2); index of temperature of this stellar population in the val array
        indf2III_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 3, countindf2III_3); index of distance of this stellar population in the val array
        indf2III_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 4, countindf2III_4); index of the amplitude of this stellar population in the val array
        indf2III_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 5, countindf2III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F2IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'IV',countindf2IV)
    IF countindf2IV NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf2IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 1, countindf2IV_1); index of radius of this stellar population in the val array
        indf2IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 2, countindf2IV_2); index of temperature of this stellar population in the val array
        indf2IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 3, countindf2IV_3); index of distance of this stellar population in the val array
        indf2IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 4, countindf2IV_4); index of the amplitude of this stellar population in the val array
        indf2IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 5, countindf2IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F2V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'V',countindf2V)
    IF countindf2V NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf2V_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 1, countindf2V_1); index of radius of this stellar population in the val array
        indf2V_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 2, countindf2V_2); index of temperature of this stellar population in the val array
        indf2V_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 3, countindf2V_3); index of distance of this stellar population in the val array
        indf2V_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 4, countindf2V_4); index of the amplitude of this stellar population in the val array
        indf2V_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 5, countindf2V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the F2VI stellar population parameters (Subwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'VI',countindf2VI)
    IF countindf2VI NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf2VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 1, countindf2VI_1); index of radius of this stellar population in the val array
        indf2VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 2, countindf2VI_2); index of temperature of this stellar population in the val array
        indf2VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 3, countindf2VI_3); index of distance of this stellar population in the val array
        indf2VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 4, countindf2VI_4); index of the amplitude of this stellar population in the val array
        indf2VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 5, countindf2VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the F2VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'VII',countindf2VII)
    IF countindf2VII NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf2VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 1, countindf2VII_1); index of radius of this stellar population in the val array
        indf2VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 2, countindf2VII_2); index of temperature of this stellar population in the val array
        indf2VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 3, countindf2VII_3); index of distance of this stellar population in the val array
        indf2VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 4, countindf2VII_4); index of the amplitude of this stellar population in the val array
        indf2VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 2 and params EQ 5, countindf2VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the F3 stellar population parameters===========
    ;===================================================================
    
    ; Locating the F3IA+ stellar population parameters (Hypergiants or extremely luminious supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'IA+',countindf3IA+)
    IF countindf3IA+ NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf3IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 1, countindf3IA+_1); index of radius of this stellar population in the val array
        indf3IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 2, countindf3IA+_2); index of temperature of this stellar population in the val array
        indf3IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 3, countindf3IA+_3); index of distance of this stellar population in the val array
        indf3IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 4, countindf3IA+_4); index of the amplitude of this stellar population in the val array
        indf3IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 5, countindf3IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the F3IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'IA',countindf3IA)
    IF countindf3IA NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf3IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 1, countindf3IA_1); index of radius of this stellar population in the val array
        indf3IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 2, countindf3IA_2); index of temperature of this stellar population in the val array
        indf3IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 3, countindf3IA_3); index of distance of this stellar population in the val array
        indf3IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 4, countindf3IA_4); index of the amplitude of this stellar population in the val array
        indf3IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 5, countindf3IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    
    ; Locating the F3IAB stellar population parameters (Intermediate-size luminous supergiants) 
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'IAB',countindf3IAB)
    IF countindf3IAB NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf3IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 1, countindf3IAB_1); index of radius of this stellar population in the val array
        indf3IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 2, countindf3IAB_2); index of temperature of this stellar population in the val array
        indf3IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 3, countindf3IAB_3); index of distance of this stellar population in the val array
        indf3IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 4, countindf3IAB_4); index of the amplitude of this stellar population in the val array
        indf3IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 5, countindf3IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the F3IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'IB',countindf3IB)
    IF countindf3IB NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf3IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 1, countindf3IB_1); index of radius of this stellar population in the val array
        indf3IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 2, countindf3IB_2); index of temperature of this stellar population in the val array
        indf3IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 3, countindf3IB_3); index of distance of this stellar population in the val array
        indf3IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 4, countindf3IB_4); index of the amplitude of this stellar population in the val array
        indf3IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 5, countindf3IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F3II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'II',countindf3II)
    IF countindf3II NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf3II_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 1, countindf3II_1); index of radius of this stellar population in the val array
        indf3II_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 2, countindf3II_2); index of temperature of this stellar population in the val array
        indf3II_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 3, countindf3II_3); index of distance of this stellar population in the val array
        indf3II_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 4, countindf3II_4); index of the amplitude of this stellar population in the val array
        indf3II_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 5, countindf3II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F3III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'III',countindf3III)
    IF countindf3III NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf3III_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 1, countindf3III_1); index of radius of this stellar population in the val array
        indf3III_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 2, countindf3III_2); index of temperature of this stellar population in the val array
        indf3III_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 3, countindf3III_3); index of distance of this stellar population in the val array
        indf3III_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 4, countindf3III_4); index of the amplitude of this stellar population in the val array
        indf3III_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 5, countindf3III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F3IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'IV',countindf3IV)
    IF countindf3IV NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf3IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 1, countindf3IV_1); index of radius of this stellar population in the val array
        indf3IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 2, countindf3IV_2); index of temperature of this stellar population in the val array
        indf3IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 3, countindf3IV_3); index of distance of this stellar population in the val array
        indf3IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 4, countindf3IV_4); index of the amplitude of this stellar population in the val array
        indf3IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 5, countindf3IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F3V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'V',countindf3V)
    IF countindf3V NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf3V_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 1, countindf3V_1); index of radius of this stellar population in the val array
        indf3V_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 2, countindf3V_2); index of temperature of this stellar population in the val array
        indf3V_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 3, countindf3V_3); index of distance of this stellar population in the val array
        indf3V_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 4, countindf3V_4); index of the amplitude of this stellar population in the val array
        indf3V_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 5, countindf3V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F3VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'VI',countindf3VI)
    IF countindf3VI NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf3VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 1, countindf3VI_1); index of radius of this stellar population in the val array
        indf3VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 2, countindf3VI_2); index of temperature of this stellar population in the val array
        indf3VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 3, countindf3VI_3); index of distance of this stellar population in the val array
        indf3VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 4, countindf3VI_4); index of the amplitude of this stellar population in the val array
        indf3VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 5, countindf3VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F3VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'VII',countindf3VII)
    IF countindf3VII NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf3VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 1, countindf3VII_1); index of radius of this stellar population in the val array
        indf3VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 2, countindf3VII_2); index of temperature of this stellar population in the val array
        indf3VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 3, countindf3VII_3); index of distance of this stellar population in the val array
        indf3VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 4, countindf3VII_4); index of the amplitude of this stellar population in the val array
        indf3VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 3 and params EQ 5, countindf3VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the F4 stellar population parameters===========
    ;===================================================================
    
    ; Locating the F4IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'IA+',countindf4IA+)
    IF countindf4IA+ NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf4IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 1, countindf4IA+_1); index of radius of this stellar population in the val array
        indf4IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 2, countindf4IA+_2); index of temperature of this stellar population in the val array
        indf4IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 3, countindf4IA+_3); index of distance of this stellar population in the val array
        indf4IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 4, countindf4IA+_4); index of the amplitude of this stellar population in the val array
        indf4IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 5, countindf4IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F4IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'IA',countindf4IA)
    IF countindf4IA NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf4IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 1, countindf4IA_1); index of radius of this stellar population in the val array
        indf4IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 2, countindf4IA_2); index of temperature of this stellar population in the val array
        indf4IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 3, countindf4IA_3); index of distance of this stellar population in the val array
        indf4IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 4, countindf4IA_4); index of the amplitude of this stellar population in the val array
        indf4IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 5, countindf4IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F4IAB stellar population parameters (Intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'IAB',countindf4IAB)
    IF countindf4IAB NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf4IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 1, countindf4IAB_1); index of radius of this stellar population in the val array
        indf4IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 2, countindf4IAB_2); index of temperature of this stellar population in the val array
        indf4IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 3, countindf4IAB_3); index of distance of this stellar population in the val array
        indf4IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 4, countindf4IAB_4); index of the amplitude of this stellar population in the val array
        indf4IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 5, countindf4IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the F4IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'IB',countindf4IB)
    IF countindf4IB NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf4IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 1, countindf4IB_1); index of radius of this stellar population in the val array
        indf4IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 2, countindf4IB_2); index of temperature of this stellar population in the val array
        indf4IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 3, countindf4IB_3); index of distance of this stellar population in the val array
        indf4IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 4, countindf4IB_4); index of the amplitude of this stellar population in the val array
        indf4IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 5, countindf4IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the F4II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'II',countindf4II)
    IF countindf4II NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf4II_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 1, countindf4II_1); index of radius of this stellar population in the val array
        indf4II_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 2, countindf4II_2); index of temperature of this stellar population in the val array
        indf4II_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 3, countindf4II_3); index of distance of this stellar population in the val array
        indf4II_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 4, countindf4II_4); index of the amplitude of this stellar population in the val array
        indf4II_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 5, countindf4II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the F4III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'III',countindf4III)
    IF countindf4III NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf4III_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 1, countindf4III_1); index of radius of this stellar population in the val array
        indf4III_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 2, countindf4III_2); index of temperature of this stellar population in the val array
        indf4III_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 3, countindf4III_3); index of distance of this stellar population in the val array
        indf4III_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 4, countindf4III_4); index of the amplitude of this stellar population in the val array
        indf4III_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 5, countindf4III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F4IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'IV',countindf4IV)
    IF countindf4IV NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf4IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 1, countindf4IV_1); index of radius of this stellar population in the val array
        indf4IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 2, countindf4IV_2); index of temperature of this stellar population in the val array
        indf4IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 3, countindf4IV_3); index of distance of this stellar population in the val array
        indf4IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 4, countindf4IV_4); index of the amplitude of this stellar population in the val array
        indf4IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 5, countindf4IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F4V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'V',countindf4V)
    IF countindf4V NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf4V_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 1, countindf4V_1); index of radius of this stellar population in the val array
        indf4V_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 2, countindf4V_2); index of temperature of this stellar population in the val array
        indf4V_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 3, countindf4V_3); index of distance of this stellar population in the val array
        indf4V_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 4, countindf4V_4); index of the amplitude of this stellar population in the val array
        indf4V_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 5, countindf4V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F4VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'VI',countindf4VI)
    IF countindf4VI NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf4VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 1, countindf4VI_1); index of radius of this stellar population in the val array
        indf4VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 2, countindf4VI_2); index of temperature of this stellar population in the val array
        indf4VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 3, countindf4VI_3); index of distance of this stellar population in the val array
        indf4VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 4, countindf4VI_4); index of the amplitude of this stellar population in the val array
        indf4VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 5, countindf4VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F4VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'VII',countindf4VII)
    IF countindf4VII NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf4VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 1, countindf4VII_1); index of radius of this stellar population in the val array
        indf4VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 2, countindf4VII_2); index of temperature of this stellar population in the val array
        indf4VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 3, countindf4VII_3); index of distance of this stellar population in the val array
        indf4VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 4, countindf4VII_4); index of the amplitude of this stellar population in the val array
        indf4VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 4 and params EQ 5, countindf4VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the F5 stellar population parameters===========
    ;===================================================================
    
    ; Locating the F5IA+ stellar population parameters (Hypergiants or extremely lumious supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'IA+',countindf5IA+)
    IF countindf5IA+ NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf5IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 1, countindf5IA+_1); index of radius of this stellar population in the val array
        indf5IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 2, countindf5IA+_2); index of temperature of this stellar population in the val array
        indf5IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 3, countindf5IA+_3); index of distance of this stellar population in the val array
        indf5IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 4, countindf5IA+_4); index of the amplitude of this stellar population in the val array
        indf5IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 5, countindf5IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F5IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'IA',countindf5IA)
    IF countindf5IA NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf5IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 1, countindf5IA_1); index of radius of this stellar population in the val array
        indf5IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 2, countindf5IA_2); index of temperature of this stellar population in the val array
        indf5IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 3, countindf5IA_3); index of distance of this stellar population in the val array
        indf5IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 4, countindf5IA_4); index of the amplitude of this stellar population in the val array
        indf5IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 5, countindf5IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F5IAB stellar population parameters (Intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'IAB',countindf5IAB)
    IF countindf5IAB NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf5IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 1, countindf5IAB_1); index of radius of this stellar population in the val array
        indf5IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 2, countindf5IAB_2); index of temperature of this stellar population in the val array
        indf5IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 3, countindf5IAB_3); index of distance of this stellar population in the val array
        indf5IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 4, countindf5IAB_4); index of the amplitude of this stellar population in the val array
        indf5IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 5, countindf5IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F5IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'IB',countindf5IB)
    IF countindf5IB NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf5IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 1, countindf5IB_1); index of radius of this stellar population in the val array
        indf5IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 2, countindf5IB_2); index of temperature of this stellar population in the val array
        indf5IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 3, countindf5IB_3); index of distance of this stellar population in the val array
        indf5IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 4, countindf5IB_4); index of the amplitude of this stellar population in the val array
        indf5IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 5, countindf5IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F5II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'II',countindf5II)
    IF countindf5II NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf5II_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 1, countindf5II_1); index of radius of this stellar population in the val array
        indf5II_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 2, countindf5II_2); index of temperature of this stellar population in the val array
        indf5II_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 3, countindf5II_3); index of distance of this stellar population in the val array
        indf5II_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 4, countindf5II_4); index of the amplitude of this stellar population in the val array
        indf5II_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 5, countindf5II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F5III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'III',countindf5III)
    IF countindf5III NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf5III_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 1, countindf5III_1); index of radius of this stellar population in the val array
        indf5III_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 2, countindf5III_2); index of temperature of this stellar population in the val array
        indf5III_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 3, countindf5III_3); index of distance of this stellar population in the val array
        indf5III_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 4, countindf5III_4); index of the amplitude of this stellar population in the val array
        indf5III_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 5, countindf5III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F5IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'IV',countindf5IV)
    IF countindf5IV NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf5IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 1, countindf5IV_1); index of radius of this stellar population in the val array
        indf5IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 2, countindf5IV_2); index of temperature of this stellar population in the val array
        indf5IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 3, countindf5IV_3); index of distance of this stellar population in the val array
        indf5IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 4, countindf5IV_4); index of the amplitude of this stellar population in the val array
        indf5IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 5, countindf5IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F5V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'V',countindf5V)
    IF countindf5V NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf5V_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 1, countindf5V_1); index of radius of this stellar population in the val array
        indf5V_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 2, countindf5V_2); index of temperature of this stellar population in the val array
        indf5V_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 3, countindf5V_3); index of distance of this stellar population in the val array
        indf5V_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 4, countindf5V_4); index of the amplitude of this stellar population in the val array
        indf5V_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 5, countindf5V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F5VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'VI',countindf5VI)
    IF countindf5VI NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf5VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 1, countindf5VI_1); index of radius of this stellar population in the val array
        indf5VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 2, countindf5VI_2); index of temperature of this stellar population in the val array
        indf5VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 3, countindf5VI_3); index of distance of this stellar population in the val array
        indf5VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 4, countindf5VI_4); index of the amplitude of this stellar population in the val array
        indf5VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 5, countindf5VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F5VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'VII',countindf5VII)
    IF countindf5VII NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf5VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 1, countindf5VII_1); index of radius of this stellar population in the val array
        indf5VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 2, countindf5VII_2); index of temperature of this stellar population in the val array
        indf5VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 3, countindf5VII_3); index of distance of this stellar population in the val array
        indf5VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 4, countindf5VII_4); index of the amplitude of this stellar population in the val array
        indf5VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 5 and params EQ 5, countindf5VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the F6 stellar population parameters===========
    ;===================================================================
    
    ; Locating the F6IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'IA+',countindf6IA+)
    IF countindf6IA+ NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf6IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 1, countindf6IA+_1); index of radius of this stellar population in the val array
        indf6IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 2, countindf6IA+_2); index of temperature of this stellar population in the val array
        indf6IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 3, countindf6IA+_3); index of distance of this stellar population in the val array
        indf6IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 4, countindf6IA+_4); index of the amplitude of this stellar population in the val array
        indf6IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 5, countindf6IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F6IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'IA',countindf6IA)
    IF countindf6IA NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf6IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 1, countindf6IA_1); index of radius of this stellar population in the val array
        indf6IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 2, countindf6IA_2); index of temperature of this stellar population in the val array
        indf6IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 3, countindf6IA_3); index of distance of this stellar population in the val array
        indf6IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 4, countindf6IA_4); index of the amplitude of this stellar population in the val array
        indf6IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 5, countindf6IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F6IAB stellar population parameters (Intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'IAB',countindf6IAB)
    IF countindf6IAB NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf6IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 1, countindf6IAB_1); index of radius of this stellar population in the val array
        indf6IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 2, countindf6IAB_2); index of temperature of this stellar population in the val array
        indf6IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 3, countindf6IAB_3); index of distance of this stellar population in the val array
        indf6IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 4, countindf6IAB_4); index of the amplitude of this stellar population in the val array
        indf6IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 5, countindf6IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F6IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'IB',countindf6IB)
    IF countindf6IB NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf6IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 1, countindf6IB_1); index of radius of this stellar population in the val array
        indf6IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 2, countindf6IB_2); index of temperature of this stellar population in the val array
        indf6IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 3, countindf6IB_3); index of distance of this stellar population in the val array
        indf6IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 4, countindf6IB_4); index of the amplitude of this stellar population in the val array
        indf6IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 5, countindf6IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F6II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'II',countindf6II)
    IF countindf6II NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf6II_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 1, countindf6II_1); index of radius of this stellar population in the val array
        indf6II_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 2, countindf6II_2); index of temperature of this stellar population in the val array
        indf6II_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 3, countindf6II_3); index of distance of this stellar population in the val array
        indf6II_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 4, countindf6II_4); index of the amplitude of this stellar population in the val array
        indf6II_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 5, countindf6II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F6III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'III',countindf6III)
    IF countindf6III NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf6III_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 1, countindf6III_1); index of radius of this stellar population in the val array
        indf6III_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 2, countindf6III_2); index of temperature of this stellar population in the val array
        indf6III_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 3, countindf6III_3); index of distance of this stellar population in the val array
        indf6III_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 4, countindf6III_4); index of the amplitude of this stellar population in the val array
        indf6III_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 5, countindf6III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F6IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'IV',countindf6IV)
    IF countindf6IV NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf6IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 1, countindf6IV_1); index of radius of this stellar population in the val array
        indf6IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 2, countindf6IV_2); index of temperature of this stellar population in the val array
        indf6IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 3, countindf6IV_3); index of distance of this stellar population in the val array
        indf6IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 4, countindf6IV_4); index of the amplitude of this stellar population in the val array
        indf6IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 5, countindf6IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F6V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'V',countindf6V)
    IF countindf6V NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf6V_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 1, countindf6V_1); index of radius of this stellar population in the val array
        indf6V_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 2, countindf6V_2); index of temperature of this stellar population in the val array
        indf6V_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 3, countindf6V_3); index of distance of this stellar population in the val array
        indf6V_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 4, countindf6V_4); index of the amplitude of this stellar population in the val array
        indf6V_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 5, countindf6V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the F6VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'VI',countindf6VI)
    IF countindf6VI NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf6VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 1, countindf6VI_1); index of radius of this stellar population in the val array
        indf6VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 2, countindf6VI_2); index of temperature of this stellar population in the val array
        indf6VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 3, countindf6VI_3); index of distance of this stellar population in the val array
        indf6VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 4, countindf6VI_4); index of the amplitude of this stellar population in the val array
        indf6VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 5, countindf6VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the F6VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'VII',countindf6VII)
    IF countindf6VII NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf6VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 1, countindf6VII_1); index of radius of this stellar population in the val array
        indf6VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 2, countindf6VII_2); index of temperature of this stellar population in the val array
        indf6VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 3, countindf6VII_3); index of distance of this stellar population in the val array
        indf6VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 4, countindf6VII_4); index of the amplitude of this stellar population in the val array
        indf6VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 6 and params EQ 5, countindf6VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the F7 stellar population parameters===========
    ;===================================================================
    
    ; Locating the F7IA+ stellar population parameters (hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'IA+',countindf7IA+)
    IF countindf7IA+ NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf7IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 1, countindf7IA+_1); index of radius of this stellar population in the val array
        indf7IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 2, countindf7IA+_2); index of temperature of this stellar population in the val array
        indf7IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 3, countindf7IA+_3); index of distance of this stellar population in the val array
        indf7IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 4, countindf7IA+_4); index of the amplitude of this stellar population in the val array
        indf7IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 5, countindf7IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F7IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'IA',countindf7IA)
    IF countindf7IA NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf7IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 1, countindf7IA_1); index of radius of this stellar population in the val array
        indf7IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 2, countindf7IA_2); index of temperature of this stellar population in the val array
        indf7IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 3, countindf7IA_3); index of distance of this stellar population in the val array
        indf7IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 4, countindf7IA_4); index of the amplitude of this stellar population in the val array
        indf7IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 5, countindf7IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F7IAB stellar population parameters (intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'IAB',countindf7IAB)
    IF countindf7IAB NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf7IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 1, countindf7IAB_1); index of radius of this stellar population in the val array
        indf7IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 2, countindf7IAB_2); index of temperature of this stellar population in the val array
        indf7IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 3, countindf7IAB_3); index of distance of this stellar population in the val array
        indf7IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 4, countindf7IAB_4); index of the amplitude of this stellar population in the val array
        indf7IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 5, countindf7IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F7IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'IB',countindf7IB)
    IF countindf7IB NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf7IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 1, countindf7IB_1); index of radius of this stellar population in the val array
        indf7IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 2, countindf7IB_2); index of temperature of this stellar population in the val array
        indf7IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 3, countindf7IB_3); index of distance of this stellar population in the val array
        indf7IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 4, countindf7IB_4); index of the amplitude of this stellar population in the val array
        indf7IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 5, countindf7IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F7II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'II',countindf7II)
    IF countindf7II NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf7II_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 1, countindf7II_1); index of radius of this stellar population in the val array
        indf7II_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 2, countindf7II_2); index of temperature of this stellar population in the val array
        indf7II_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 3, countindf7II_3); index of distance of this stellar population in the val array
        indf7II_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 4, countindf7II_4); index of the amplitude of this stellar population in the val array
        indf7II_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 5, countindf7II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F7III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'III',countindf7III)
    IF countindf7III NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf7III_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 1, countindf7III_1); index of radius of this stellar population in the val array
        indf7III_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 2, countindf7III_2); index of temperature of this stellar population in the val array
        indf7III_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 3, countindf7III_3); index of distance of this stellar population in the val array
        indf7III_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 4, countindf7III_4); index of the amplitude of this stellar population in the val array
        indf7III_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 5, countindf7III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F7IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'IV',countindf7IV)
    IF countindf7IV NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf7IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 1, countindf7IV_1); index of radius of this stellar population in the val array
        indf7IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 2, countindf7IV_2); index of temperature of this stellar population in the val array
        indf7IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 3, countindf7IV_3); index of distance of this stellar population in the val array
        indf7IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 4, countindf7IV_4); index of the amplitude of this stellar population in the val array
        indf7IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 5, countindf7IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F7V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'V',countindf7V)
    IF countindf7V NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf7V_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 1, countindf7V_1); index of radius of this stellar population in the val array
        indf7V_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 2, countindf7V_2); index of temperature of this stellar population in the val array
        indf7V_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 3, countindf7V_3); index of distance of this stellar population in the val array
        indf7V_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 4, countindf7V_4); index of the amplitude of this stellar population in the val array
        indf7V_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 5, countindf7V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F7VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'VI',countindf7VI)
    IF countindf7VI NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf7VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 1, countindf7VI_1); index of radius of this stellar population in the val array
        indf7VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 2, countindf7VI_2); index of temperature of this stellar population in the val array
        indf7VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 3, countindf7VI_3); index of distance of this stellar population in the val array
        indf7VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 4, countindf7VI_4); index of the amplitude of this stellar population in the val array
        indf7VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 5, countindf7VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F7VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'VII',countindf7VII)
    IF countindf7VII NE 0 THEN BEGIN
        popnumber+=1
        countf+=1
        indf7VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 1, countindf7VII_1); index of radius of this stellar population in the val array
        indf7VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 2, countindf7VII_2); index of temperature of this stellar population in the val array
        indf7VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 3, countindf7VII_3); index of distance of this stellar population in the val array
        indf7VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 4, countindf7VII_4); index of the amplitude of this stellar population in the val array
        indf7VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 7 and params EQ 5, countindf7VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the F8 stellar population parameters===========
    ;===================================================================
    
    ; Locating the F8IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'IA+',countindf8IA+)
    IF countindf8IA+ NE 0 THEN BEGIN
    popnumber+=1
        countf+=1
        indf8IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 1, countindf8IA+_1); index of radius of this stellar population in the val array
        indf8IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 2, countindf8IA+_2); index of temperature of this stellar population in the val array
        indf8IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 3, countindf8IA+_3); index of distance of this stellar population in the val array
        indf8IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 4, countindf8IA+_4); index of the amplitude of this stellar population in the val array
        indf8IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 5, countindf8IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F8IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'IA',countindf8IA)
    IF countindf8IA NE 0 THEN BEGIN
    popnumber+=1
        countf+=1
        indf8IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 1, countindf8IA_1); index of radius of this stellar population in the val array
        indf8IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 2, countindf8IA_2); index of temperature of this stellar population in the val array
        indf8IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 3, countindf8IA_3); index of distance of this stellar population in the val array
        indf8IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 4, countindf8IA_4); index of the amplitude of this stellar population in the val array
        indf8IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 5, countindf8IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F8IAB stellar population parameters (Intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'IAB',countindf8IAB)
    IF countindf8IAB NE 0 THEN BEGIN
    popnumber+=1
        countf+=1
        indf8IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 1, countindf8IAB_1); index of radius of this stellar population in the val array
        indf8IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 2, countindf8IAB_2); index of temperature of this stellar population in the val array
        indf8IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 3, countindf8IAB_3); index of distance of this stellar population in the val array
        indf8IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 4, countindf8IAB_4); index of the amplitude of this stellar population in the val array
        indf8IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 5, countindf8IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F8IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'IB',countindf8IB)
    IF countindf8IB NE 0 THEN BEGIN
    popnumber+=1
        countf+=1
        indf8IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 1, countindf8IB_1); index of radius of this stellar population in the val array
        indf8IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 2, countindf8IB_2); index of temperature of this stellar population in the val array
        indf8IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 3, countindf8IB_3); index of distance of this stellar population in the val array
        indf8IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 4, countindf8IB_4); index of the amplitude of this stellar population in the val array
        indf8IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 5, countindf8IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F8II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'II',countindf8II)
    IF countindf8II NE 0 THEN BEGIN
    popnumber+=1
        countf+=1
        indf8II_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 1, countindf8II_1); index of radius of this stellar population in the val array
        indf8II_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 2, countindf8II_2); index of temperature of this stellar population in the val array
        indf8II_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 3, countindf8II_3); index of distance of this stellar population in the val array
        indf8II_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 4, countindf8II_4); index of the amplitude of this stellar population in the val array
        indf8II_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 5, countindf8II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F8III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'III',countindf8III)
    IF countindf8III NE 0 THEN BEGIN
    popnumber+=1
        countf+=1
        indf8III_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 1, countindf8III_1); index of radius of this stellar population in the val array
        indf8III_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 2, countindf8III_2); index of temperature of this stellar population in the val array
        indf8III_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 3, countindf8III_3); index of distance of this stellar population in the val array
        indf8III_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 4, countindf8III_4); index of the amplitude of this stellar population in the val array
        indf8III_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 5, countindf8III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F8IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'IV',countindf8IV)
    IF countindf8IV NE 0 THEN BEGIN
    popnumber+=1
        countf+=1
        indf8IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 1, countindf8IV_1); index of radius of this stellar population in the val array
        indf8IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 2, countindf8IV_2); index of temperature of this stellar population in the val array
        indf8IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 3, countindf8IV_3); index of distance of this stellar population in the val array
        indf8IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 4, countindf8IV_4); index of the amplitude of this stellar population in the val array
        indf8IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 5, countindf8IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the F8V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'V',countindf8V)
    IF countindf8V NE 0 THEN BEGIN
    popnumber+=1
        countf+=1
        indf8V_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 1, countindf8V_1); index of radius of this stellar population in the val array
        indf8V_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 2, countindf8V_2); index of temperature of this stellar population in the val array
        indf8V_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 3, countindf8V_3); index of distance of this stellar population in the val array
        indf8V_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 4, countindf8V_4); index of the amplitude of this stellar population in the val array
        indf8V_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 5, countindf8V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the F8VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'VI',countindf8VI)
    IF countindf8VI NE 0 THEN BEGIN
    popnumber+=1
        countf+=1
        indf8VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 1, countindf8VI_1); index of radius of this stellar population in the val array
        indf8VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 2, countindf8VI_2); index of temperature of this stellar population in the val array
        indf8VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 3, countindf8VI_3); index of distance of this stellar population in the val array
        indf8VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 4, countindf8VI_4); index of the amplitude of this stellar population in the val array
        indf8VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 5, countindf8VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the F8VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'VII',countindf8VII)
    IF countindf8VII NE 0 THEN BEGIN
    popnumber+=1
        countf+=1
        indf8VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 1, countindf8VII_1); index of radius of this stellar population in the val array
        indf8VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 2, countindf8VII_2); index of temperature of this stellar population in the val array
        indf8VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 3, countindf8VII_3); index of distance of this stellar population in the val array
        indf8VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 4, countindf8VII_4); index of the amplitude of this stellar population in the val array
        indf8VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 8 and params EQ 5, countindf8VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the F9 stellar population parameters===========
    ;===================================================================
    
    ; Locating the F9IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'IA+',countindf9IA+)
    IF countindf9IA+ NE 0 THEN BEGIN
        popnumber+=1  
        countf+=1
        indf9IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 1, countindf9IA+_1); index of radius of this stellar population in the val array
        indf9IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 2, countindf9IA+_2); index of temperature of this stellar population in the val array
        indf9IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 3, countindf9IA+_3); index of distance of this stellar population in the val array
        indf9IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 4, countindf9IA+_4); index of the amplitude of this stellar population in the val array
        indf9IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 5, countindf9IA+_5); index of the number of stars of this stellar population in the val array 
    ENDIF
    
    ; Locating the F9IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'IA',countindf9IA)
    IF countindf9IA NE 0 THEN BEGIN
        popnumber+=1  
        countf+=1
        indf9IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 1, countindf9IA_1); index of radius of this stellar population in the val array
        indf9IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 2, countindf9IA_2); index of temperature of this stellar population in the val array
        indf9IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 3, countindf9IA_3); index of distance of this stellar population in the val array
        indf9IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 4, countindf9IA_4); index of the amplitude of this stellar population in the val array
        indf9IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 5, countindf9IA_5); index of the number of stars of this stellar population in the val array 
    ENDIF
    
    
    ; Locating the F9IAB stellar population parameters (Intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'IAB',countindf9IAB)
    IF countindf9IAB NE 0 THEN BEGIN
        popnumber+=1  
        countf+=1
        indf9IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 1, countindf9IAB_1); index of radius of this stellar population in the val array
        indf9IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 2, countindf9IAB_2); index of temperature of this stellar population in the val array
        indf9IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 3, countindf9IAB_3); index of distance of this stellar population in the val array
        indf9IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 4, countindf9IAB_4); index of the amplitude of this stellar population in the val array
        indf9IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 5, countindf9IAB_5); index of the number of stars of this stellar population in the val array 
    ENDIF
    

    ; Locating the F9IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'IB',countindf9IB)
    IF countindf9IB NE 0 THEN BEGIN
        popnumber+=1  
        countf+=1
        indf9IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 1, countindf9IB_1); index of radius of this stellar population in the val array
        indf9IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 2, countindf9IB_2); index of temperature of this stellar population in the val array
        indf9IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 3, countindf9IB_3); index of distance of this stellar population in the val array
        indf9IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 4, countindf9IB_4); index of the amplitude of this stellar population in the val array
        indf9IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 5, countindf9IB_5); index of the number of stars of this stellar population in the val array 
    ENDIF
    
    
    ; Locating the F9II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'II',countindf9II)
    IF countindf9II NE 0 THEN BEGIN
        popnumber+=1  
        countf+=1
        indf9II_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 1, countindf9II_1); index of radius of this stellar population in the val array
        indf9II_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 2, countindf9II_2); index of temperature of this stellar population in the val array
        indf9II_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 3, countindf9II_3); index of distance of this stellar population in the val array
        indf9II_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 4, countindf9II_4); index of the amplitude of this stellar population in the val array
        indf9II_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 5, countindf9II_5); index of the number of stars of this stellar population in the val array 
    ENDIF
    
    ; Locating the F9III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'III',countindf9III)
    IF countindf9III NE 0 THEN BEGIN
        popnumber+=1  
        countf+=1
        indf9III_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 1, countindf9III_1); index of radius of this stellar population in the val array
        indf9III_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 2, countindf9III_2); index of temperature of this stellar population in the val array
        indf9III_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 3, countindf9III_3); index of distance of this stellar population in the val array
        indf9III_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 4, countindf9III_4); index of the amplitude of this stellar population in the val array
        indf9III_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 5, countindf9III_5); index of the number of stars of this stellar population in the val array 
    ENDIF
    
    ; Locating the F9IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'IV',countindf9IV)
    IF countindf9IV NE 0 THEN BEGIN
        popnumber+=1  
        countf+=1
        indf9IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 1, countindf9IV_1); index of radius of this stellar population in the val array
        indf9IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 2, countindf9IV_2); index of temperature of this stellar population in the val array
        indf9IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 3, countindf9IV_3); index of distance of this stellar population in the val array
        indf9IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 4, countindf9IV_4); index of the amplitude of this stellar population in the val array
        indf9IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 5, countindf9IV_5); index of the number of stars of this stellar population in the val array 
    ENDIF
    
    ; Locating the F9V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'V',countindf9V)
    IF countindf9V NE 0 THEN BEGIN
        popnumber+=1  
        countf+=1
        indf9V_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 1, countindf9V_1); index of radius of this stellar population in the val array
        indf9V_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 2, countindf9V_2); index of temperature of this stellar population in the val array
        indf9V_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 3, countindf9V_3); index of distance of this stellar population in the val array
        indf9V_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 4, countindf9V_4); index of the amplitude of this stellar population in the val array
        indf9V_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 5, countindf9V_5); index of the number of stars of this stellar population in the val array 
    ENDIF
    
    ; Locating the F9VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'VI',countindf9VI)
    IF countindf9VI NE 0 THEN BEGIN
        popnumber+=1  
        countf+=1
        indf9VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 1, countindf9VI_1); index of radius of this stellar population in the val array
        indf9VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 2, countindf9VI_2); index of temperature of this stellar population in the val array
        indf9VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 3, countindf9VI_3); index of distance of this stellar population in the val array
        indf9VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 4, countindf9VI_4); index of the amplitude of this stellar population in the val array
        indf9VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 5, countindf9VI_5); index of the number of stars of this stellar population in the val array 
    ENDIF
        
    ; Locating the F9VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'VII',countindf9VII)
    IF countindf9VII NE 0 THEN BEGIN
        popnumber+=1  
        countf+=1
        indf9VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 1, countindf9VII_1); index of radius of this stellar population in the val array
        indf9VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 2, countindf9VII_2); index of temperature of this stellar population in the val array
        indf9VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 3, countindf9VII_3); index of distance of this stellar population in the val array
        indf9VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 4, countindf9VII_4); index of the amplitude of this stellar population in the val array
        indf9VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'F' and strmid(key,1,1) EQ 9 and params EQ 5, countindf9VII_5); index of the number of stars of this stellar population in the val array 
    ENDIF
    
    
    ;===================================================================
    ;===================================================================
    
    
    ;===========Locating the G0 stellar population parameters===========
    ;===================================================================
    
    ; Locating the G0IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)  
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'IA+',countindg0IA+)
    IF countindg0IA+ NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg0IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 1, countindg0IA+_1); index of radius of this stellar population in the val array
        indg0IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 2, countindg0IA+_2); index of temperature of this stellar population in the val array
        indg0IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 3, countindg0IA+_3); index of distance of this stellar population in the val array
        indg0IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 4, countindg0IA+_4); index of the amplitude of this stellar population in the val array
        indg0IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 5, countindg0IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G0IA stellar population parameters (Luminous supergiants)  
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'IA',countindg0IA)
    IF countindg0IA NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg0IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 1, countindg0IA_1); index of radius of this stellar population in the val array
        indg0IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 2, countindg0IA_2); index of temperature of this stellar population in the val array
        indg0IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 3, countindg0IA_3); index of distance of this stellar population in the val array
        indg0IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 4, countindg0IA_4); index of the amplitude of this stellar population in the val array
        indg0IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 5, countindg0IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G0IAB stellar population parameters (Intermediate-size luminous supergiants)  
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'IAB',countindg0IAB)
    IF countindg0IAB NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg0IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 1, countindg0IAB_1); index of radius of this stellar population in the val array
        indg0IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 2, countindg0IAB_2); index of temperature of this stellar population in the val array
        indg0IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 3, countindg0IAB_3); index of distance of this stellar population in the val array
        indg0IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 4, countindg0IAB_4); index of the amplitude of this stellar population in the val array
        indg0IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 5, countindg0IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G0IB stellar population parameters (Less luminous supergiants)  
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'IB',countindg0IB)
    IF countindg0IB NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg0IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 1, countindg0IB_1); index of radius of this stellar population in the val array
        indg0IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 2, countindg0IB_2); index of temperature of this stellar population in the val array
        indg0IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 3, countindg0IB_3); index of distance of this stellar population in the val array
        indg0IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 4, countindg0IB_4); index of the amplitude of this stellar population in the val array
        indg0IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 5, countindg0IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G0II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'II',countindg0II)
    IF countindg0II NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg0II_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 1, countindg0II_1); index of radius of this stellar population in the val array
        indg0II_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 2, countindg0II_2); index of temperature of this stellar population in the val array
        indg0II_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 3, countindg0II_3); index of distance of this stellar population in the val array
        indg0II_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 4, countindg0II_4); index of the amplitude of this stellar population in the val array
        indg0II_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 5, countindg0II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G0III stellar population parameters (Normal giants) 
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'III',countindg0III)
    IF countindg0III NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg0III_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 1, countindg0III_1); index of radius of this stellar population in the val array
        indg0III_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 2, countindg0III_2); index of temperature of this stellar population in the val array
        indg0III_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 3, countindg0III_3); index of distance of this stellar population in the val array
        indg0III_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 4, countindg0III_4); index of the amplitude of this stellar population in the val array
        indg0III_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 5, countindg0III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G0IV stellar population parameters (Subgiants)  
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'IV',countindg0IV)
    IF countindg0IV NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg0IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 1, countindg0IV_1); index of radius of this stellar population in the val array
        indg0IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 2, countindg0IV_2); index of temperature of this stellar population in the val array
        indg0IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 3, countindg0IV_3); index of distance of this stellar population in the val array
        indg0IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 4, countindg0IV_4); index of the amplitude of this stellar population in the val array
        indg0IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 5, countindg0IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G0V stellar population parameters  (Dwarfs: Main-sequence star) 
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'V',countindg0V)
    IF countindg0V NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg0V_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 1, countindg0V_1); index of radius of this stellar population in the val array
        indg0V_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 2, countindg0V_2); index of temperature of this stellar population in the val array
        indg0V_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 3, countindg0V_3); index of distance of this stellar population in the val array
        indg0V_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 4, countindg0V_4); index of the amplitude of this stellar population in the val array
        indg0V_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 5, countindg0V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G0VI stellar population parameters (Subdwarfs)  
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'VI',countindg0VI)
    IF countindg0VI NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg0VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 1, countindg0VI_1); index of radius of this stellar population in the val array
        indg0VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 2, countindg0VI_2); index of temperature of this stellar population in the val array
        indg0VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 3, countindg0VI_3); index of distance of this stellar population in the val array
        indg0VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 4, countindg0VI_4); index of the amplitude of this stellar population in the val array
        indg0VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 5, countindg0VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G0VII stellar population parameters (White dwarfs)  
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and strupcase(lumclass) EQ 'VII',countindg0VII)
    IF countindg0VII NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg0VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 1, countindg0VII_1); index of radius of this stellar population in the val array
        indg0VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 2, countindg0VII_2); index of temperature of this stellar population in the val array
        indg0VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 3, countindg0VII_3); index of distance of this stellar population in the val array
        indg0VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 4, countindg0VII_4); index of the amplitude of this stellar population in the val array
        indg0VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 0 and params EQ 5, countindg0VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
     ;===================================================================
     ;===================================================================
     
     
     ;===========Locating the G1 stellar population parameters===========
     ;===================================================================
    
    ; Locating the G1IA+ stellar population parameters (hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'IA+',countindg1IA+)
    IF countindg1IA+ NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg1IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 1, countindg1IA+_1); index of radius of this stellar population in the val array
        indg1IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 2, countindg1IA+_2); index of temperature of this stellar population in the val array
        indg1IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 3, countindg1IA+_3); index of distance of this stellar population in the val array
        indg1IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 4, countindg1IA+_4); index of the amplitude of this stellar population in the val array
        indg1IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 5, countindg1IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the G1IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'IA',countindg1IA)
    IF countindg1IA NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg1IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 1, countindg1IA_1); index of radius of this stellar population in the val array
        indg1IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 2, countindg1IA_2); index of temperature of this stellar population in the val array
        indg1IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 3, countindg1IA_3); index of distance of this stellar population in the val array
        indg1IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 4, countindg1IA_4); index of the amplitude of this stellar population in the val array
        indg1IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 5, countindg1IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G1IAB stellar population parameters (Intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'IAB',countindg1IAB)
    IF countindg1IAB NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg1IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 1, countindg1IAB_1); index of radius of this stellar population in the val array
        indg1IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 2, countindg1IAB_2); index of temperature of this stellar population in the val array
        indg1IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 3, countindg1IAB_3); index of distance of this stellar population in the val array
        indg1IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 4, countindg1IAB_4); index of the amplitude of this stellar population in the val array
        indg1IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 5, countindg1IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G1IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'IB',countindg1IB)
    IF countindg1IB NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg1IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 1, countindg1IB_1); index of radius of this stellar population in the val array
        indg1IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 2, countindg1IB_2); index of temperature of this stellar population in the val array
        indg1IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 3, countindg1IB_3); index of distance of this stellar population in the val array
        indg1IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 4, countindg1IB_4); index of the amplitude of this stellar population in the val array
        indg1IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 5, countindg1IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G1II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'II',countindg1II)
    IF countindg1II NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg1II_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 1, countindg1II_1); index of radius of this stellar population in the val array
        indg1II_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 2, countindg1II_2); index of temperature of this stellar population in the val array
        indg1II_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 3, countindg1II_3); index of distance of this stellar population in the val array
        indg1II_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 4, countindg1II_4); index of the amplitude of this stellar population in the val array
        indg1II_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 5, countindg1II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the G1III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'III',countindg1III)
    IF countindg1III NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg1III_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 1, countindg1III_1); index of radius of this stellar population in the val array
        indg1III_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 2, countindg1III_2); index of temperature of this stellar population in the val array
        indg1III_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 3, countindg1III_3); index of distance of this stellar population in the val array
        indg1III_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 4, countindg1III_4); index of the amplitude of this stellar population in the val array
        indg1III_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 5, countindg1III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G1IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'IV',countindg1IV)
    IF countindg1IV NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg1IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 1, countindg1IV_1); index of radius of this stellar population in the val array
        indg1IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 2, countindg1IV_2); index of temperature of this stellar population in the val array
        indg1IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 3, countindg1IV_3); index of distance of this stellar population in the val array
        indg1IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 4, countindg1IV_4); index of the amplitude of this stellar population in the val array
        indg1IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 5, countindg1IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G1V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'V',countindg1V)
    IF countindg1V NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg1V_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 1, countindg1V_1); index of radius of this stellar population in the val array
        indg1V_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 2, countindg1V_2); index of temperature of this stellar population in the val array
        indg1V_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 3, countindg1V_3); index of distance of this stellar population in the val array
        indg1V_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 4, countindg1V_4); index of the amplitude of this stellar population in the val array
        indg1V_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 5, countindg1V_5); index of the number of stars of this stellar population in the val array
    ENDIF 
    
    ; Locating the G1VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'VI',countindg1VI)
    IF countindg1VI NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg1VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 1, countindg1VI_1); index of radius of this stellar population in the val array
        indg1VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 2, countindg1VI_2); index of temperature of this stellar population in the val array
        indg1VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 3, countindg1VI_3); index of distance of this stellar population in the val array
        indg1VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 4, countindg1VI_4); index of the amplitude of this stellar population in the val array
        indg1VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 5, countindg1VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G1VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and strupcase(lumclass) EQ 'VII',countindg1VII)
    IF countindg1VII NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg1VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 1, countindg1VII_1); index of radius of this stellar population in the val array
        indg1VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 2, countindg1VII_2); index of temperature of this stellar population in the val array
        indg1VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 3, countindg1VII_3); index of distance of this stellar population in the val array
        indg1VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 4, countindg1VII_4); index of the amplitude of this stellar population in the val array
        indg1VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 1 and params EQ 5, countindg1VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
     ;===================================================================
     ;===================================================================
     
     
     ;===========Locating the G2 stellar population parameters===========
     ;===================================================================
    
    ; Locating the G2IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'IA+',countindg2IA+) ;sun-like star
    IF countindg2IA+ NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg2IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 1, countindg2IA+_1); index of radius of this stellar population in the val array
        indg2IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 2, countindg2IA+_2); index of temperature of this stellar population in the val array
        indg2IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 3, countindg2IA+_3); index of distance of this stellar population in the val array
        indg2IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 4, countindg2IA+_4); index of the amplitude of this stellar population in the val array
        indg2IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 5, countindg2IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G2IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'IA',countindg2IA) ;sun-like star
    IF countindg2IA NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg2IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 1, countindg2IA_1); index of radius of this stellar population in the val array
        indg2IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 2, countindg2IA_2); index of temperature of this stellar population in the val array
        indg2IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 3, countindg2IA_3); index of distance of this stellar population in the val array
        indg2IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 4, countindg2IA_4); index of the amplitude of this stellar population in the val array
        indg2IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 5, countindg2IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G2IAB stellar population parameters (Intermediate-size supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'IAB',countindg2IAB) ;sun-like star
    IF countindg2IAB NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg2IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 1, countindg2IAB_1); index of radius of this stellar population in the val array
        indg2IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 2, countindg2IAB_2); index of temperature of this stellar population in the val array
        indg2IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 3, countindg2IAB_3); index of distance of this stellar population in the val array
        indg2IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 4, countindg2IAB_4); index of the amplitude of this stellar population in the val array
        indg2IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 5, countindg2IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G2IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'IB',countindg2IB) ;sun-like star
    IF countindg2IB NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg2IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 1, countindg2IB_1); index of radius of this stellar population in the val array
        indg2IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 2, countindg2IB_2); index of temperature of this stellar population in the val array
        indg2IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 3, countindg2IB_3); index of distance of this stellar population in the val array
        indg2IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 4, countindg2IB_4); index of the amplitude of this stellar population in the val array
        indg2IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 5, countindg2IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G2II stellar population parameters (Broght giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'II',countindg2II) ;sun-like star
    IF countindg2II NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg2II_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 1, countindg2II_1); index of radius of this stellar population in the val array
        indg2II_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 2, countindg2II_2); index of temperature of this stellar population in the val array
        indg2II_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 3, countindg2II_3); index of distance of this stellar population in the val array
        indg2II_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 4, countindg2II_4); index of the amplitude of this stellar population in the val array
        indg2II_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 5, countindg2II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G2III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'III',countindg2III) ;sun-like star
    IF countindg2III NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg2III_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 1, countindg2III_1); index of radius of this stellar population in the val array
        indg2III_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 2, countindg2III_2); index of temperature of this stellar population in the val array
        indg2III_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 3, countindg2III_3); index of distance of this stellar population in the val array
        indg2III_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 4, countindg2III_4); index of the amplitude of this stellar population in the val array
        indg2III_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 5, countindg2III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G2IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'IV',countindg2IV) ;sun-like star
    IF countindg2IV NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg2IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 1, countindg2IV_1); index of radius of this stellar population in the val array
        indg2IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 2, countindg2IV_2); index of temperature of this stellar population in the val array
        indg2IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 3, countindg2IV_3); index of distance of this stellar population in the val array
        indg2IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 4, countindg2IV_4); index of the amplitude of this stellar population in the val array
        indg2IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 5, countindg2IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G2V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'V',countindg2V) ;sun-like star
    IF countindg2V NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg2V_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 1, countindg2V_1); index of radius of this stellar population in the val array
        indg2V_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 2, countindg2V_2); index of temperature of this stellar population in the val array
        indg2V_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 3, countindg2V_3); index of distance of this stellar population in the val array
        indg2V_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 4, countindg2V_4); index of the amplitude of this stellar population in the val array
        indg2V_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 5, countindg2V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G2VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'VI',countindg2VI) ;sun-like star
    IF countindg2VI NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg2VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 1, countindg2VI_1); index of radius of this stellar population in the val array
        indg2VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 2, countindg2VI_2); index of temperature of this stellar population in the val array
        indg2VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 3, countindg2VI_3); index of distance of this stellar population in the val array
        indg2VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 4, countindg2VI_4); index of the amplitude of this stellar population in the val array
        indg2VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 5, countindg2VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G2VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and strupcase(lumclass) EQ 'VII',countindg2VII) ;sun-like star
    IF countindg2VII NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg2VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 1, countindg2VII_1); index of radius of this stellar population in the val array
        indg2VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 2, countindg2VII_2); index of temperature of this stellar population in the val array
        indg2VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 3, countindg2VII_3); index of distance of this stellar population in the val array
        indg2VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 4, countindg2VII_4); index of the amplitude of this stellar population in the val array
        indg2VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 2 and params EQ 5, countindg2VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    
     ;===================================================================
     ;===================================================================
     
     
     ;===========Locating the G3 stellar population parameters===========
     ;===================================================================
    
    ; Locating the G3IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'IA+',countindg3IA+)
    IF countindg3IA+ NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg3IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 1, countindg3IA+_1); index of radius of this stellar population in the val array
        indg3IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 2, countindg3IA+_2); index of temperature of this stellar population in the val array
        indg3IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 3, countindg3IA+_3); index of distance of this stellar population in the val array
        indg3IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 4, countindg3IA+_4); index of the amplitude of this stellar population in the val array
        indg3IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 5, countindg3IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the G3IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'IA',countindg3IA)
    IF countindg3IA NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg3IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 1, countindg3IA_1); index of radius of this stellar population in the val array
        indg3IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 2, countindg3IA_2); index of temperature of this stellar population in the val array
        indg3IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 3, countindg3IA_3); index of distance of this stellar population in the val array
        indg3IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 4, countindg3IA_4); index of the amplitude of this stellar population in the val array
        indg3IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 5, countindg3IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G3IAB stellar population parameters (Intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'IAB',countindg3IAB)
    IF countindg3IAB NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg3IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 1, countindg3IAB_1); index of radius of this stellar population in the val array
        indg3IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 2, countindg3IAB_2); index of temperature of this stellar population in the val array
        indg3IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 3, countindg3IAB_3); index of distance of this stellar population in the val array
        indg3IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 4, countindg3IAB_4); index of the amplitude of this stellar population in the val array
        indg3IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 5, countindg3IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G3IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'IB',countindg3IB)
    IF countindg3IB NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg3IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 1, countindg3IB_1); index of radius of this stellar population in the val array
        indg3IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 2, countindg3IB_2); index of temperature of this stellar population in the val array
        indg3IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 3, countindg3IB_3); index of distance of this stellar population in the val array
        indg3IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 4, countindg3IB_4); index of the amplitude of this stellar population in the val array
        indg3IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 5, countindg3IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G3II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'II',countindg3II)
    IF countindg3II NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg3II_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 1, countindg3II_1); index of radius of this stellar population in the val array
        indg3II_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 2, countindg3II_2); index of temperature of this stellar population in the val array
        indg3II_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 3, countindg3II_3); index of distance of this stellar population in the val array
        indg3II_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 4, countindg3II_4); index of the amplitude of this stellar population in the val array
        indg3II_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 5, countindg3II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G3III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'III',countindg3III)
    IF countindg3III NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg3III_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 1, countindg3III_1); index of radius of this stellar population in the val array
        indg3III_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 2, countindg3III_2); index of temperature of this stellar population in the val array
        indg3III_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 3, countindg3III_3); index of distance of this stellar population in the val array
        indg3III_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 4, countindg3III_4); index of the amplitude of this stellar population in the val array
        indg3III_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 5, countindg3III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G3IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'IV',countindg3IV)
    IF countindg3IV NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg3IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 1, countindg3IV_1); index of radius of this stellar population in the val array
        indg3IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 2, countindg3IV_2); index of temperature of this stellar population in the val array
        indg3IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 3, countindg3IV_3); index of distance of this stellar population in the val array
        indg3IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 4, countindg3IV_4); index of the amplitude of this stellar population in the val array
        indg3IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 5, countindg3IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G3V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'V',countindg3V)
    IF countindg3V NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg3V_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 1, countindg3V_1); index of radius of this stellar population in the val array
        indg3V_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 2, countindg3V_2); index of temperature of this stellar population in the val array
        indg3V_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 3, countindg3V_3); index of distance of this stellar population in the val array
        indg3V_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 4, countindg3V_4); index of the amplitude of this stellar population in the val array
        indg3V_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 5, countindg3V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G3VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'VI',countindg3VI)
    IF countindg3VI NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg3VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 1, countindg3VI_1); index of radius of this stellar population in the val array
        indg3VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 2, countindg3VI_2); index of temperature of this stellar population in the val array
        indg3VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 3, countindg3VI_3); index of distance of this stellar population in the val array
        indg3VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 4, countindg3VI_4); index of the amplitude of this stellar population in the val array
        indg3VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 5, countindg3VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G3VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and strupcase(lumclass) EQ 'VII',countindg3VII)
    IF countindg3VII NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg3VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 1, countindg3VII_1); index of radius of this stellar population in the val array
        indg3VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 2, countindg3VII_2); index of temperature of this stellar population in the val array
        indg3VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 3, countindg3VII_3); index of distance of this stellar population in the val array
        indg3VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 4, countindg3VII_4); index of the amplitude of this stellar population in the val array
        indg3VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 3 and params EQ 5, countindg3VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
     ;===================================================================
     ;===================================================================
     
     
     ;===========Locating the G4 stellar population parameters===========
     ;===================================================================
    
    ; Locating the G4IA+ stellar population parameters (hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'IA+',countindg4IA+)
    IF countindg4IA+ NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg4IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 1, countindg4IA+_1); index of radius of this stellar population in the val array
        indg4IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 2, countindg4IA+_2); index of temperature of this stellar population in the val array
        indg4IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 3, countindg4IA+_3); index of distance of this stellar population in the val array
        indg4IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 4, countindg4IA+_4); index of the amplitude of this stellar population in the val array
        indg4IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 5, countindg4IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G4IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'IA',countindg4IA)
    IF countindg4IA NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg4IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 1, countindg4IA_1); index of radius of this stellar population in the val array
        indg4IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 2, countindg4IA_2); index of temperature of this stellar population in the val array
        indg4IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 3, countindg4IA_3); index of distance of this stellar population in the val array
        indg4IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 4, countindg4IA_4); index of the amplitude of this stellar population in the val array
        indg4IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 5, countindg4IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G4IAB stellar population parameters (Intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'IAB',countindg4IAB)
    IF countindg4IAB NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg4IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 1, countindg4IAB_1); index of radius of this stellar population in the val array
        indg4IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 2, countindg4IAB_2); index of temperature of this stellar population in the val array
        indg4IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 3, countindg4IAB_3); index of distance of this stellar population in the val array
        indg4IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 4, countindg4IAB_4); index of the amplitude of this stellar population in the val array
        indg4IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 5, countindg4IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G4IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'IB',countindg4IB)
    IF countindg4IB NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg4IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 1, countindg4IB_1); index of radius of this stellar population in the val array
        indg4IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 2, countindg4IB_2); index of temperature of this stellar population in the val array
        indg4IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 3, countindg4IB_3); index of distance of this stellar population in the val array
        indg4IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 4, countindg4IB_4); index of the amplitude of this stellar population in the val array
        indg4IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 5, countindg4IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G4II stellar population parameters (bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'II',countindg4II)
    IF countindg4II NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg4II_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 1, countindg4II_1); index of radius of this stellar population in the val array
        indg4II_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 2, countindg4II_2); index of temperature of this stellar population in the val array
        indg4II_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 3, countindg4II_3); index of distance of this stellar population in the val array
        indg4II_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 4, countindg4II_4); index of the amplitude of this stellar population in the val array
        indg4II_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 5, countindg4II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G4III stellar population parameters (Normal supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'III',countindg4III)
    IF countindg4III NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg4III_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 1, countindg4III_1); index of radius of this stellar population in the val array
        indg4III_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 2, countindg4III_2); index of temperature of this stellar population in the val array
        indg4III_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 3, countindg4III_3); index of distance of this stellar population in the val array
        indg4III_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 4, countindg4III_4); index of the amplitude of this stellar population in the val array
        indg4III_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 5, countindg4III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G4IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'IV',countindg4IV)
    IF countindg4IV NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg4IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 1, countindg4IV_1); index of radius of this stellar population in the val array
        indg4IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 2, countindg4IV_2); index of temperature of this stellar population in the val array
        indg4IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 3, countindg4IV_3); index of distance of this stellar population in the val array
        indg4IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 4, countindg4IV_4); index of the amplitude of this stellar population in the val array
        indg4IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 5, countindg4IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G4V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'V',countindg4V)
    IF countindg4V NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg4V_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 1, countindg4V_1); index of radius of this stellar population in the val array
        indg4V_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 2, countindg4V_2); index of temperature of this stellar population in the val array
        indg4V_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 3, countindg4V_3); index of distance of this stellar population in the val array
        indg4V_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 4, countindg4V_4); index of the amplitude of this stellar population in the val array
        indg4V_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 5, countindg4V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G4VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'VI',countindg4VI)
    IF countindg4VI NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg4VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 1, countindg4VI_1); index of radius of this stellar population in the val array
        indg4VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 2, countindg4VI_2); index of temperature of this stellar population in the val array
        indg4VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 3, countindg4VI_3); index of distance of this stellar population in the val array
        indg4VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 4, countindg4VI_4); index of the amplitude of this stellar population in the val array
        indg4VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 5, countindg4VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G4VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and strupcase(lumclass) EQ 'VII',countindg4VII)
    IF countindg4VII NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg4VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 1, countindg4VII_1); index of radius of this stellar population in the val array
        indg4VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 2, countindg4VII_2); index of temperature of this stellar population in the val array
        indg4VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 3, countindg4VII_3); index of distance of this stellar population in the val array
        indg4VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 4, countindg4VII_4); index of the amplitude of this stellar population in the val array
        indg4VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 4 and params EQ 5, countindg4VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
     ;===================================================================
     ;===================================================================
     
     
     ;===========Locating the G5 stellar population parameters===========
     ;===================================================================
    
    ; Locating the G5IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'IA+',countindg5IA+)
    IF countindg5IA+ NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg5IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 1, countindg5IA+_1); index of radius of this stellar population in the val array
        indg5IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 2, countindg5IA+_2); index of temperature of this stellar population in the val array
        indg5IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 3, countindg5IA+_3); index of distance of this stellar population in the val array
        indg5IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 4, countindg5IA+_4); index of the amplitude of this stellar population in the val array
        indg5IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 5, countindg5IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G5IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'IA',countindg5IA)
    IF countindg5IA NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg5IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 1, countindg5IA_1); index of radius of this stellar population in the val array
        indg5IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 2, countindg5IA_2); index of temperature of this stellar population in the val array
        indg5IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 3, countindg5IA_3); index of distance of this stellar population in the val array
        indg5IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 4, countindg5IA_4); index of the amplitude of this stellar population in the val array
        indg5IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 5, countindg5IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G5IAB stellar population parameters (Intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'IAB',countindg5IAB)
    IF countindg5IAB NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg5IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 1, countindg5IAB_1); index of radius of this stellar population in the val array
        indg5IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 2, countindg5IAB_2); index of temperature of this stellar population in the val array
        indg5IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 3, countindg5IAB_3); index of distance of this stellar population in the val array
        indg5IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 4, countindg5IAB_4); index of the amplitude of this stellar population in the val array
        indg5IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 5, countindg5IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G5IB stellar population parameters (less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'IB',countindg5IB)
    IF countindg5IB NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg5IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 1, countindg5IB_1); index of radius of this stellar population in the val array
        indg5IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 2, countindg5IB_2); index of temperature of this stellar population in the val array
        indg5IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 3, countindg5IB_3); index of distance of this stellar population in the val array
        indg5IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 4, countindg5IB_4); index of the amplitude of this stellar population in the val array
        indg5IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 5, countindg5IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G5II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'II',countindg5II)
    IF countindg5II NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg5II_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 1, countindg5II_1); index of radius of this stellar population in the val array
        indg5II_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 2, countindg5II_2); index of temperature of this stellar population in the val array
        indg5II_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 3, countindg5II_3); index of distance of this stellar population in the val array
        indg5II_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 4, countindg5II_4); index of the amplitude of this stellar population in the val array
        indg5II_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 5, countindg5II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G5III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'III',countindg5III)
    IF countindg5III NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg5III_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 1, countindg5III_1); index of radius of this stellar population in the val array
        indg5III_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 2, countindg5III_2); index of temperature of this stellar population in the val array
        indg5III_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 3, countindg5III_3); index of distance of this stellar population in the val array
        indg5III_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 4, countindg5III_4); index of the amplitude of this stellar population in the val array
        indg5III_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 5, countindg5III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G5IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'IV',countindg5IV)
    IF countindg5IV NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg5IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 1, countindg5IV_1); index of radius of this stellar population in the val array
        indg5IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 2, countindg5IV_2); index of temperature of this stellar population in the val array
        indg5IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 3, countindg5IV_3); index of distance of this stellar population in the val array
        indg5IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 4, countindg5IV_4); index of the amplitude of this stellar population in the val array
        indg5IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 5, countindg5IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G5V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'V',countindg5V)
    IF countindg5V NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg5V_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 1, countindg5V_1); index of radius of this stellar population in the val array
        indg5V_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 2, countindg5V_2); index of temperature of this stellar population in the val array
        indg5V_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 3, countindg5V_3); index of distance of this stellar population in the val array
        indg5V_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 4, countindg5V_4); index of the amplitude of this stellar population in the val array
        indg5V_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 5, countindg5V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G5VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'VI',countindg5VI)
    IF countindg5VI NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg5VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 1, countindg5VI_1); index of radius of this stellar population in the val array
        indg5VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 2, countindg5VI_2); index of temperature of this stellar population in the val array
        indg5VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 3, countindg5VI_3); index of distance of this stellar population in the val array
        indg5VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 4, countindg5VI_4); index of the amplitude of this stellar population in the val array
        indg5VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 5, countindg5VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G5VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and strupcase(lumclass) EQ 'VII',countindg5VII)
    IF countindg5VII NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg5VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 1, countindg5VII_1); index of radius of this stellar population in the val array
        indg5VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 2, countindg5VII_2); index of temperature of this stellar population in the val array
        indg5VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 3, countindg5VII_3); index of distance of this stellar population in the val array
        indg5VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 4, countindg5VII_4); index of the amplitude of this stellar population in the val array
        indg5VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 5 and params EQ 5, countindg5VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
     ;===================================================================
     ;===================================================================
     
     
     ;===========Locating the G6 stellar population parameters===========
     ;===================================================================
    
    ; Locating the G6IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'IA+',countindg6IA+)
    IF countindg6IA+ NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg6IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 1, countindg6IA+_1); index of radius of this stellar population in the val array
        indg6IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 2, countindg6IA+_2); index of temperature of this stellar population in the val array
        indg6IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 3, countindg6IA+_3); index of distance of this stellar population in the val array
        indg6IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 4, countindg6IA+_4); index of the amplitude of this stellar population in the val array
        indg6IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 5, countindg6IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the G6IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'IA',countindg6IA)
    IF countindg6IA NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg6IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 1, countindg6IA_1); index of radius of this stellar population in the val array
        indg6IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 2, countindg6IA_2); index of temperature of this stellar population in the val array
        indg6IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 3, countindg6IA_3); index of distance of this stellar population in the val array
        indg6IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 4, countindg6IA_4); index of the amplitude of this stellar population in the val array
        indg6IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 5, countindg6IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the G6IAB stellar population parameters (Intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'IAB',countindg6IAB)
    IF countindg6IAB NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg6IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 1, countindg6IAB_1); index of radius of this stellar population in the val array
        indg6IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 2, countindg6IAB_2); index of temperature of this stellar population in the val array
        indg6IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 3, countindg6IAB_3); index of distance of this stellar population in the val array
        indg6IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 4, countindg6IAB_4); index of the amplitude of this stellar population in the val array
        indg6IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 5, countindg6IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G6IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'IB',countindg6IB)
    IF countindg6IB NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg6IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 1, countindg6IB_1); index of radius of this stellar population in the val array
        indg6IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 2, countindg6IB_2); index of temperature of this stellar population in the val array
        indg6IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 3, countindg6IB_3); index of distance of this stellar population in the val array
        indg6IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 4, countindg6IB_4); index of the amplitude of this stellar population in the val array
        indg6IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 5, countindg6IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the G6II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'II',countindg6II)
    IF countindg6II NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg6II_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 1, countindg6II_1); index of radius of this stellar population in the val array
        indg6II_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 2, countindg6II_2); index of temperature of this stellar population in the val array
        indg6II_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 3, countindg6II_3); index of distance of this stellar population in the val array
        indg6II_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 4, countindg6II_4); index of the amplitude of this stellar population in the val array
        indg6II_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 5, countindg6II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G6III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'III',countindg6III)
    IF countindg6III NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg6III_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 1, countindg6III_1); index of radius of this stellar population in the val array
        indg6III_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 2, countindg6III_2); index of temperature of this stellar population in the val array
        indg6III_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 3, countindg6III_3); index of distance of this stellar population in the val array
        indg6III_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 4, countindg6III_4); index of the amplitude of this stellar population in the val array
        indg6III_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 5, countindg6III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G6IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'IV',countindg6IV)
    IF countindg6IV NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg6IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 1, countindg6IV_1); index of radius of this stellar population in the val array
        indg6IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 2, countindg6IV_2); index of temperature of this stellar population in the val array
        indg6IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 3, countindg6IV_3); index of distance of this stellar population in the val array
        indg6IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 4, countindg6IV_4); index of the amplitude of this stellar population in the val array
        indg6IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 5, countindg6IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G6V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'V',countindg6V)
    IF countindg6V NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg6V_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 1, countindg6V_1); index of radius of this stellar population in the val array
        indg6V_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 2, countindg6V_2); index of temperature of this stellar population in the val array
        indg6V_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 3, countindg6V_3); index of distance of this stellar population in the val array
        indg6V_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 4, countindg6V_4); index of the amplitude of this stellar population in the val array
        indg6V_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 5, countindg6V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G6VI stellar population parameters (Subdwarf)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'VI',countindg6VI)
    IF countindg6VI NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg6VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 1, countindg6VI_1); index of radius of this stellar population in the val array
        indg6VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 2, countindg6VI_2); index of temperature of this stellar population in the val array
        indg6VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 3, countindg6VI_3); index of distance of this stellar population in the val array
        indg6VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 4, countindg6VI_4); index of the amplitude of this stellar population in the val array
        indg6VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 5, countindg6VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the G6VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and strupcase(lumclass) EQ 'VII',countindg6VII)
    IF countindg6VII NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg6VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 1, countindg6VII_1); index of radius of this stellar population in the val array
        indg6VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 2, countindg6VII_2); index of temperature of this stellar population in the val array
        indg6VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 3, countindg6VII_3); index of distance of this stellar population in the val array
        indg6VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 4, countindg6VII_4); index of the amplitude of this stellar population in the val array
        indg6VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 6 and params EQ 5, countindg6VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
     ;===================================================================
     ;===================================================================
     
     
     ;===========Locating the G7 stellar population parameters===========
     ;===================================================================
    
    ; Locating the G7IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'IA+',countindg7IA+)
    IF countindg7IA+ NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg7IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 1, countindg7IA+_1); index of radius of this stellar population in the val array
        indg7IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 2, countindg7IA+_2); index of temperature of this stellar population in the val array
        indg7IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 3, countindg7IA+_3); index of distance of this stellar population in the val array
        indg7IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 4, countindg7IA+_4); index of the amplitude of this stellar population in the val array
        indg7IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 5, countindg7IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G7IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'IA',countindg7IA)
    IF countindg7IA NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg7IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 1, countindg7IA_1); index of radius of this stellar population in the val array
        indg7IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 2, countindg7IA_2); index of temperature of this stellar population in the val array
        indg7IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 3, countindg7IA_3); index of distance of this stellar population in the val array
        indg7IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 4, countindg7IA_4); index of the amplitude of this stellar population in the val array
        indg7IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 5, countindg7IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G7IAB stellar population parameters (Intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'IAB',countindg7IAB)
    IF countindg7IAB NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg7IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 1, countindg7IAB_1); index of radius of this stellar population in the val array
        indg7IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 2, countindg7IAB_2); index of temperature of this stellar population in the val array
        indg7IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 3, countindg7IAB_3); index of distance of this stellar population in the val array
        indg7IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 4, countindg7IAB_4); index of the amplitude of this stellar population in the val array
        indg7IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 5, countindg7IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G7IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'IB',countindg7IB)
    IF countindg7IB NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg7IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 1, countindg7IB_1); index of radius of this stellar population in the val array
        indg7IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 2, countindg7IB_2); index of temperature of this stellar population in the val array
        indg7IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 3, countindg7IB_3); index of distance of this stellar population in the val array
        indg7IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 4, countindg7IB_4); index of the amplitude of this stellar population in the val array
        indg7IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 5, countindg7IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G7II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'II',countindg7II)
    IF countindg7II NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg7II_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 1, countindg7II_1); index of radius of this stellar population in the val array
        indg7II_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 2, countindg7II_2); index of temperature of this stellar population in the val array
        indg7II_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 3, countindg7II_3); index of distance of this stellar population in the val array
        indg7II_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 4, countindg7II_4); index of the amplitude of this stellar population in the val array
        indg7II_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 5, countindg7II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the G7III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'III',countindg7III)
    IF countindg7III NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg7III_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 1, countindg7III_1); index of radius of this stellar population in the val array
        indg7III_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 2, countindg7III_2); index of temperature of this stellar population in the val array
        indg7III_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 3, countindg7III_3); index of distance of this stellar population in the val array
        indg7III_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 4, countindg7III_4); index of the amplitude of this stellar population in the val array
        indg7III_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 5, countindg7III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G7IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'IV',countindg7IV)
    IF countindg7IV NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg7IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 1, countindg7IV_1); index of radius of this stellar population in the val array
        indg7IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 2, countindg7IV_2); index of temperature of this stellar population in the val array
        indg7IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 3, countindg7IV_3); index of distance of this stellar population in the val array
        indg7IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 4, countindg7IV_4); index of the amplitude of this stellar population in the val array
        indg7IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 5, countindg7IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G7V stellar population parameters (Dwarfs: Main-sequence stars )
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'V',countindg7V)
    IF countindg7V NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg7V_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 1, countindg7V_1); index of radius of this stellar population in the val array
        indg7V_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 2, countindg7V_2); index of temperature of this stellar population in the val array
        indg7V_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 3, countindg7V_3); index of distance of this stellar population in the val array
        indg7V_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 4, countindg7V_4); index of the amplitude of this stellar population in the val array
        indg7V_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 5, countindg7V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G7VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'VI',countindg7VI)
    IF countindg7VI NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg7VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 1, countindg7VI_1); index of radius of this stellar population in the val array
        indg7VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 2, countindg7VI_2); index of temperature of this stellar population in the val array
        indg7VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 3, countindg7VI_3); index of distance of this stellar population in the val array
        indg7VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 4, countindg7VI_4); index of the amplitude of this stellar population in the val array
        indg7VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 5, countindg7VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G7VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and strupcase(lumclass) EQ 'VII',countindg7VII)
    IF countindg7VII NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg7VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 1, countindg7VII_1); index of radius of this stellar population in the val array
        indg7VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 2, countindg7VII_2); index of temperature of this stellar population in the val array
        indg7VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 3, countindg7VII_3); index of distance of this stellar population in the val array
        indg7VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 4, countindg7VII_4); index of the amplitude of this stellar population in the val array
        indg7VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 7 and params EQ 5, countindg7VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
     ;===================================================================
     ;===================================================================
     
     
     ;===========Locating the G8 stellar population parameters===========
     ;===================================================================
    
    
    ; Locating the G8IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'IA+',countindg8IA+)
    IF countindg8IA+ NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg8IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 1, countindg8IA+_1); index of radius of this stellar population in the val array
        indg8IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 2, countindg8IA+_2); index of temperature of this stellar population in the val array
        indg8IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 3, countindg8IA+_3); index of distance of this stellar population in the val array
        indg8IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 4, countindg8IA+_4); index of the amplitude of this stellar population in the val array
        indg8IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 5, countindg8IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the G8IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'IA',countindg8IA)
    IF countindg8IA NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg8IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 1, countindg8IA_1); index of radius of this stellar population in the val array
        indg8IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 2, countindg8IA_2); index of temperature of this stellar population in the val array
        indg8IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 3, countindg8IA_3); index of distance of this stellar population in the val array
        indg8IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 4, countindg8IA_4); index of the amplitude of this stellar population in the val array
        indg8IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 5, countindg8IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G8IAB stellar population parameters (Intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'IAB',countindg8IAB)
    IF countindg8IAB NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg8IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 1, countindg8IAB_1); index of radius of this stellar population in the val array
        indg8IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 2, countindg8IAB_2); index of temperature of this stellar population in the val array
        indg8IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 3, countindg8IAB_3); index of distance of this stellar population in the val array
        indg8IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 4, countindg8IAB_4); index of the amplitude of this stellar population in the val array
        indg8IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 5, countindg8IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G8IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'IB',countindg8IB)
    IF countindg8IB NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg8IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 1, countindg8IB_1); index of radius of this stellar population in the val array
        indg8IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 2, countindg8IB_2); index of temperature of this stellar population in the val array
        indg8IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 3, countindg8IB_3); index of distance of this stellar population in the val array
        indg8IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 4, countindg8IB_4); index of the amplitude of this stellar population in the val array
        indg8IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 5, countindg8IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G8II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'II',countindg8II)
    IF countindg8II NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg8II_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 1, countindg8II_1); index of radius of this stellar population in the val array
        indg8II_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 2, countindg8II_2); index of temperature of this stellar population in the val array
        indg8II_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 3, countindg8II_3); index of distance of this stellar population in the val array
        indg8II_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 4, countindg8II_4); index of the amplitude of this stellar population in the val array
        indg8II_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 5, countindg8II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G8III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'III',countindg8III)
    IF countindg8III NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg8III_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 1, countindg8III_1); index of radius of this stellar population in the val array
        indg8III_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 2, countindg8III_2); index of temperature of this stellar population in the val array
        indg8III_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 3, countindg8III_3); index of distance of this stellar population in the val array
        indg8III_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 4, countindg8III_4); index of the amplitude of this stellar population in the val array
        indg8III_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 5, countindg8III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G8IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'IV',countindg8IV)
    IF countindg8IV NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg8IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 1, countindg8IV_1); index of radius of this stellar population in the val array
        indg8IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 2, countindg8IV_2); index of temperature of this stellar population in the val array
        indg8IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 3, countindg8IV_3); index of distance of this stellar population in the val array
        indg8IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 4, countindg8IV_4); index of the amplitude of this stellar population in the val array
        indg8IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 5, countindg8IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G8V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'V',countindg8V)
    IF countindg8V NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg8V_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 1, countindg8V_1); index of radius of this stellar population in the val array
        indg8V_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 2, countindg8V_2); index of temperature of this stellar population in the val array
        indg8V_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 3, countindg8V_3); index of distance of this stellar population in the val array
        indg8V_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 4, countindg8V_4); index of the amplitude of this stellar population in the val array
        indg8V_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 5, countindg8V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the G8VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'VI',countindg8VI)
    IF countindg8VI NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg8VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 1, countindg8VI_1); index of radius of this stellar population in the val array
        indg8VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 2, countindg8VI_2); index of temperature of this stellar population in the val array
        indg8VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 3, countindg8VI_3); index of distance of this stellar population in the val array
        indg8VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 4, countindg8VI_4); index of the amplitude of this stellar population in the val array
        indg8VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 5, countindg8VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G8VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and strupcase(lumclass) EQ 'VII',countindg8VII)
    IF countindg8VII NE 0 THEN BEGIN
        popnumber+=1
        countg+=1
        indg8VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 1, countindg8VII_1); index of radius of this stellar population in the val array
        indg8VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 2, countindg8VII_2); index of temperature of this stellar population in the val array
        indg8VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 3, countindg8VII_3); index of distance of this stellar population in the val array
        indg8VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 4, countindg8VII_4); index of the amplitude of this stellar population in the val array
        indg8VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 8 and params EQ 5, countindg8VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
     ;===================================================================
     ;===================================================================
     
     
     ;===========Locating the G9 stellar population parameters===========
     ;===================================================================
    
    ; Locating the G9IA+ stellar population parameters (Hypergiants or extremely luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'IA+',countindg9IA+)       
    IF countindg9IA+ NE 0 THEN BEGIN
        popnumber+=1   
        countg+=1
        indg9IA+_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 1, countindg9IA+_1); index of radius of this stellar population in the val array
        indg9IA+_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 2, countindg9IA+_2); index of temperature of this stellar population in the val array
        indg9IA+_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 3, countindg9IA+_3); index of distance of this stellar population in the val array
        indg9IA+_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 4, countindg9IA+_4); index of the amplitude of this stellar population in the val array
        indg9IA+_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 5, countindg9IA+_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    
    ; Locating the G9IA stellar population parameters (Luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'IA',countindg9IA)       
    IF countindg9IA NE 0 THEN BEGIN
        popnumber+=1   
        countg+=1
        indg9IA_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 1, countindg9IA_1); index of radius of this stellar population in the val array
        indg9IA_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 2, countindg9IA_2); index of temperature of this stellar population in the val array
        indg9IA_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 3, countindg9IA_3); index of distance of this stellar population in the val array
        indg9IA_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 4, countindg9IA_4); index of the amplitude of this stellar population in the val array
        indg9IA_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 5, countindg9IA_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G9IAB stellar population parameters (Intermediate-size luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'IAB',countindg9IAB)       
    IF countindg9IAB NE 0 THEN BEGIN
        popnumber+=1   
        countg+=1
        indg9IAB_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 1, countindg9IAB_1); index of radius of this stellar population in the val array
        indg9IAB_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 2, countindg9IAB_2); index of temperature of this stellar population in the val array
        indg9IAB_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 3, countindg9IAB_3); index of distance of this stellar population in the val array
        indg9IAB_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 4, countindg9IAB_4); index of the amplitude of this stellar population in the val array
        indg9IAB_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 5, countindg9IAB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G9IB stellar population parameters (Less luminous supergiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'IB',countindg9IB)       
    IF countindg9IB NE 0 THEN BEGIN
        popnumber+=1   
        countg+=1
        indg9IB_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 1, countindg9IB_1); index of radius of this stellar population in the val array
        indg9IB_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 2, countindg9IB_2); index of temperature of this stellar population in the val array
        indg9IB_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 3, countindg9IB_3); index of distance of this stellar population in the val array
        indg9IB_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 4, countindg9IB_4); index of the amplitude of this stellar population in the val array
        indg9IB_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 5, countindg9IB_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G9II stellar population parameters (Bright giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'II',countindg9II)       
    IF countindg9II NE 0 THEN BEGIN
        popnumber+=1   
        countg+=1
        indg9II_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 1, countindg9II_1); index of radius of this stellar population in the val array
        indg9II_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 2, countindg9II_2); index of temperature of this stellar population in the val array
        indg9II_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 3, countindg9II_3); index of distance of this stellar population in the val array
        indg9II_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 4, countindg9II_4); index of the amplitude of this stellar population in the val array
        indg9II_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 5, countindg9II_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G9III stellar population parameters (Normal giants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'III',countindg9III)       
    IF countindg9III NE 0 THEN BEGIN
        popnumber+=1   
        countg+=1
        indg9III_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 1, countindg9III_1); index of radius of this stellar population in the val array
        indg9III_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 2, countindg9III_2); index of temperature of this stellar population in the val array
        indg9III_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 3, countindg9III_3); index of distance of this stellar population in the val array
        indg9III_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 4, countindg9III_4); index of the amplitude of this stellar population in the val array
        indg9III_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 5, countindg9III_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G9IV stellar population parameters (Subgiants)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'IV',countindg9IV)       
    IF countindg9IV NE 0 THEN BEGIN
        popnumber+=1   
        countg+=1
        indg9IV_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 1, countindg9IV_1); index of radius of this stellar population in the val array
        indg9IV_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 2, countindg9IV_2); index of temperature of this stellar population in the val array
        indg9IV_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 3, countindg9IV_3); index of distance of this stellar population in the val array
        indg9IV_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 4, countindg9IV_4); index of the amplitude of this stellar population in the val array
        indg9IV_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 5, countindg9IV_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G9V stellar population parameters (Dwarfs: Main-sequence stars)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'V',countindg9V)       
    IF countindg9V NE 0 THEN BEGIN
        popnumber+=1   
        countg+=1
        indg9V_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 1, countindg9V_1); index of radius of this stellar population in the val array
        indg9V_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 2, countindg9V_2); index of temperature of this stellar population in the val array
        indg9V_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 3, countindg9V_3); index of distance of this stellar population in the val array
        indg9V_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 4, countindg9V_4); index of the amplitude of this stellar population in the val array
        indg9V_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 5, countindg9V_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G9VI stellar population parameters (Subdwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'VI',countindg9VI)       
    IF countindg9VI NE 0 THEN BEGIN
        popnumber+=1   
        countg+=1
        indg9VI_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 1, countindg9VI_1); index of radius of this stellar population in the val array
        indg9VI_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 2, countindg9VI_2); index of temperature of this stellar population in the val array
        indg9VI_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 3, countindg9VI_3); index of distance of this stellar population in the val array
        indg9VI_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 4, countindg9VI_4); index of the amplitude of this stellar population in the val array
        indg9VI_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 5, countindg9VI_5); index of the number of stars of this stellar population in the val array
    ENDIF
    
    ; Locating the G9VII stellar population parameters (White dwarfs)
    ind = where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and strupcase(lumclass) EQ 'VII',countindg9VII)       
    IF countindg9VII NE 0 THEN BEGIN
        popnumber+=1   
        countg+=1
        indg9VII_1 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 1, countindg9VII_1); index of radius of this stellar population in the val array
        indg9VII_2 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 2, countindg9VII_2); index of temperature of this stellar population in the val array
        indg9VII_3 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 3, countindg9VII_3); index of distance of this stellar population in the val array
        indg9VII_4 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 4, countindg9VII_4); index of the amplitude of this stellar population in the val array
        indg9VII_5 =  where(strupcase(strmid(key,0,1)) EQ 'G' and strmid(key,1,1) EQ 9 and params EQ 5, countindg9VII_5); index of the number of stars of this stellar population in the val array
    ENDIF
;===================================================================
;===================================================================
    
    
    comp_pop=replicate(one_pop,popnumber) ; Replication of the default and initialized stellar population structure to create the composite stellar population structure. All the tag values are by default set to te null value
    
    
    
    ;Filling the tags of the compsite stellar population structure using the indices defined above
    
    FOR i=0L,popnumber-1 DO BEGIN ; Looping over all the structure fields 
   
        IF counto NE 0 THEN BEGIN ; Filling the structure of the O STELLAR POPULATION(S)
        
                    
            FOR k=0L,counto-1 DO BEGIN 
                
                IF countindo3IA+ NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'O3IA+_stellar_population'
                    IF countindo3IA+_1 NE 0 THEN comp_pop(k+i).radius = (val(indo3IA+_1))(0) ELSE comp_pop(k+i).radius =  ;(cm,cgs)
                    IF countindo3IA+_2 NE 0 THEN comp_pop(k+i).temperature = (val(indo3IA+_2))(0) ELSE comp_pop(k+i).temperature =  ;(K)
                    IF countindo3IA+_3 NE 0 THEN comp_pop(k+i).distance = (val(indo3IA+_3))(0) ELSE comp_pop(k+i).distance =  ; should be lower limited in the general procedure because this is the average distance between two stars
                    IF countindo3IA+_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indo3IA+_4))(0) ELSE comp_pop(k+i).amplitude =  ; is this a dilution factor?
                    IF countindo3IA+_5 NE 0 THEN comp_pop(k+i).nstars = (val(indo3IA+_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1 
                ENDIF
                
                IF countindo3IA NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'O3IA_stellar_population'
                    IF countindo3IA_1 NE 0 THEN comp_pop(k+i).radius = (val(indo3IA_1))(0) ELSE comp_pop(k+i).radius =  ;(cm,cgs)
                    IF countindo3IA_2 NE 0 THEN comp_pop(k+i).temperature = (val(indo3IA_2))(0) ELSE comp_pop(k+i).temperature =  ;(K)
                    IF countindo3IA_3 NE 0 THEN comp_pop(k+i).distance = (val(indo3IA_3))(0) ELSE comp_pop(k+i).distance =  ; should be lower limited in the general procedure because this is the average distance between two stars
                    IF countindo3IA_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indo3IA_4))(0) ELSE comp_pop(k+i).amplitude =  ; is this a dilution factor?
                    IF countindo3IA_5 NE 0 THEN comp_pop(k+i).nstars = (val(indo3IA_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1 
                ENDIF
                
                IF countindo3IAB NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'O3IAB_stellar_population'
                    IF countindo3IAB_1 NE 0 THEN comp_pop(k+i).radius = (val(indo3IAB_1))(0) ELSE comp_pop(k+i).radius =  ;(cm,cgs)
                    IF countindo3IAB_2 NE 0 THEN comp_pop(k+i).temperature = (val(indo3IAB_2))(0) ELSE comp_pop(k+i).temperature =  ;(K)
                    IF countindo3IAB_3 NE 0 THEN comp_pop(k+i).distance = (val(indo3IAB_3))(0) ELSE comp_pop(k+i).distance =  ; should be lower limited in the general procedure because this is the average distance between two stars
                    IF countindo3IAB_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indo3IAB_4))(0) ELSE comp_pop(k+i).amplitude =  ; is this a dilution factor?
                    IF countindo3IAB_5 NE 0 THEN comp_pop(k+i).nstars = (val(indo3IAB_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1 
                ENDIF
                
                IF countindo3IB NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'O3IB_stellar_population'
                    IF countindo3IB_1 NE 0 THEN comp_pop(k+i).radius = (val(indo3IB_1))(0) ELSE comp_pop(k+i).radius =  ;(cm,cgs)
                    IF countindo3IB_2 NE 0 THEN comp_pop(k+i).temperature = (val(indo3IB_2))(0) ELSE comp_pop(k+i).temperature =  ;(K)
                    IF countindo3IB_3 NE 0 THEN comp_pop(k+i).distance = (val(indo3IB_3))(0) ELSE comp_pop(k+i).distance =  ; should be lower limited in the general procedure because this is the average distance between two stars
                    IF countindo3IB_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indo3IB_4))(0) ELSE comp_pop(k+i).amplitude =  ; is this a dilution factor?
                    IF countindo3IB_5 NE 0 THEN comp_pop(k+i).nstars = (val(indo3IB_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1 
                ENDIF
                
                IF countindo3II NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'O3II_stellar_population'
                    IF countindo3II_1 NE 0 THEN comp_pop(k+i).radius = (val(indo3II_1))(0) ELSE comp_pop(k+i).radius =  ;(cm,cgs)
                    IF countindo3II_2 NE 0 THEN comp_pop(k+i).temperature = (val(indo3II_2))(0) ELSE comp_pop(k+i).temperature =  ;(K)
                    IF countindo3II_3 NE 0 THEN comp_pop(k+i).distance = (val(indo3II_3))(0) ELSE comp_pop(k+i).distance =  ; should be lower limited in the general procedure because this is the average distance between two stars
                    IF countindo3II_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indo3II_4))(0) ELSE comp_pop(k+i).amplitude =  ; is this a dilution factor?
                    IF countindo3II_5 NE 0 THEN comp_pop(k+i).nstars = (val(indo3II_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1 
                ENDIF
                
                
                IF countindo3III NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'O3III_stellar_population'
                    IF countindo3III_1 NE 0 THEN comp_pop(k+i).radius = (val(indo3III_1))(0) ELSE comp_pop(k+i).radius =  ;(cm,cgs)
                    IF countindo3III_2 NE 0 THEN comp_pop(k+i).temperature = (val(indo3III_2))(0) ELSE comp_pop(k+i).temperature =  ;(K)
                    IF countindo3III_3 NE 0 THEN comp_pop(k+i).distance = (val(indo3III_3))(0) ELSE comp_pop(k+i).distance =  ; should be lower limited in the general procedure because this is the average distance between two stars
                    IF countindo3III_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indo3III_4))(0) ELSE comp_pop(k+i).amplitude =  ; is this a dilution factor?
                    IF countindo3III_5 NE 0 THEN comp_pop(k+i).nstars = (val(indo3III_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1 
                ENDIF
                
                IF countindo3IV NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'O3IV_stellar_population'
                    IF countindo3IV_1 NE 0 THEN comp_pop(k+i).radius = (val(indo3IV_1))(0) ELSE comp_pop(k+i).radius =  ;(cm,cgs)
                    IF countindo3IV_2 NE 0 THEN comp_pop(k+i).temperature = (val(indo3IV_2))(0) ELSE comp_pop(k+i).temperature =  ;(K)
                    IF countindo3IV_3 NE 0 THEN comp_pop(k+i).distance = (val(indo3IV_3))(0) ELSE comp_pop(k+i).distance =  ; should be lower limited in the general procedure because this is the average distance between two stars
                    IF countindo3IV_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indo3IV_4))(0) ELSE comp_pop(k+i).amplitude =  ; is this a dilution factor?
                    IF countindo3IV_5 NE 0 THEN comp_pop(k+i).nstars = (val(indo3IV_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1 
                ENDIF
                
                
                IF countindo3V NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'O3V_stellar_population'
                    IF countindo3V_1 NE 0 THEN comp_pop(k+i).radius = (val(indo3V_1))(0) ELSE comp_pop(k+i).radius = 15.0*rsun2cm ;(cm,cgs)
                    IF countindo3V_2 NE 0 THEN comp_pop(k+i).temperature = (val(indo3V_2))(0) ELSE comp_pop(k+i).temperature = 44.9e3 ;(K)
                    IF countindo3V_3 NE 0 THEN comp_pop(k+i).distance = (val(indo3V_3))(0) ELSE comp_pop(k+i).distance = 10.0 ; should be lower limited in the general procedure because this is the average distance between two stars
                    IF countindo3V_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indo3V_4))(0) ELSE comp_pop(k+i).amplitude = 1.0 ; is this a dilution factor?
                    IF countindo3V_5 NE 0 THEN comp_pop(k+i).nstars = (val(indo3V_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1 
                ENDIF
                
                IF countindo3VI NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'O3VI_stellar_population'
                    IF countindo3VI_1 NE 0 THEN comp_pop(k+i).radius = (val(indo3VI_1))(0) ELSE comp_pop(k+i).radius =  ;(cm,cgs)
                    IF countindo3VI_2 NE 0 THEN comp_pop(k+i).temperature = (val(indo3VI_2))(0) ELSE comp_pop(k+i).temperature =  ;(K)
                    IF countindo3VI_3 NE 0 THEN comp_pop(k+i).distance = (val(indo3VI_3))(0) ELSE comp_pop(k+i).distance =  ; should be lower limited in the general procedure because this is the average distance between two stars
                    IF countindo3VI_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indo3VI_4))(0) ELSE comp_pop(k+i).amplitude =  ; is this a dilution factor?
                    IF countindo3VI_5 NE 0 THEN comp_pop(k+i).nstars = (val(indo3VI_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1 
                ENDIF
                
                IF countindo3VII NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'O3VII_stellar_population'
                    IF countindo3VII_1 NE 0 THEN comp_pop(k+i).radius = (val(indo3VII_1))(0) ELSE comp_pop(k+i).radius =  ;(cm,cgs)
                    IF countindo3VII_2 NE 0 THEN comp_pop(k+i).temperature = (val(indo3VII_2))(0) ELSE comp_pop(k+i).temperature =  ;(K)
                    IF countindo3VII_3 NE 0 THEN comp_pop(k+i).distance = (val(indo3VII_3))(0) ELSE comp_pop(k+i).distance =  ; should be lower limited in the general procedure because this is the average distance between two stars
                    IF countindo3VII_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indo3VII_4))(0) ELSE comp_pop(k+i).amplitude =  ; is this a dilution factor?
                    IF countindo3VII_5 NE 0 THEN comp_pop(k+i).nstars = (val(indo3VII_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1 
                ENDIF
                
                ;==========================
                
                
                IF countindo4IA+ NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'O4IA+_stellar_population'
                    IF countindo4IA+_1 NE 0 THEN comp_pop(k+i).radius = (val(indo4IA+_1))(0) ELSE comp_pop(k+i).radius =
                    IF countindo4IA+_2 NE 0 THEN comp_pop(k+i).temperature = (val(indo4IA+_2))(0) ELSE comp_pop(k+i).temperature = 
                    IF countindo4IA+_3 NE 0 THEN comp_pop(k+i).distance = (val(indo4IA+_3))(0) ELSE comp_pop(k+i).distance = 
                    IF countindo4IA+_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indo4IA+_4))(0) ELSE comp_pop(k+i).amplitude = 
                    IF countindo4IA+_5 NE 0 THEN comp_pop(k+i).nstars = (val(indo4IA+_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1      
                ENDIF
                
                
                IF countindo4IA NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'O4IA_stellar_population'
                    IF countindo4IA_1 NE 0 THEN comp_pop(k+i).radius = (val(indo4IA_1))(0) ELSE comp_pop(k+i).radius =
                    IF countindo4IA_2 NE 0 THEN comp_pop(k+i).temperature = (val(indo4IA_2))(0) ELSE comp_pop(k+i).temperature = 
                    IF countindo4IA_3 NE 0 THEN comp_pop(k+i).distance = (val(indo4IA_3))(0) ELSE comp_pop(k+i).distance = 
                    IF countindo4IA_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indo4IA_4))(0) ELSE comp_pop(k+i).amplitude = 
                    IF countindo4IA_5 NE 0 THEN comp_pop(k+i).nstars = (val(indo4IA_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1      
                ENDIF
                
                
                IF countindo4IAB NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'O4IAB_stellar_population'
                    IF countindo4IAB_1 NE 0 THEN comp_pop(k+i).radius = (val(indo4IAB_1))(0) ELSE comp_pop(k+i).radius =
                    IF countindo4IAB_2 NE 0 THEN comp_pop(k+i).temperature = (val(indo4IAB_2))(0) ELSE comp_pop(k+i).temperature = 
                    IF countindo4IAB_3 NE 0 THEN comp_pop(k+i).distance = (val(indo4IAB_3))(0) ELSE comp_pop(k+i).distance = 
                    IF countindo4IAB_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indo4IAB_4))(0) ELSE comp_pop(k+i).amplitude = 
                    IF countindo4IAB_5 NE 0 THEN comp_pop(k+i).nstars = (val(indo4IAB_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1      
                ENDIF
                
                
                IF countindo4IB NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'O4IB_stellar_population'
                    IF countindo4IB_1 NE 0 THEN comp_pop(k+i).radius = (val(indo4IB_1))(0) ELSE comp_pop(k+i).radius =
                    IF countindo4IB_2 NE 0 THEN comp_pop(k+i).temperature = (val(indo4IB_2))(0) ELSE comp_pop(k+i).temperature = 
                    IF countindo4IB_3 NE 0 THEN comp_pop(k+i).distance = (val(indo4IB_3))(0) ELSE comp_pop(k+i).distance = 
                    IF countindo4IB_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indo4IB_4))(0) ELSE comp_pop(k+i).amplitude = 
                    IF countindo4IB_5 NE 0 THEN comp_pop(k+i).nstars = (val(indo4IB_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1      
                ENDIF
                
                IF countindo4II NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'O4II_stellar_population'
                    IF countindo4II_1 NE 0 THEN comp_pop(k+i).radius = (val(indo4II_1))(0) ELSE comp_pop(k+i).radius =
                    IF countindo4II_2 NE 0 THEN comp_pop(k+i).temperature = (val(indo4II_2))(0) ELSE comp_pop(k+i).temperature = 
                    IF countindo4II_3 NE 0 THEN comp_pop(k+i).distance = (val(indo4II_3))(0) ELSE comp_pop(k+i).distance = 
                    IF countindo4II_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indo4II_4))(0) ELSE comp_pop(k+i).amplitude = 
                    IF countindo4II_5 NE 0 THEN comp_pop(k+i).nstars = (val(indo4II_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1      
                ENDIF
                
                
                IF countindo4III NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'O4III_stellar_population'
                    IF countindo4III_1 NE 0 THEN comp_pop(k+i).radius = (val(indo4III_1))(0) ELSE comp_pop(k+i).radius =
                    IF countindo4III_2 NE 0 THEN comp_pop(k+i).temperature = (val(indo4III_2))(0) ELSE comp_pop(k+i).temperature = 
                    IF countindo4III_3 NE 0 THEN comp_pop(k+i).distance = (val(indo4III_3))(0) ELSE comp_pop(k+i).distance = 
                    IF countindo4III_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indo4III_4))(0) ELSE comp_pop(k+i).amplitude = 
                    IF countindo4III_5 NE 0 THEN comp_pop(k+i).nstars = (val(indo4III_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1      
                ENDIF
                
                
                IF countindo4IV NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'O4IV_stellar_population'
                    IF countindo4IV_1 NE 0 THEN comp_pop(k+i).radius = (val(indo4IV_1))(0) ELSE comp_pop(k+i).radius =
                    IF countindo4IV_2 NE 0 THEN comp_pop(k+i).temperature = (val(indo4IV_2))(0) ELSE comp_pop(k+i).temperature = 
                    IF countindo4IV_3 NE 0 THEN comp_pop(k+i).distance = (val(indo4IV_3))(0) ELSE comp_pop(k+i).distance = 
                    IF countindo4IV_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indo4IV_4))(0) ELSE comp_pop(k+i).amplitude = 
                    IF countindo4IV_5 NE 0 THEN comp_pop(k+i).nstars = (val(indo4IV_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1      
                ENDIF
                
                
                IF countindo4V NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'O4V_stellar_population'
                    IF countindo4V_1 NE 0 THEN comp_pop(k+i).radius = (val(indo4V_1))(0) ELSE comp_pop(k+i).radius = 13.43*rsun2cm
                    IF countindo4V_2 NE 0 THEN comp_pop(k+i).temperature = (val(indo4V_2))(0) ELSE comp_pop(k+i).temperature = 42.9e3
                    IF countindo4V_3 NE 0 THEN comp_pop(k+i).distance = (val(indo4V_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindo4V_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indo4V_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindo4V_5 NE 0 THEN comp_pop(k+i).nstars = (val(indo4V_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1      
                ENDIF
                
                
                IF countindo4VI NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'O4VI_stellar_population'
                    IF countindo4VI_1 NE 0 THEN comp_pop(k+i).radius = (val(indo4VI_1))(0) ELSE comp_pop(k+i).radius =
                    IF countindo4VI_2 NE 0 THEN comp_pop(k+i).temperature = (val(indo4VI_2))(0) ELSE comp_pop(k+i).temperature = 
                    IF countindo4VI_3 NE 0 THEN comp_pop(k+i).distance = (val(indo4VI_3))(0) ELSE comp_pop(k+i).distance = 
                    IF countindo4VI_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indo4VI_4))(0) ELSE comp_pop(k+i).amplitude = 
                    IF countindo4VI_5 NE 0 THEN comp_pop(k+i).nstars = (val(indo4VI_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1      
                ENDIF
                
                IF countindo4VII NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'O4VII_stellar_population'
                    IF countindo4VII_1 NE 0 THEN comp_pop(k+i).radius = (val(indo4VII_1))(0) ELSE comp_pop(k+i).radius =
                    IF countindo4VII_2 NE 0 THEN comp_pop(k+i).temperature = (val(indo4VII_2))(0) ELSE comp_pop(k+i).temperature = 
                    IF countindo4VII_3 NE 0 THEN comp_pop(k+i).distance = (val(indo4VII_3))(0) ELSE comp_pop(k+i).distance = 
                    IF countindo4VII_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indo4VII_4))(0) ELSE comp_pop(k+i).amplitude = 
                    IF countindo4VII_5 NE 0 THEN comp_pop(k+i).nstars = (val(indo4VII_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1      
                ENDIF
                
                ;==================================================
                
                
                IF countindoIA+ NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'O5IA+_stellar_population'
                    IF countindo5IA+_1 NE 0 THEN comp_pop(k+i).radius = (val(indo5IA+_1))(0) ELSE comp_pop(k+i).radius = 
                    IF countindo5IA+_2 NE 0 THEN comp_pop(k+i).temperature = (val(indo5IA+_2))(0) ELSE comp_pop(k+i).temperature = 
                    IF countindo5IA+_3 NE 0 THEN comp_pop(k+i).distance = (val(indo5IA+_3))(0) ELSE comp_pop(k+i).distance = 
                    IF countindo5IA+_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indo5IA+_4))(0) ELSE comp_pop(k+i).amplitude = 
                    IF countindo5IA+_5 NE 0 THEN comp_pop(k+i).nstars = (val(indo5IA+_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1          
                ENDIF
                
                
                
                
                
                IF countindo5V NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'O5V_stellar_population'
                    IF countindo5V_1 NE 0 THEN comp_pop(k+i).radius = (val(indo5V_1))(0) ELSE comp_pop(k+i).radius = 12*rsun2cm
                    IF countindo5V_2 NE 0 THEN comp_pop(k+i).temperature = (val(indo5V_2))(0) ELSE comp_pop(k+i).temperature = 41.4e3
                    IF countindo5V_3 NE 0 THEN comp_pop(k+i).distance = (val(indo5V_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindo5V_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indo5V_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindo5V_5 NE 0 THEN comp_pop(k+i).nstars = (val(indo5V_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1          
                ENDIF
        
                
                
                IF countindo6 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'O6V_stellar_population'
                    IF countindo6_1 NE 0 THEN comp_pop(k+i).radius = (val(indo6_1))(0) ELSE comp_pop(k+i).radius = 10.71*rsun2cm
                    IF countindo6_2 NE 0 THEN comp_pop(k+i).temperature = (val(indo6_2))(0) ELSE comp_pop(k+i).temperature = 39.5e3
                    IF countindo6_3 NE 0 THEN comp_pop(k+i).distance = (val(indo6_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindo6_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indo6_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindo6_5 NE 0 THEN comp_pop(k+i).nstars = (val(indo6_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1        
                ENDIF
        
                
                IF countindo7 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'O7V_stellar_population'
                    IF countindo7_1 NE 0 THEN comp_pop(k+i).radius = (val(indo7_1))(0) ELSE comp_pop(k+i).radius = 9.52*rsun2cm
                    IF countindo7_2 NE 0 THEN comp_pop(k+i).temperature = (val(indo7_2))(0) ELSE comp_pop(k+i).temperature = 37.1e3
                    IF countindo7_3 NE 0 THEN comp_pop(k+i).distance = (val(indo7_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindo7_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indo7_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindo7_5 NE 0 THEN comp_pop(k+i).nstars = (val(indo7_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1          
                ENDIF
                    
                
                IF countindo8 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'O8V_stellar_population'
                    IF countindo8_1 NE 0 THEN comp_pop(k+i).radius = (val(indo8_1))(0) ELSE comp_pop(k+i).radius = 8.5*rsun2cm
                    IF countindo8_2 NE 0 THEN comp_pop(k+i).temperature = (val(indo8_2))(0) ELSE comp_pop(k+i).temperature = 35.1e3
                    IF countindo8_3 NE 0 THEN comp_pop(k+i).distance = (val(indo8_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindo8_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indo8_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindo8_5 NE 0 THEN comp_pop(k+i).nstars = (val(indo8_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1         
                ENDIF
        
                
                IF countindo9 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'O9V_stellar_population'
                    IF countindo9_1 NE 0 THEN comp_pop(k+i).radius = (val(indo9_1))(0) ELSE comp_pop(k+i).radius = 7.51*rsun2cm
                    IF countindo9_2 NE 0 THEN comp_pop(k+i).temperature = (val(indo9_2))(0) ELSE comp_pop(k+i).temperature = 33.3e3
                    IF countindo9_3 NE 0 THEN comp_pop(k+i).distance = (val(indo9_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindo9_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indo9_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindo9_5 NE 0 THEN comp_pop(k+i).nstars = (val(indo9_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1         
                ENDIF
                        
                    
            ENDFOR
                    
            counto=0. 
        i+=k-1
        ENDIF
        

                    
    ;==============================================================================================
                
                        
        IF countb NE 0 THEN BEGIN ; Filling the structure of the B STELLAR POPULATION(S)
                    
            FOR k=0L,countb-1 DO BEGIN
                
                IF countindb0 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'B0V_stellar_population'
                    IF countindb0_1 NE 0 THEN comp_pop(k+i).radius = (val(indb0_1))(0) ELSE comp_pop(k+i).radius = 7.16*rsun2cm
                    IF countindb0_2 NE 0 THEN comp_pop(k+i).temperature = (val(indb0_2))(0) ELSE comp_pop(k+i).temperature = 31.4e3
                    IF countindb0_3 NE 0 THEN comp_pop(k+i).distance = (val(indb0_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindb0_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indb0_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindb0_5 NE 0 THEN comp_pop(k+i).nstars = (val(indb0_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1         
                ENDIF
                
                
                
                IF countindb1 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'B1V_stellar_population'
                    IF countindb1_1 NE 0 THEN comp_pop(k+i).radius = (val(indb1_1))(0) ELSE comp_pop(k+i).radius = 5.71*rsun2cm
                    IF countindb1_2 NE 0 THEN comp_pop(k+i).temperature = (val(indb1_2))(0) ELSE comp_pop(k+i).temperature = 26.0e3 
                    IF countindb1_3 NE 0 THEN comp_pop(k+i).distance = (val(indb1_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindb1_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indb1_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindb1_5 NE 0 THEN comp_pop(k+i).nstars = (val(indb1_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1         
                ENDIF
                
                
                
                IF countindb2 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'B2V_stellar_population'
                    IF countindb2_1 NE 0 THEN comp_pop(k+i).radius = (val(indb2_1))(0) ELSE comp_pop(k+i).radius = 4.06*rsun2cm
                    IF countindb2_2 NE 0 THEN comp_pop(k+i).temperature = (val(indb2_2))(0) ELSE comp_pop(k+i).temperature = 20.6e3 
                    IF countindb2_3 NE 0 THEN comp_pop(k+i).distance = (val(indb2_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindb2_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indb2_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindb2_5 NE 0 THEN comp_pop(k+i).nstars = (val(indb2_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1          
                ENDIF
                
                
                
                IF countindb3 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'B3V_stellar_population'
                    IF countindb3_1 NE 0 THEN comp_pop(k+i).radius = (val(indb3_1))(0) ELSE comp_pop(k+i).radius = 3.61*rsun2cm
                    IF countindb3_2 NE 0 THEN comp_pop(k+i).temperature = (val(indb3_2))(0) ELSE comp_pop(k+i).temperature = 17.0e3
                    IF countindb3_3 NE 0 THEN comp_pop(k+i).distance = (val(indb3_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindb3_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indb3_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindb3_5 NE 0 THEN comp_pop(k+i).nstars = (val(indb3_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1         
                ENDIF
            
                IF countindb4 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'B4V_stellar_population'
                    IF countindb4_1 NE 0 THEN comp_pop(k+i).radius = (val(indb4_1))(0) ELSE comp_pop(k+i).radius = 3.46*rsun2cm
                    IF countindb4_2 NE 0 THEN comp_pop(k+i).temperature = (val(indb4_2))(0) ELSE comp_pop(k+i).temperature = 16.4e3 
                    IF countindb4_3 NE 0 THEN comp_pop(k+i).distance = (val(indb4_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindb4_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indb4_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindb4_5 NE 0 THEN comp_pop(k+i).nstars = (val(indb4_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1       
                ENDIF
                
                
                IF countindb5 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'B5V_stellar_population'
                    IF countindb5_1 NE 0 THEN comp_pop(k+i).radius = (val(indb5_1))(0) ELSE comp_pop(k+i).radius = 3.36*rsun2cm
                    IF countindb5_2 NE 0 THEN comp_pop(k+i).temperature = (val(indb5_2))(0) ELSE comp_pop(k+i).temperature = 15.7e3 
                    IF countindb5_3 NE 0 THEN comp_pop(k+i).distance = (val(indb5_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindb5_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indb5_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindb5_5 NE 0 THEN comp_pop(k+i).nstars = (val(indb5_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1         
                ENDIF
        
                
                IF countindb6 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'B6V_stellar_population'
                    IF countindb6_1 NE 0 THEN comp_pop(k+i).radius = (val(indb6_1))(0) ELSE comp_pop(k+i).radius = 3.27*rsun2cm
                    IF countindb6_2 NE 0 THEN comp_pop(k+i).temperature = (val(indb6_2))(0) ELSE comp_pop(k+i).temperature = 14.5e3 
                    IF countindb6_3 NE 0 THEN comp_pop(k+i).distance = (val(indb6_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindb6_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indb6_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindb6_5 NE 0 THEN comp_pop(k+i).nstars = (val(indb6_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1        
                ENDIF
        
                
                IF countindb7 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'B7V_stellar_population'
                    IF countindb7_1 NE 0 THEN comp_pop(k+i).radius = (val(indb7_1))(0) ELSE comp_pop(k+i).radius = 2.94*rsun2cm
                    IF countindb7_2 NE 0 THEN comp_pop(k+i).temperature = (val(indb7_2))(0) ELSE comp_pop(k+i).temperature = 14.0e3 
                    IF countindb7_3 NE 0 THEN comp_pop(k+i).distance = (val(indb7_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindb7_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indb7_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindb7_5 NE 0 THEN comp_pop(k+i).nstars = (val(indb7_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1          
                ENDIF
                    
                
                IF countindb8 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'B8V_stellar_population'
                    IF countindb8_1 NE 0 THEN comp_pop(k+i).radius = (val(indb8_1))(0) ELSE comp_pop(k+i).radius = 2.86*rsun2cm
                    IF countindb8_2 NE 0 THEN comp_pop(k+i).temperature = (val(indb8_2))(0) ELSE comp_pop(k+i).temperature = 12.3e3 
                    IF countindb8_3 NE 0 THEN comp_pop(k+i).distance = (val(indb8_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindb8_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indb8_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindb8_5 NE 0 THEN comp_pop(k+i).nstars = (val(indb8_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1         
                ENDIF
        
                
                IF countindb9 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'B9V_stellar_population'
                    IF countindb9_1 NE 0 THEN comp_pop(k+i).radius = (val(indb9_1))(0) ELSE comp_pop(k+i).radius = 2.49*rsun2cm
                    IF countindb9_2 NE 0 THEN comp_pop(k+i).temperature = (val(indb9_2))(0) ELSE comp_pop(k+i).temperature = 10.7e3 
                    IF countindb9_3 NE 0 THEN comp_pop(k+i).distance = (val(indb9_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindb9_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indb9_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindb9_5 NE 0 THEN comp_pop(k+i).nstars = (val(indb9_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1          
                ENDIF
                        
                    
            ENDFOR
                    
            countb=0. 
  
        i+=k-1
        ENDIF 
                                               
    ;==============================================================================================
                        
        IF counta NE 0 THEN BEGIN ; Filling the structure of the A STELLAR POPULATION(S)
                    
            FOR k=0L+i,counta-1+i DO BEGIN
                
                IF countinda0 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'A0V_stellar_population'
                    IF countinda0_1 NE 0 THEN comp_pop(k+i).radius = (val(inda0_1))(0) ELSE comp_pop(k+i).radius = 2.193*rsun2cm
                    IF countinda0_2 NE 0 THEN comp_pop(k+i).temperature = (val(inda0_2))(0) ELSE comp_pop(k+i).temperature = 9.7e3
                    IF countinda0_3 NE 0 THEN comp_pop(k+i).distance = (val(inda0_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countinda0_4 NE 0 THEN comp_pop(k+i).amplitude = (val(inda0_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countinda0_5 NE 0 THEN comp_pop(k+i).nstars = (val(inda0_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1          
                ENDIF
                
                
                
                IF countinda1 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'A1V_stellar_population'
                    IF countinda1_1 NE 0 THEN comp_pop(k+i).radius = (val(inda1_1))(0) ELSE comp_pop(k+i).radius = 2.136*rsun2cm
                    IF countinda1_2 NE 0 THEN comp_pop(k+i).temperature = (val(inda1_2))(0) ELSE comp_pop(k+i).temperature = 9.3e3
                    IF countinda1_3 NE 0 THEN comp_pop(k+i).distance = (val(inda1_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countinda1_4 NE 0 THEN comp_pop(k+i).amplitude = (val(inda1_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countinda1_5 NE 0 THEN comp_pop(k+i).nstars = (val(inda1_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1        
                ENDIF
                
                
                
                IF countinda2 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'A2V_stellar_population'
                    IF countinda2_1 NE 0 THEN comp_pop(k+i).radius = (val(inda2_1))(0) ELSE comp_pop(k+i).radius = 2.117*rsun2cm
                    IF countinda2_2 NE 0 THEN comp_pop(k+i).temperature = (val(inda2_2))(0) ELSE comp_pop(k+i).temperature = 8.8e3
                    IF countinda2_3 NE 0 THEN comp_pop(k+i).distance = (val(inda2_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countinda2_4 NE 0 THEN comp_pop(k+i).amplitude = (val(inda2_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countinda2_5 NE 0 THEN comp_pop(k+i).nstars = (val(inda2_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1        
                ENDIF
                
                
                
                IF countinda3 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'A3V_stellar_population'
                    IF countinda3_1 NE 0 THEN comp_pop(k+i).radius = (val(inda3_1))(0) ELSE comp_pop(k+i).radius = 1.861*rsun2cm
                    IF countinda3_2 NE 0 THEN comp_pop(k+i).temperature = (val(inda3_2))(0) ELSE comp_pop(k+i).temperature = 8.6e3
                    IF countinda3_3 NE 0 THEN comp_pop(k+i).distance = (val(inda3_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countinda3_4 NE 0 THEN comp_pop(k+i).amplitude = (val(inda3_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countinda3_5 NE 0 THEN comp_pop(k+i).nstars = (val(inda3_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1          
                ENDIF
            
                IF countinda4 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'A4V_stellar_population'
                    IF countinda4_1 NE 0 THEN comp_pop(k+i).radius = (val(inda4_1))(0) ELSE comp_pop(k+i).radius = 1.794*rsun2cm
                    IF countinda4_2 NE 0 THEN comp_pop(k+i).temperature = (val(inda4_2))(0) ELSE comp_pop(k+i).temperature = 8.25e3
                    IF countinda4_3 NE 0 THEN comp_pop(k+i).distance = (val(inda4_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countinda4_4 NE 0 THEN comp_pop(k+i).amplitude = (val(inda4_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countinda4_5 NE 0 THEN comp_pop(k+i).nstars = (val(inda4_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1         
                ENDIF
                
                
                IF countinda5 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'A5V_stellar_population'
                    IF countinda5_1 NE 0 THEN comp_pop(k+i).radius = (val(inda5_1))(0) ELSE comp_pop(k+i).radius = 1.785*rsun2cm
                    IF countinda5_2 NE 0 THEN comp_pop(k+i).temperature = (val(inda5_2))(0) ELSE comp_pop(k+i).temperature = 8.1e3
                    IF countinda5_3 NE 0 THEN comp_pop(k+i).distance = (val(inda5_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countinda5_4 NE 0 THEN comp_pop(k+i).amplitude = (val(inda5_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countinda5_5 NE 0 THEN comp_pop(k+i).nstars = (val(inda5_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1          
                ENDIF
        
                
                IF countinda6 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'A6V_stellar_population'
                    IF countinda6_1 NE 0 THEN comp_pop(k+i).radius = (val(inda6_1))(0) ELSE comp_pop(k+i).radius = 1.775*rsun2cm
                    IF countinda6_2 NE 0 THEN comp_pop(k+i).temperature = (val(inda6_2))(0) ELSE comp_pop(k+i).temperature = 7.91e3 
                    IF countinda6_3 NE 0 THEN comp_pop(k+i).distance = (val(inda6_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countinda6_4 NE 0 THEN comp_pop(k+i).amplitude = (val(inda6_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countinda6_5 NE 0 THEN comp_pop(k+i).nstars = (val(inda6_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1        
                ENDIF
        
                
                IF countinda7 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'A7V_stellar_population'
                    IF countinda7_1 NE 0 THEN comp_pop(k+i).radius = (val(inda7_1))(0) ELSE comp_pop(k+i).radius = 1.75*rsun2cm
                    IF countinda7_2 NE 0 THEN comp_pop(k+i).temperature = (val(inda7_2))(0) ELSE comp_pop(k+i).temperature = 7.76e3 
                    IF countinda7_3 NE 0 THEN comp_pop(k+i).distance = (val(inda7_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countinda7_4 NE 0 THEN comp_pop(k+i).amplitude = (val(inda7_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countinda7_5 NE 0 THEN comp_pop(k+i).nstars = (val(inda7_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1         
                ENDIF
                    
                
                IF countinda8 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'A8V_stellar_population'
                    IF countinda8_1 NE 0 THEN comp_pop(k+i).radius = (val(inda8_1))(0) ELSE comp_pop(k+i).radius = 1.747*rsun2cm
                    IF countinda8_2 NE 0 THEN comp_pop(k+i).temperature = (val(inda8_2))(0) ELSE comp_pop(k+i).temperature = 7.590e3
                    IF countinda8_3 NE 0 THEN comp_pop(k+i).distance = (val(inda8_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countinda8_4 NE 0 THEN comp_pop(k+i).amplitude = (val(inda8_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countinda8_5 NE 0 THEN comp_pop(k+i).nstars = (val(inda8_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1        
                ENDIF
        
                
                IF countinda9 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'A9V_stellar_population'
                    IF countinda9_1 NE 0 THEN comp_pop(k+i).radius = (val(inda9_1))(0) ELSE comp_pop(k+i).radius = 1.747*rsun2cm
                    IF countinda9_2 NE 0 THEN comp_pop(k+i).temperature = (val(inda9_2))(0) ELSE comp_pop(k+i).temperature = 7.4e3 
                    IF countinda9_3 NE 0 THEN comp_pop(k+i).distance = (val(inda9_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countinda9_4 NE 0 THEN comp_pop(k+i).amplitude = (val(inda9_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countinda9_5 NE 0 THEN comp_pop(k+i).nstars = (val(inda9_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1       
                ENDIF
                        
                        
            ENDFOR
                        
            counta=0. 
        i+=k-1
        ENDIF
          
                            
    ;==============================================================================================    
                        
                    
        IF countf NE 0 THEN BEGIN ; Filling the structure of the F STELLAR POPULATION(S)
                 
            FOR k=0L+i,countf-1+i DO BEGIN
                
                IF countindf0 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'F0V_stellar_population'
                    IF countindf0_1 NE 0 THEN comp_pop(k+i).radius = (val(indf0_1))(0) ELSE comp_pop(k+i).radius = 1.728*rsun2cm
                    IF countindf0_2 NE 0 THEN comp_pop(k+i).temperature = (val(indf0_2))(0) ELSE comp_pop(k+i).temperature = 7.22e3
                    IF countindf0_3 NE 0 THEN comp_pop(k+i).distance = (val(indf0_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindf0_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indf0_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindf0_5 NE 0 THEN comp_pop(k+i).nstars = (val(indf0_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1        
                ENDIF
                
                
                
                IF countindf1 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'F1V_stellar_population'
                    IF countindf1_1 NE 0 THEN comp_pop(k+i).radius = (val(indf1_1))(0) ELSE comp_pop(k+i).radius = 1.679*rsun2cm
                    IF countindf1_2 NE 0 THEN comp_pop(k+i).temperature = (val(indf1_2))(0) ELSE comp_pop(k+i).temperature = 7.02e3
                    IF countindf1_3 NE 0 THEN comp_pop(k+i).distance = (val(indf1_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindf1_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indf1_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindf1_5 NE 0 THEN comp_pop(k+i).nstars = (val(indf1_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1          
                ENDIF
                
                
                
                IF countindf2 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'F2V_stellar_population'
                    IF countindf2_1 NE 0 THEN comp_pop(k+i).radius = (val(indf2_1))(0) ELSE comp_pop(k+i).radius = 1.622*rsun2cm
                    IF countindf2_2 NE 0 THEN comp_pop(k+i).temperature = (val(indf2_2))(0) ELSE comp_pop(k+i).temperature = 6.820e3
                    IF countindf2_3 NE 0 THEN comp_pop(k+i).distance = (val(indf2_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindf2_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indf2_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindf2_5 NE 0 THEN comp_pop(k+i).nstars = (val(indf2_5))(0) ELSE comp_pop(k+i).nstars =  stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1          
                ENDIF
                
                
                
                IF countindf3 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'F3V_stellar_population'
                    IF countindf3_1 NE 0 THEN comp_pop(k+i).radius = (val(indf3_1))(0) ELSE comp_pop(k+i).radius = 1.578*rsun2cm
                    IF countindf3_2 NE 0 THEN comp_pop(k+i).temperature = (val(indf3_2))(0) ELSE comp_pop(k+i).temperature = 6.75e3
                    IF countindf3_3 NE 0 THEN comp_pop(k+i).distance = (val(indf3_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindf3_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indf3_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindf3_5 NE 0 THEN comp_pop(k+i).nstars = (val(indf3_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1          
                ENDIF
            
                IF countindf4 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'F4V_stellar_population'
                    IF countindf4_1 NE 0 THEN comp_pop(k+i).radius = (val(indf4_1))(0) ELSE comp_pop(k+i).radius = 1.533*rsun2cm
                    IF countindf4_2 NE 0 THEN comp_pop(k+i).temperature = (val(indf4_2))(0) ELSE comp_pop(k+i).temperature = 6.67e3
                    IF countindf4_3 NE 0 THEN comp_pop(k+i).distance = (val(indf4_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindf4_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indf4_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindf4_5 NE 0 THEN comp_pop(k+i).nstars = (val(indf4_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1          
                ENDIF
                
                
                IF countindf5 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'F5V_stellar_population'
                    IF countindf5_1 NE 0 THEN comp_pop(k+i).radius = (val(indf5_1))(0) ELSE comp_pop(k+i).radius = 1.473*rsun2cm
                    IF countindf5_2 NE 0 THEN comp_pop(k+i).temperature = (val(indf5_2))(0) ELSE comp_pop(k+i).temperature = 6.55e3
                    IF countindf5_3 NE 0 THEN comp_pop(k+i).distance = (val(indf5_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindf5_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indf5_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindf5_5 NE 0 THEN comp_pop(k+i).nstars = (val(indf5_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1          
                ENDIF
        
                
                IF countindf6 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'F6V_stellar_population'
                    IF countindf6_1 NE 0 THEN comp_pop(k+i).radius = (val(indf6_1))(0) ELSE comp_pop(k+i).radius = 1.359*rsun2cm
                    IF countindf6_2 NE 0 THEN comp_pop(k+i).temperature = (val(indf6_2))(0) ELSE comp_pop(k+i).temperature = 6.35e3
                    IF countindf6_3 NE 0 THEN comp_pop(k+i).distance = (val(indf6_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindf6_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indf6_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindf6_5 NE 0 THEN comp_pop(k+i).nstars = (val(indf6_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1           
                ENDIF
        
                
                IF countindf7 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'F7V_stellar_population'
                    IF countindf7_1 NE 0 THEN comp_pop(k+i).radius = (val(indf7_1))(0) ELSE comp_pop(k+i).radius = 1.324*rsun2cm
                    IF countindf7_2 NE 0 THEN comp_pop(k+i).temperature = (val(indf7_2))(0) ELSE comp_pop(k+i).temperature = 6.28e3
                    IF countindf7_3 NE 0 THEN comp_pop(k+i).distance = (val(indf7_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindf7_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indf7_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindf7_5 NE 0 THEN comp_pop(k+i).nstars = (val(indf7_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1           
                ENDIF
                    
                
                IF countindf8 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'F8V_stellar_population'
                    IF countindf8_1 NE 0 THEN comp_pop(k+i).radius = (val(indf8_1))(0) ELSE comp_pop(k+i).radius = 1.221*rsun2cm
                    IF countindf8_2 NE 0 THEN comp_pop(k+i).temperature = (val(indf8_2))(0) ELSE comp_pop(k+i).temperature = 6.18e3
                    IF countindf8_3 NE 0 THEN comp_pop(k+i).distance = (val(indf8_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindf8_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indf8_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindf8_5 NE 0 THEN comp_pop(k+i).nstars = (val(indf8_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1           
                ENDIF
        
                
                IF countindf9 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'F9V_stellar_population'
                    IF countindf9_1 NE 0 THEN comp_pop(k+i).radius = (val(indf9_1))(0) ELSE comp_pop(k+i).radius = 1.167*rsun2cm
                    IF countindf9_2 NE 0 THEN comp_pop(k+i).temperature = (val(indf9_2))(0) ELSE comp_pop(k+i).temperature = 6.05e3
                    IF countindf9_3 NE 0 THEN comp_pop(k+i).distance = (val(indf9_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindf9_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indf9_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindf9_5 NE 0 THEN comp_pop(k+i).nstars = (val(indf9_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1           
                ENDIF
                                    
                                        
            ENDFOR
                                                        
            countf=0.  
        i+=k-1
        ENDIF
         
                                                                    
    ;============================================================================================== 
                            
        IF countg NE 0 THEN BEGIN ; Filling the structure of the G STELLAR POPULATION(S)
                    
            FOR k=0L+i,countg-1+i DO BEGIN
                
                IF countindg0 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'G0V_stellar_population'
                    IF countindg0_1 NE 0 THEN comp_pop(k+i).radius = (val(indg0_1))(0) ELSE comp_pop(k+i).radius = 1.1*rsun2cm
                    IF countindg0_2 NE 0 THEN comp_pop(k+i).temperature = (val(indg0_2))(0) ELSE comp_pop(k+i).temperature = 5.93e3
                    IF countindg0_3 NE 0 THEN comp_pop(k+i).distance = (val(indg0_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindg0_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indg0_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindg0_5 NE 0 THEN comp_pop(k+i).nstars = (val(indg0_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1         
                ENDIF
                
                
                
                IF countindg1 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'G1V_stellar_population'
                    IF countindg1_1 NE 0 THEN comp_pop(k+i).radius = (val(indg1_1))(0) ELSE comp_pop(k+i).radius = 1.06*rsun2cm
                    IF countindg1_2 NE 0 THEN comp_pop(k+i).temperature = (val(indg1_2))(0) ELSE comp_pop(k+i).temperature = 5.86e3 
                    IF countindg1_3 NE 0 THEN comp_pop(k+i).distance = (val(indg1_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindg1_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indg1_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindg1_5 NE 0 THEN comp_pop(k+i).nstars = (val(indg1_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1 
                ENDIF
                
                
                
                IF countindg2 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'G2V_stellar_population'
                    IF countindg2_1 NE 0 THEN comp_pop(k+i).radius = (val(indg2_1))(0) ELSE comp_pop(k+i).radius = 1.012*rsun2cm
                    IF countindg2_2 NE 0 THEN comp_pop(k+i).temperature = (val(indg2_2))(0) ELSE comp_pop(k+i).temperature = 5.77e3
                    IF countindg2_3 NE 0 THEN comp_pop(k+i).distance = (val(indg2_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindg2_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indg2_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindg2_5 NE 0 THEN comp_pop(k+i).nstars = (val(indg2_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1          
                ENDIF
                
                
                
                IF countindg3 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'G3V_stellar_population'
                    IF countindg3_1 NE 0 THEN comp_pop(k+i).radius = (val(indg3_1))(0) ELSE comp_pop(k+i).radius = 1.002*rsun2cm
                    IF countindg3_2 NE 0 THEN comp_pop(k+i).temperature = (val(indg3_2))(0) ELSE comp_pop(k+i).temperature = 5.72e3
                    IF countindg3_3 NE 0 THEN comp_pop(k+i).distance = (val(indg3_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindg3_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indg3_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindg3_5 NE 0 THEN comp_pop(k+i).nstars = (val(indg3_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1  
                ENDIF
            
                IF countindg4 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'G4V_stellar_population'
                    IF countindg4_1 NE 0 THEN comp_pop(k+i).radius = (val(indg4_1))(0) ELSE comp_pop(k+i).radius = 0.991*rsun2cm
                    IF countindg4_2 NE 0 THEN comp_pop(k+i).temperature = (val(indg4_2))(0) ELSE comp_pop(k+i).temperature = 5.68e3
                    IF countindg4_3 NE 0 THEN comp_pop(k+i).distance = (val(indg4_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindg4_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indg4_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindg4_5 NE 0 THEN comp_pop(k+i).nstars = (val(indg4_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1 
                ENDIF
                
                
                IF countindg5 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'G5V_stellar_population'
                    IF countindg5_1 NE 0 THEN comp_pop(k+i).radius = (val(indg5_1))(0) ELSE comp_pop(k+i).radius = 0.977*rsun2cm
                    IF countindg5_2 NE 0 THEN comp_pop(k+i).temperature = (val(indg5_2))(0) ELSE comp_pop(k+i).temperature = 5.66e3
                    IF countindg5_3 NE 0 THEN comp_pop(k+i).distance = (val(indg5_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindg5_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indg5_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindg5_5 NE 0 THEN comp_pop(k+i).nstars = (val(indg5_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1         
                ENDIF
        
                
                IF countindg6 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'G6V_stellar_population'
                    IF countindg6_1 NE 0 THEN comp_pop(k+i).radius = (val(indg6_1))(0) ELSE comp_pop(k+i).radius = 0.949*rsun2cm
                    IF countindg6_2 NE 0 THEN comp_pop(k+i).temperature = (val(indg6_2))(0) ELSE comp_pop(k+i).temperature = 5.6e3
                    IF countindg6_3 NE 0 THEN comp_pop(k+i).distance = (val(indg6_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindg6_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indg6_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindg6_5 NE 0 THEN comp_pop(k+i).nstars = (val(indg6_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1          
                ENDIF
        
                
                IF countindg7 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'G7V_stellar_population'
                    IF countindg7_1 NE 0 THEN comp_pop(k+i).radius = (val(indg7_1))(0) ELSE comp_pop(k+i).radius = 0.927*rsun2cm
                    IF countindg7_2 NE 0 THEN comp_pop(k+i).temperature = (val(indg7_2))(0) ELSE comp_pop(k+i).temperature = 5.55e3
                    IF countindg7_3 NE 0 THEN comp_pop(k+i).distance = (val(indg7_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindg7_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indg7_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindg7_5 NE 0 THEN comp_pop(k+i).nstars = (val(indg7_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1       
                ENDIF
                    
                
                IF countindg8 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'G8V_stellar_population'
                    IF countindg8_1 NE 0 THEN comp_pop(k+i).radius = (val(indg8_1))(0) ELSE comp_pop(k+i).radius = 0.914*rsun2cm
                    IF countindg8_2 NE 0 THEN comp_pop(k+i).temperature = (val(indg8_2))(0) ELSE comp_pop(k+i).temperature = 5.48e3
                    IF countindg8_3 NE 0 THEN comp_pop(k+i).distance = (val(indg8_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindg8_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indg8_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindg8_5 NE 0 THEN comp_pop(k+i).nstars = (val(indg8_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance
                    K+=1   
                ENDIF
        
                
                IF countindg9 NE 0 THEN BEGIN
                    comp_pop(k+i).popid = 'G9V_stellar_population'
                    IF countindg9_1 NE 0 THEN comp_pop(k+i).radius = (val(indg9_1))(0) ELSE comp_pop(k+i).radius = 0.853*rsun2cm
                    IF countindg9_2 NE 0 THEN comp_pop(k+i).temperature = (val(indg9_2))(0) ELSE comp_pop(k+i).temperature = 5.38e3
                    IF countindg9_3 NE 0 THEN comp_pop(k+i).distance = (val(indg9_3))(0) ELSE comp_pop(k+i).distance = 10.0
                    IF countindg9_4 NE 0 THEN comp_pop(k+i).amplitude = (val(indg9_4))(0) ELSE comp_pop(k+i).amplitude = 1.0
                    IF countindg9_5 NE 0 THEN comp_pop(k+i).nstars = (val(indg9_5))(0) ELSE comp_pop(k+i).nstars = stellar_density*(4.*!pi/3)*comp_pop(k+i).distance 
                    K+=1   
                ENDIF
           
            ENDFOR
    
            countg=0.  
        i+=k-1
        ENDIF 
 
    
    ;==============================================================================================    
    
    ENDFOR
      
;============This block creates a composite (9V) stellar population structure for when the function isn't used as a plugin=================== 
ENDIF ELSE BEGIN 

IF NOT keyword_set(scope) AND NOT keyword_set(val) THEN BEGIN 

    
    popnumber = 5.
    comp_pop = replicate(one_pop,popnumber)

    ;BECAUSE LESS MASSIVE (COLDER) STARS ARE MORE ABUNDANT, THEY WILL BE CHOSEN TO BUILD THE COMPOSITE STELLAR STRUCTURE
    ;THIS MEANS THAT THE CHOSEN SPECTRAL TYPE IS 9V (MAIN SEQUENCE)

    ;CHOSEN STELLAR POPULATIONS
    ;O9V
    ;B9V
    ;A9V
    ;F9V
    ;G9V
    
    comp_pop(0).popid = 'O9V_stellar_population'
    comp_pop(0).radius = 7.51*rsun2cm 
    comp_pop(0).temperature = 33.3e3
    comp_pop(0).distance = 10.0
    comp_pop(0).amplitude = 1.0
    comp_pop(0).nstars = stellar_density*(4.*!pi/3)*comp_pop(0).distance
    
    comp_pop(1).popid = 'B9V_stellar_population'
    comp_pop(1).radius = 2.49*rsun2cm  
    comp_pop(1).temperature = 10.7e3 
    comp_pop(1).distance = 10.0
    comp_pop(1).amplitude = 1.0
    comp_pop(1).nstars = stellar_density*(4.*!pi/3)*comp_pop(1).distance
    
    comp_pop(2).popid = 'A9V_stellar_population'
    comp_pop(2).radius = 1.747*rsun2cm
    comp_pop(2).temperature = 7.4e3
    comp_pop(2).distance = 10.0
    comp_pop(2).amplitude = 1.0
    comp_pop(2).nstars = stellar_density*(4.*!pi/3)*comp_pop(2).distance
    
    comp_pop(3).popid = 'F9V_stellar_population'
    comp_pop(3).radius = 1.167*rsun2cm
    comp_pop(3).temperature = 6.05e3
    comp_pop(3).distance = 10.0
    comp_pop(3).amplitude = 1.0
    comp_pop(3).nstars = stellar_density*(4.*!pi/3)*comp_pop(3).distance
    
    comp_pop(4).popid = 'G9V_stellar_population'
    comp_pop(4).radius = 0.853*rsun2cm 
    comp_pop(4).temperature = 5.38e3
    comp_pop(4).distance = 10.0
    comp_pop(4).amplitude = 1.0
    comp_pop(4).nstars = stellar_density*(4.*!pi/3)*comp_pop(4).distance
    
    
ENDIF 

ENDELSE

print, 'comp_pop is:'
print, comp_pop



if keyword_set(key) then defsysv,'!dustem_composite_stellar_population',comp_pop
scope='DEFINE_ISRF'

the_end:
return, out
end