Commit 644187e3 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Fix dielectric function naming in YAML model definitions

parent 70424a88
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -186,7 +186,7 @@ def load_model(model_file):
        sconf['dielec_file'] = model['material_settings']['dielec_file']
        sconf['dielec_file'] = model['material_settings']['dielec_file']
        num_dielec = 0 # len(model['particle_settings']['dielec_id'])
        num_dielec = 0 # len(model['particle_settings']['dielec_id'])
        if (sconf['idfc'] == -1):
        if (sconf['idfc'] == -1):
            num_dielec = len(model['material_settings']['diel_const'])
            num_dielec = len(model['material_settings']['diel_func'])
        elif (sconf['idfc'] == 0):
        elif (sconf['idfc'] == 0):
            num_dielec = len(model['particle_settings']['dielec_id'])
            num_dielec = len(model['particle_settings']['dielec_id'])
        if (len(model['particle_settings']['n_layers']) != sconf['configurations']):
        if (len(model['particle_settings']['n_layers']) != sconf['configurations']):
@@ -243,12 +243,12 @@ def load_model(model_file):
                    ]
                    ]
                    for di in range(max_layers):
                    for di in range(max_layers):
                        for dj in range(sconf['configurations']):
                        for dj in range(sconf['configurations']):
                            if (len(model['material_settings']['diel_const'][dj]) / 2 != sconf['nshl'][dj]):
                            if (len(model['material_settings']['diel_func'][dj]) / 2 != sconf['nshl'][dj]):
                                print("ERROR: dielectric constants for type %d do not match number of layers!"%(dj + 1))
                                print("ERROR: dielectric constants for type %d do not match number of layers!"%(dj + 1))
                                return (None, None)
                                return (None, None)
                            else:
                            else:
                                sconf['rdc0'][di][dj][0] = float(model['material_settings']['diel_const'][dj][2 * di])
                                sconf['rdc0'][di][dj][0] = float(model['material_settings']['diel_func'][dj][2 * di])
                                sconf['idc0'][di][dj][0] = float(model['material_settings']['diel_const'][dj][2 * di + 1])
                                sconf['idc0'][di][dj][0] = float(model['material_settings']['diel_func'][dj][2 * di + 1])
                else: # sconf[idfc] != -1 and scaling on XI
                else: # sconf[idfc] != -1 and scaling on XI
                    print("ERROR: for scaling on XI, optical constants must be defined!")
                    print("ERROR: for scaling on XI, optical constants must be defined!")
                    return (None, None)
                    return (None, None)
+9 −9
Original line number Original line Diff line number Diff line
@@ -37,7 +37,7 @@ particle_settings:
  radii       : [ 5.0e-8, 4.0e-8, 7.5e-8, 3.0e-8 ]
  radii       : [ 5.0e-8, 4.0e-8, 7.5e-8, 3.0e-8 ]
  # Layer fractional radii (one per layer in each type)
  # Layer fractional radii (one per layer in each type)
  rad_frac    : [ [ 1.0 ], [ 1.0 ], [ 1.0 ], [ 1.0 ] ]
  rad_frac    : [ [ 1.0 ], [ 1.0 ], [ 1.0 ], [ 1.0 ] ]
  # Index of the dielectric constants (one per layer in each type)
  # Index of the dielectric functions (one per layer in each type)
  #
  #
  # 1 is first file in `dielec_file`, 2 is second ...
  # 1 is first file in `dielec_file`, 2 is second ...
  dielec_id   : [ [ 1 ], [ 1 ], [ 1 ], [ 1 ] ]
  dielec_id   : [ [ 1 ], [ 1 ], [ 1 ], [ 1 ] ]
@@ -46,22 +46,22 @@ material_settings:
  diel_flag   : -1
  diel_flag   : -1
  # External medium dielectric constant
  # External medium dielectric constant
  extern_diel : 2.3104e0
  extern_diel : 2.3104e0
  # Dielectric constant files folder
  # Dielectric function files folder
  dielec_path : "."
  dielec_path : "."
  # List of dielectric constant files (used if diel_flag = 0)
  # List of dielectric function files (used if diel_flag = 0)
  dielec_file : [ ]
  dielec_file : [ ]
  # Dielectric constant files format (same for all files)
  # Dielectric function files format (same for all files)
  dielec_fmt  : [ "CSV" ]
  dielec_fmt  : [ "CSV" ]
  # Matching method between optical constants and radiation wavelengths
  # Matching method between optical functions and radiation wavelengths
  #
  #
  # INTERPOLATE: the constants are interpolated on wavelengths
  # INTERPOLATE: the functions are interpolated on wavelengths
  # GRID: only the wavelengths with defined constants are computed
  # GRID: only the wavelengths with defined functions are computed
  #
  #
  match_mode  : "GRID"
  match_mode  : "GRID"
  # Reference dielectric constants (used if diel_flag = -1)
  # Reference dielectric functions (used if diel_flag = -1)
  #
  #
  # One real and one imaginary part for each layer in each type.
  # One real and one imaginary part for each layer in each type.
  diel_const  : [
  diel_func   : [
    [ 3.25e00, 0.00e00 ],
    [ 3.25e00, 0.00e00 ],
    [ 3.25e00, 0.00e00 ],
    [ 3.25e00, 0.00e00 ],
    [ 3.25e00, 0.00e00 ],
    [ 3.25e00, 0.00e00 ],
+9 −9
Original line number Original line Diff line number Diff line
@@ -37,7 +37,7 @@ particle_settings:
  radii       : [ 5.0e-8, 4.0e-8, 7.5e-8, 3.0e-8 ]
  radii       : [ 5.0e-8, 4.0e-8, 7.5e-8, 3.0e-8 ]
  # Layer fractional radii (one per layer in each type)
  # Layer fractional radii (one per layer in each type)
  rad_frac    : [ [ 1.0 ], [ 1.0 ], [ 1.0 ], [ 1.0 ] ]
  rad_frac    : [ [ 1.0 ], [ 1.0 ], [ 1.0 ], [ 1.0 ] ]
  # Index of the dielectric constants (one per layer in each type)
  # Index of the dielectric functions (one per layer in each type)
  #
  #
  # 1 is first file in `dielec_file`, 2 is second ...
  # 1 is first file in `dielec_file`, 2 is second ...
  dielec_id   : [ [ 1 ], [ 1 ], [ 1 ], [ 1 ] ]
  dielec_id   : [ [ 1 ], [ 1 ], [ 1 ], [ 1 ] ]
@@ -46,22 +46,22 @@ material_settings:
  diel_flag   : -1
  diel_flag   : -1
  # External medium dielectric constant
  # External medium dielectric constant
  extern_diel : 2.3104e0
  extern_diel : 2.3104e0
  # Dielectric constant files folder
  # Dielectric function files folder
  dielec_path : "."
  dielec_path : "."
  # List of dielectric constant files (used if diel_flag = 0)
  # List of dielectric function files (used if diel_flag = 0)
  dielec_file : [ ]
  dielec_file : [ ]
  # Dielectric constant files format (same for all files)
  # Dielectric function files format (same for all files)
  dielec_fmt  : [ "CSV" ]
  dielec_fmt  : [ "CSV" ]
  # Matching method between optical constants and radiation wavelengths
  # Matching method between optical functions and radiation wavelengths
  #
  #
  # INTERPOLATE: the constants are interpolated on wavelengths
  # INTERPOLATE: the functions are interpolated on wavelengths
  # GRID: only the wavelengths with defined constants are computed
  # GRID: only the wavelengths with defined functions are computed
  #
  #
  match_mode  : "GRID"
  match_mode  : "GRID"
  # Reference dielectric constants (used if diel_flag = -1)
  # Reference dielectric functions (used if diel_flag = -1)
  #
  #
  # One real and one imaginary part for each layer in each type.
  # One real and one imaginary part for each layer in each type.
  diel_const  : [
  diel_func   : [
    [ 3.25e00, 0.00e00 ],
    [ 3.25e00, 0.00e00 ],
    [ 3.25e00, 0.00e00 ],
    [ 3.25e00, 0.00e00 ],
    [ 3.25e00, 0.00e00 ],
    [ 3.25e00, 0.00e00 ],
+9 −9
Original line number Original line Diff line number Diff line
@@ -48,7 +48,7 @@ particle_settings:
  radii       : [ 4.000e-8, 4.000e-8 ]
  radii       : [ 4.000e-8, 4.000e-8 ]
  # Layer fractional radii (one per layer in each type)
  # Layer fractional radii (one per layer in each type)
  rad_frac    : [ [ 1.0 ], [ 1.0 ] ]
  rad_frac    : [ [ 1.0 ], [ 1.0 ] ]
  # Index of the dielectric constants (one per layer in each type)
  # Index of the dielectric functions (one per layer in each type)
  #
  #
  # 1 is first file in `dielec_file`, 2 is second ...
  # 1 is first file in `dielec_file`, 2 is second ...
  dielec_id   : [ [ 1 ], [ 1 ] ]
  dielec_id   : [ [ 1 ], [ 1 ] ]
@@ -60,22 +60,22 @@ material_settings:
  diel_flag   : 0
  diel_flag   : 0
  # External medium dielectric constant
  # External medium dielectric constant
  extern_diel : 1.00e+00
  extern_diel : 1.00e+00
  # Dielectric constant files folder
  # Dielectric function files folder
  dielec_path : "../../ref_data"
  dielec_path : "../../ref_data"
  # List of dielectric constant files (used if diel_flag = 0)
  # List of dielectric function files (used if diel_flag = 0)
  dielec_file : [ "eps_ashok_C.csv" ]
  dielec_file : [ "eps_ashok_C.csv" ]
  # Dielectric constant files format (same for all files)
  # Dielectric function files format (same for all files)
  dielec_fmt  : [ "CSV" ]
  dielec_fmt  : [ "CSV" ]
  # Matching method between optical constants and radiation wavelengths
  # Matching method between optical functions and radiation wavelengths
  #
  #
  # INTERPOLATE: the constants are interpolated on wavelengths
  # INTERPOLATE: the functions are interpolated on wavelengths
  # GRID: only the wavelengths with defined constants are computed
  # GRID: only the wavelengths with defined functions are computed
  #
  #
  match_mode  : "GRID"
  match_mode  : "GRID"
  # Reference dielectric constants (used if diel_flag = -1)
  # Reference dielectric functions (used if diel_flag = -1)
  #
  #
  # One real and one imaginary part for each layer in each type.
  # One real and one imaginary part for each layer in each type.
  diel_const  : [ ]
  diel_func   : [ ]


radiation_settings:
radiation_settings:
  # Radiation field polarization (LINEAR | CIRCULAR)
  # Radiation field polarization (LINEAR | CIRCULAR)
+9 −9
Original line number Original line Diff line number Diff line
@@ -37,7 +37,7 @@ particle_settings:
  radii       : [ 2.0e-8, 2.0e-8 ]
  radii       : [ 2.0e-8, 2.0e-8 ]
  # Layer fractional radii (one per layer in each type)
  # Layer fractional radii (one per layer in each type)
  rad_frac    : [ [ 1.0, 3.0 ], [ 1.0 ] ]
  rad_frac    : [ [ 1.0, 3.0 ], [ 1.0 ] ]
  # Index of the dielectric constants (one per layer in each type)
  # Index of the dielectric functions (one per layer in each type)
  #
  #
  # 1 is first file in `dielec_file`, 2 is second ...
  # 1 is first file in `dielec_file`, 2 is second ...
  dielec_id   : [ [ 1, 3 ], [ 2 ] ]
  dielec_id   : [ [ 1, 3 ], [ 2 ] ]
@@ -46,22 +46,22 @@ material_settings:
  diel_flag   : 0
  diel_flag   : 0
  # External medium dielectric constant
  # External medium dielectric constant
  extern_diel : 1.0e+00
  extern_diel : 1.0e+00
  # Dielectric constant files folder
  # Dielectric function files folder
  dielec_path : "../../test_data/inclusion"
  dielec_path : "../../test_data/inclusion"
  # List of dielectric constant files (used if diel_flag = 0)
  # List of dielectric function files (used if diel_flag = 0)
  dielec_file : [ "eps_sp1.csv", "eps_sp2.csv", "eps_spe.csv" ]
  dielec_file : [ "eps_sp1.csv", "eps_sp2.csv", "eps_spe.csv" ]
  # Dielectric constant files format (same for all files)
  # Dielectric function files format (same for all files)
  dielec_fmt  : [ "CSV" ]
  dielec_fmt  : [ "CSV" ]
  # Matching method between optical constants and radiation wavelengths
  # Matching method between optical functions and radiation wavelengths
  #
  #
  # INTERPOLATE: the constants are interpolated on wavelengths
  # INTERPOLATE: the functions are interpolated on wavelengths
  # GRID: only the wavelengths with defined constants are computed
  # GRID: only the wavelengths with defined functions are computed
  #
  #
  match_mode  : "GRID"
  match_mode  : "GRID"
  # Reference dielectric constants (used if diel_flag = -1)
  # Reference dielectric functions (used if diel_flag = -1)
  #
  #
  # One real and one imaginary part for each layer in each type.
  # One real and one imaginary part for each layer in each type.
  diel_const  : [ ]
  diel_func   : [ ]


radiation_settings:
radiation_settings:
  # Radiation field polarization (LINEAR | CIRCULAR)
  # Radiation field polarization (LINEAR | CIRCULAR)
Loading