Beispiel #1
0
 def define_methods(self, object):
     CommonCode.define_methods(self, object)
     object.add_method("generate_particles", (), (object.ERROR_CODE,))
     object.add_method("get_number_of_particles_updated", (), (object.NO_UNIT,object.NO_UNIT, object.ERROR_CODE,))
     
     object.add_method("get_mass", (object.INDEX,), 
         (nbody_system.mass, object.ERROR_CODE)
     )
     object.add_method("get_position", (object.INDEX,), 
         (nbody_system.length, nbody_system.length, nbody_system.length, object.ERROR_CODE)
     )
     object.add_method("get_velocity", (object.INDEX,), 
         (nbody_system.speed, nbody_system.speed, nbody_system.speed, object.ERROR_CODE)
     )
     
     object.add_method("get_output_path", (), (object.NO_UNIT, object.ERROR_CODE,))
     object.add_method("set_output_path", (object.NO_UNIT,), (object.ERROR_CODE,))
     
     for par in parameters:
         if hasattr(parameters[par]["default"],"unit"):
           unit=parameters[par]["default"].unit
         else:
           unit=object.NO_UNIT          
         object.add_method("get_"+par, (), (unit, object.ERROR_CODE,))
         object.add_method("set_"+par, (unit, ), (object.ERROR_CODE,))
Beispiel #2
0
    def define_methods(self, object):
        CommonCode.define_methods(self, object)
        object.add_method("generate_particles", (), (object.ERROR_CODE, ))
        object.add_method("get_number_of_particles_updated", (), (
            object.NO_UNIT,
            object.ERROR_CODE,
        ))

        object.add_method("get_state", (object.INDEX, ),
                          [nbody_system.length] * 3 +
                          [nbody_system.speed] * 3 + [object.ERROR_CODE])

        object.add_method("get_target_number_of_particles", (), (
            object.NO_UNIT,
            object.ERROR_CODE,
        ))
        object.add_method("set_target_number_of_particles", (object.NO_UNIT, ),
                          (object.ERROR_CODE, ))

        object.add_method("get_fractal_dimension", (), (
            object.NO_UNIT,
            object.ERROR_CODE,
        ))
        object.add_method("set_fractal_dimension", (object.NO_UNIT, ),
                          (object.ERROR_CODE, ))

        object.add_method("get_random_seed", (), (
            object.NO_UNIT,
            object.ERROR_CODE,
        ))
        object.add_method("set_random_seed", (object.NO_UNIT, ),
                          (object.ERROR_CODE, ))
Beispiel #3
0
    def define_methods(self, handler):
        CommonCode.define_methods(self, handler)
        handler.add_method("generate_particles", (), (handler.ERROR_CODE, ))
        handler.add_method("get_number_of_particles_updated", (), (
            handler.NO_UNIT,
            handler.NO_UNIT,
            handler.ERROR_CODE,
        ))

        handler.add_method("get_mass", (handler.INDEX, ),
                           (nbody_system.mass, handler.ERROR_CODE))
        handler.add_method("get_position", (handler.INDEX, ),
                           (nbody_system.length, nbody_system.length,
                            nbody_system.length, handler.ERROR_CODE))
        handler.add_method("get_velocity", (handler.INDEX, ),
                           (nbody_system.speed, nbody_system.speed,
                            nbody_system.speed, handler.ERROR_CODE))

        handler.add_method("get_output_path", (), (
            handler.NO_UNIT,
            handler.ERROR_CODE,
        ))
        handler.add_method("set_output_path", (handler.NO_UNIT, ),
                           (handler.ERROR_CODE, ))

        for par in parameters:
            if hasattr(parameters[par]["default"], "unit"):
                unit = parameters[par]["default"].unit
            else:
                unit = handler.NO_UNIT
            handler.add_method("get_" + par, (), (
                unit,
                handler.ERROR_CODE,
            ))
            handler.add_method("set_" + par, (unit, ), (handler.ERROR_CODE, ))
Beispiel #4
0
 def define_methods(self, object):
     CommonCode.define_methods(self, object)
     object.add_method(
         "new_particle",
         (units.MSun,),
         (object.INDEX, object.ERROR_CODE,)
     )
     object.add_method(
         "delete_particle",
         (object.INDEX,),
         (object.ERROR_CODE,)
     )
     object.add_method(
         "read_usm",
         (object.NO_UNIT,),
         (object.INDEX, object.ERROR_CODE,)
     )
     object.add_method(
         "add_shell",
         (object.INDEX, units.MSun, units.MSun, units.RSun, units.g / units.cm**3, units.barye, 
             units.K, units.LSun, units.amu, object.NO_UNIT, object.NO_UNIT, object.NO_UNIT, object.NO_UNIT, 
             object.NO_UNIT, object.NO_UNIT, object.NO_UNIT, object.NO_UNIT, object.NO_UNIT),
         (object.ERROR_CODE,)
     )
     object.add_method(
         "get_stellar_model_element",
         (object.INDEX, object.INDEX,),
         (units.MSun, units.MSun, units.RSun, units.g / units.cm**3, units.barye, 
             object.NO_UNIT, units.K, units.LSun, units.amu,
             object.NO_UNIT, object.NO_UNIT, object.NO_UNIT, object.NO_UNIT, object.NO_UNIT, 
             object.NO_UNIT, object.NO_UNIT, object.NO_UNIT, object.NO_UNIT, object.ERROR_CODE,)
     )
     object.add_method(
         "get_number_of_zones",
         (object.INDEX, ),
         (object.NO_UNIT, object.ERROR_CODE,)
     )
     object.add_method(
         "get_number_of_particles",
         (),
         (object.NO_UNIT, object.ERROR_CODE,)
     )
     object.add_method(
         "merge_two_stars",
         (object.INDEX, object.INDEX,),
         (object.INDEX, object.ERROR_CODE,)
     )
     
     object.add_method("get_target_n_shells_mixing", (), (object.NO_UNIT, object.ERROR_CODE,)) 
     object.add_method("set_target_n_shells_mixing", (object.NO_UNIT, ), (object.ERROR_CODE,)) 
     
     object.add_method("get_target_n_shells", (), (object.NO_UNIT, object.ERROR_CODE,)) 
     object.add_method("set_target_n_shells", (object.NO_UNIT, ), (object.ERROR_CODE,)) 
     
     object.add_method("get_number_of_particles", (), (object.NO_UNIT, object.ERROR_CODE,)) 
Beispiel #5
0
 def define_methods(self, handler):
     CommonCode.define_methods(self, handler)
     handler.add_method(
         "new_particle",
         (units.MSun,),
         (handler.INDEX, handler.ERROR_CODE,)
     )
     handler.add_method(
         "delete_particle",
         (handler.INDEX,),
         (handler.ERROR_CODE,)
     )
     handler.add_method(
         "read_usm",
         (handler.NO_UNIT,),
         (handler.INDEX, handler.ERROR_CODE,)
     )
     handler.add_method(
         "add_shell",
         (handler.INDEX, units.MSun, units.MSun, units.RSun, units.g / units.cm**3, units.barye, 
             units.K, units.LSun, units.amu, handler.NO_UNIT, handler.NO_UNIT, handler.NO_UNIT, handler.NO_UNIT, 
             handler.NO_UNIT, handler.NO_UNIT, handler.NO_UNIT, handler.NO_UNIT, handler.NO_UNIT),
         (handler.ERROR_CODE,)
     )
     handler.add_method(
         "get_stellar_model_element",
         (handler.INDEX, handler.INDEX,),
         (units.MSun, units.MSun, units.RSun, units.g / units.cm**3, units.barye, 
             handler.NO_UNIT, units.K, units.LSun, units.amu,
             handler.NO_UNIT, handler.NO_UNIT, handler.NO_UNIT, handler.NO_UNIT, handler.NO_UNIT, 
             handler.NO_UNIT, handler.NO_UNIT, handler.NO_UNIT, handler.NO_UNIT, handler.ERROR_CODE,)
     )
     handler.add_method(
         "get_number_of_zones",
         (handler.INDEX, ),
         (handler.NO_UNIT, handler.ERROR_CODE,)
     )
     handler.add_method(
         "get_number_of_particles",
         (),
         (handler.NO_UNIT, handler.ERROR_CODE,)
     )
     handler.add_method(
         "merge_two_stars",
         (handler.INDEX, handler.INDEX,),
         (handler.INDEX, handler.ERROR_CODE,)
     )
     
     handler.add_method("get_target_n_shells_mixing", (), (handler.NO_UNIT, handler.ERROR_CODE,)) 
     handler.add_method("set_target_n_shells_mixing", (handler.NO_UNIT, ), (handler.ERROR_CODE,)) 
     
     handler.add_method("get_target_n_shells", (), (handler.NO_UNIT, handler.ERROR_CODE,)) 
     handler.add_method("set_target_n_shells", (handler.NO_UNIT, ), (handler.ERROR_CODE,)) 
     
     handler.add_method("get_number_of_particles", (), (handler.NO_UNIT, handler.ERROR_CODE,)) 
Beispiel #6
0
 def define_methods(self, object):
     CommonCode.define_methods(self, object)
     object.add_method("new_particle", [nbody_system.mass] + [nbody_system.length]*3,
         (object.INDEX, object.ERROR_CODE))
     object.add_method(
         "get_eps2",
         (),
         (nbody_system.length * nbody_system.length, object.ERROR_CODE,)
     )
     
     object.add_method(
         "set_eps2",
         (nbody_system.length * nbody_system.length, ),
         (object.ERROR_CODE,)
     )
Beispiel #7
0
 def define_methods(self, object):
     CommonCode.define_methods(self, object)
     object.add_method("generate_particles", (), (object.ERROR_CODE,))
     object.add_method("get_number_of_particles_updated", (), (object.NO_UNIT, object.ERROR_CODE,))
     
     object.add_method("get_mass", (object.INDEX,), 
         (nbody_system.mass, object.ERROR_CODE)
     )
     object.add_method("get_position", (object.INDEX,), 
         (nbody_system.length, nbody_system.length, nbody_system.length, object.ERROR_CODE)
     )
     object.add_method("get_velocity", (object.INDEX,), 
         (nbody_system.speed, nbody_system.speed, nbody_system.speed, object.ERROR_CODE)
     )
     
     object.add_method("get_model_alpha", (), (object.NO_UNIT, object.ERROR_CODE,))
     object.add_method("set_model_alpha", (object.NO_UNIT, ), (object.ERROR_CODE,))
     
     object.add_method("get_model_beta", (), (object.NO_UNIT, object.ERROR_CODE,))
     object.add_method("set_model_beta", (object.NO_UNIT, ), (object.ERROR_CODE,))
     
     object.add_method("get_model_gamma", (), (object.NO_UNIT, object.ERROR_CODE,))
     object.add_method("set_model_gamma", (object.NO_UNIT, ), (object.ERROR_CODE,))
     
     object.add_method("get_total_mass", (), (nbody_system.mass, object.ERROR_CODE,))
     object.add_method("set_total_mass", (nbody_system.mass, ), (object.ERROR_CODE,))
     
     object.add_method("get_scale_radius", (), (nbody_system.length, object.ERROR_CODE,))
     object.add_method("set_scale_radius", (nbody_system.length, ), (object.ERROR_CODE,))
     
     object.add_method("get_cutoff_radius", (), (nbody_system.length, object.ERROR_CODE,))
     object.add_method("set_cutoff_radius", (nbody_system.length, ), (object.ERROR_CODE,))
     
     object.add_method("get_target_number_of_particles", (), (object.NO_UNIT, object.ERROR_CODE,))
     object.add_method("set_target_number_of_particles", (object.NO_UNIT, ), (object.ERROR_CODE,))
     
     object.add_method("get_black_hole_mass", (), (nbody_system.mass, object.ERROR_CODE,))
     object.add_method("set_black_hole_mass", (nbody_system.mass, ), (object.ERROR_CODE,))
     
     object.add_method("get_random_seed", (), (object.NO_UNIT, object.ERROR_CODE,))
     object.add_method("set_random_seed", (object.NO_UNIT, ), (object.ERROR_CODE,))
     
     object.add_method("get_output_path", (), (object.NO_UNIT, object.ERROR_CODE,))
     object.add_method("set_output_path", (object.NO_UNIT,), (object.ERROR_CODE,))
     
     object.add_method("get_output_basename", (), (object.NO_UNIT, object.ERROR_CODE,))
     object.add_method("set_output_basename", (object.NO_UNIT,), (object.ERROR_CODE,))
Beispiel #8
0
 def define_methods(self, handler):
     CommonCode.define_methods(self, handler)
     handler.add_method("generate_particles", (), (handler.ERROR_CODE,))
     handler.add_method("get_number_of_particles_updated", (), (handler.NO_UNIT, handler.ERROR_CODE,))
     
     handler.add_method("get_mass", (handler.INDEX,), 
         (nbody_system.mass, handler.ERROR_CODE)
     )
     handler.add_method("get_position", (handler.INDEX,), 
         (nbody_system.length, nbody_system.length, nbody_system.length, handler.ERROR_CODE)
     )
     handler.add_method("get_velocity", (handler.INDEX,), 
         (nbody_system.speed, nbody_system.speed, nbody_system.speed, handler.ERROR_CODE)
     )
     
     handler.add_method("get_model_alpha", (), (handler.NO_UNIT, handler.ERROR_CODE,))
     handler.add_method("set_model_alpha", (handler.NO_UNIT, ), (handler.ERROR_CODE,))
     
     handler.add_method("get_model_beta", (), (handler.NO_UNIT, handler.ERROR_CODE,))
     handler.add_method("set_model_beta", (handler.NO_UNIT, ), (handler.ERROR_CODE,))
     
     handler.add_method("get_model_gamma", (), (handler.NO_UNIT, handler.ERROR_CODE,))
     handler.add_method("set_model_gamma", (handler.NO_UNIT, ), (handler.ERROR_CODE,))
     
     handler.add_method("get_total_mass", (), (nbody_system.mass, handler.ERROR_CODE,))
     handler.add_method("set_total_mass", (nbody_system.mass, ), (handler.ERROR_CODE,))
     
     handler.add_method("get_scale_radius", (), (nbody_system.length, handler.ERROR_CODE,))
     handler.add_method("set_scale_radius", (nbody_system.length, ), (handler.ERROR_CODE,))
     
     handler.add_method("get_cutoff_radius", (), (nbody_system.length, handler.ERROR_CODE,))
     handler.add_method("set_cutoff_radius", (nbody_system.length, ), (handler.ERROR_CODE,))
     
     handler.add_method("get_target_number_of_particles", (), (handler.NO_UNIT, handler.ERROR_CODE,))
     handler.add_method("set_target_number_of_particles", (handler.NO_UNIT, ), (handler.ERROR_CODE,))
     
     handler.add_method("get_black_hole_mass", (), (nbody_system.mass, handler.ERROR_CODE,))
     handler.add_method("set_black_hole_mass", (nbody_system.mass, ), (handler.ERROR_CODE,))
     
     handler.add_method("get_random_seed", (), (handler.NO_UNIT, handler.ERROR_CODE,))
     handler.add_method("set_random_seed", (handler.NO_UNIT, ), (handler.ERROR_CODE,))
     
     handler.add_method("get_output_path", (), (handler.NO_UNIT, handler.ERROR_CODE,))
     handler.add_method("set_output_path", (handler.NO_UNIT,), (handler.ERROR_CODE,))
     
     handler.add_method("get_output_basename", (), (handler.NO_UNIT, handler.ERROR_CODE,))
     handler.add_method("set_output_basename", (handler.NO_UNIT,), (handler.ERROR_CODE,))
Beispiel #9
0
    def define_methods(self, object):
        CommonCode.define_methods(self, object)
        object.add_method("generate_particles", (), (object.ERROR_CODE,))
        object.add_method("get_number_of_particles_updated", (), (object.NO_UNIT, object.ERROR_CODE))

        object.add_method(
            "get_state", (object.INDEX,), [nbody_system.length] * 3 + [nbody_system.speed] * 3 + [object.ERROR_CODE]
        )

        object.add_method("get_target_number_of_particles", (), (object.NO_UNIT, object.ERROR_CODE))
        object.add_method("set_target_number_of_particles", (object.NO_UNIT,), (object.ERROR_CODE,))

        object.add_method("get_fractal_dimension", (), (object.NO_UNIT, object.ERROR_CODE))
        object.add_method("set_fractal_dimension", (object.NO_UNIT,), (object.ERROR_CODE,))

        object.add_method("get_random_seed", (), (object.NO_UNIT, object.ERROR_CODE))
        object.add_method("set_random_seed", (object.NO_UNIT,), (object.ERROR_CODE,))
Beispiel #10
0
 def define_methods(self, handler):
     CommonCode.define_methods(self, handler)
     handler.add_method('evolve_model', (units.s, ), (handler.ERROR_CODE, ))
     handler.add_method("new_particle", (
         units.cm**-3,
         units.K,
         units.s**-1,
     ), (
         handler.INDEX,
         handler.ERROR_CODE,
     ))
     handler.add_method("set_state", (
         handler.NO_UNIT,
         units.cm**-3,
         units.K,
         units.s**-1,
     ), (handler.ERROR_CODE, ))
     handler.add_method("get_state", (handler.INDEX, ), (
         units.cm**-3,
         units.K,
         units.s**-1,
         handler.ERROR_CODE,
     ))
     handler.add_method("get_abundance", (
         handler.INDEX,
         handler.INDEX,
     ), (
         handler.NO_UNIT,
         handler.ERROR_CODE,
     ))
     handler.add_method("set_abundance", (
         handler.INDEX,
         handler.INDEX,
         handler.NO_UNIT,
     ), (handler.ERROR_CODE, ))
     handler.add_method("delete_particle", (handler.INDEX, ),
                        (handler.ERROR_CODE, ))
     handler.add_method("get_firstlast_abundance", (), (
         handler.NO_UNIT,
         handler.NO_UNIT,
         handler.ERROR_CODE,
     ))
     handler.add_method("get_time", (), (
         units.s,
         handler.ERROR_CODE,
     ))
Beispiel #11
0
 def define_methods(self, object):
     CommonCode.define_methods(self, object)
     object.add_method('evolve_model', (units.s, ), (object.ERROR_CODE, ))
     object.add_method("new_particle", (
         units.cm**-3,
         units.K,
         units.s**-1,
     ), (
         object.INDEX,
         object.ERROR_CODE,
     ))
     object.add_method("set_state", (
         object.NO_UNIT,
         units.cm**-3,
         units.K,
         units.s**-1,
     ), (object.ERROR_CODE, ))
     object.add_method("get_state", (object.INDEX, ), (
         units.cm**-3,
         units.K,
         units.s**-1,
         object.ERROR_CODE,
     ))
     object.add_method("get_abundance", (
         object.INDEX,
         object.INDEX,
     ), (
         object.NO_UNIT,
         object.ERROR_CODE,
     ))
     object.add_method("set_abundance", (
         object.INDEX,
         object.INDEX,
         object.NO_UNIT,
     ), (object.ERROR_CODE, ))
     object.add_method("delete_particle", (object.INDEX, ),
                       (object.ERROR_CODE, ))
     object.add_method("get_firstlast_abundance", (), (
         object.NO_UNIT,
         object.NO_UNIT,
         object.ERROR_CODE,
     ))
     object.add_method("get_time", (), (
         units.s,
         object.ERROR_CODE,
     ))
Beispiel #12
0
    def define_methods(self, handler):
        CommonCode.define_methods(self, handler)
        handler.add_method("new_particle",
                           [nbody_system.mass] + [nbody_system.length] * 3,
                           (handler.INDEX, handler.ERROR_CODE))
        handler.add_method("get_eps2", (), (
            nbody_system.length * nbody_system.length,
            handler.ERROR_CODE,
        ))

        handler.add_method("set_eps2",
                           (nbody_system.length * nbody_system.length, ),
                           (handler.ERROR_CODE, ))

        handler.add_method("set_mass", (
            handler.NO_UNIT,
            nbody_system.mass,
        ), (handler.ERROR_CODE))
        handler.add_method("get_mass", (handler.NO_UNIT, ),
                           (nbody_system.mass, handler.ERROR_CODE))
Beispiel #13
0
 def define_methods(self, object):
     CommonCode.define_methods(self, object)
     object.add_method("generate_particles", (), (object.ERROR_CODE,))
     object.add_method("get_number_of_particles_updated", (), (object.NO_UNIT, object.ERROR_CODE,))
     
     object.add_method("get_mass", (object.INDEX,), 
         (nbody_system.mass, object.ERROR_CODE)
     )
     object.add_method("get_position", (object.INDEX,), 
         (nbody_system.length, nbody_system.length, nbody_system.length, object.ERROR_CODE)
     )
     object.add_method("get_velocity", (object.INDEX,), 
         (nbody_system.speed, nbody_system.speed, nbody_system.speed, object.ERROR_CODE)
     )
     
     object.add_method("get_output_path", (), (object.NO_UNIT, object.ERROR_CODE,))
     object.add_method("set_output_path", (object.NO_UNIT,), (object.ERROR_CODE,))
     
     for par in ["_number_of_grid_intervals", "_order_of_multipole_expansion", 
             "_number_of_radial_steps_correction_fns", "_number_of_iterations", 
             "_halo_number_of_particles", "_halo_random_seed", 
             "_bulge_number_of_particles", "_bulge_random_seed", 
             "_disk_number_of_particles", "_disk_random_seed",
             "_inner_cusp_slope", "_outer_slope", "_Sersic_index_n", "_central_radial_vel_dispersion", 
             "_halo_streaming_fraction", "_bulge_streaming_fraction"]:
         object.add_method("get"+par, (), (object.NO_UNIT, object.ERROR_CODE,))
         object.add_method("set"+par, (object.NO_UNIT, ), (object.ERROR_CODE,))
     
     for par in ["_halo_outer_radius", "_scale_radius", "_truncation_delta_r", 
             "_disk_scale_length", "_disk_outer_radius", "_disk_scale_height_sech2", 
             "_disk_truncation_dr", "_bulge_scale_radius", "_radial_grid_delta_r", 
             "_scale_length_of_sigR2"]:
         object.add_method("get"+par, (), (nbody_system.length, object.ERROR_CODE,))
         object.add_method("set"+par, (nbody_system.length, ), (object.ERROR_CODE,))
     
     for par in ["_scale_velocity", "_bulge_velocity"]:
         object.add_method("get"+par, (), (nbody_system.speed, object.ERROR_CODE,))
         object.add_method("set"+par, (nbody_system.speed, ), (object.ERROR_CODE,))
     
     object.add_method("get_disk_mass", (), (nbody_system.mass, object.ERROR_CODE,))
     object.add_method("set_disk_mass", (nbody_system.mass, ), (object.ERROR_CODE,))
Beispiel #14
0
    def define_methods(self, object):
        CommonCode.define_methods(self, object)
        object.add_method('evolve_model', (generic_unit_system.time,), ( object.ERROR_CODE, ))
        object.add_method(
            "new_gas_particle",
            (
                generic_unit_system.mass,
                generic_unit_system.length,
                generic_unit_system.length,
                generic_unit_system.length,
                generic_unit_system.length,
                generic_unit_system.density,
                object.NO_UNIT,
                generic_unit_system.speed**2,
                generic_unit_system.speed,
                generic_unit_system.speed,
                generic_unit_system.speed,
            ),
            (
                object.INDEX,
                object.ERROR_CODE,
            )
        )
        object.add_method(
            "set_state_gas",
            (
                object.NO_UNIT,
                generic_unit_system.mass,
                generic_unit_system.length,
                generic_unit_system.length,
                generic_unit_system.length,
                generic_unit_system.length,
                generic_unit_system.density,
                object.NO_UNIT,
                generic_unit_system.speed**2
            ),
            (
                object.ERROR_CODE,
            )
        )
        object.add_method(
            "set_vel_gas",
            (
                object.NO_UNIT,
                generic_unit_system.speed,
                generic_unit_system.speed,
                generic_unit_system.speed,
            ),
            (
                object.ERROR_CODE,
            )
        )
        object.add_method(
            "set_pos_gas",
            (
                object.NO_UNIT,
                generic_unit_system.length,
                generic_unit_system.length,
                generic_unit_system.length,
            ),
            (
                object.ERROR_CODE,
            )
        )
        object.add_method(
            "set_rho_gas",
            (
                object.NO_UNIT,
                generic_unit_system.density,
            ),
            (
                object.ERROR_CODE,
            )
        )
        object.add_method(
            "set_hsml_gas",
            (
                object.NO_UNIT,
                generic_unit_system.length,
            ),
            (
                object.ERROR_CODE,
            )
        )
        object.add_method(
            "set_u_gas",
            (
                object.NO_UNIT,
                generic_unit_system.speed**2
            ),
            (
                object.ERROR_CODE,
            )
        )
        object.add_method(
            "set_dudt_gas",
            (
                object.NO_UNIT,
                generic_unit_system.length**2/generic_unit_system.time**3
            ),
            (
                object.ERROR_CODE,
            )
        )
        object.add_method(
            "get_dudt_gas",
            (
                object.INDEX,
            ),
            (
                generic_unit_system.length**2/generic_unit_system.time**3,
                object.ERROR_CODE,
            )
        )
        object.add_method(
            "get_state_gas",
            (
                object.INDEX,
            ),
            (
                generic_unit_system.mass,
                generic_unit_system.length,
                generic_unit_system.length,
                generic_unit_system.length,
                generic_unit_system.length,
                generic_unit_system.density,
                object.NO_UNIT,
                generic_unit_system.speed**2,
                object.ERROR_CODE,
            )
        )
        object.add_method(
            "get_vel_gas",
            (
                object.INDEX,
            ),
            (
                generic_unit_system.speed,
                generic_unit_system.speed,
                generic_unit_system.speed,
                object.ERROR_CODE,
            )
        )
        object.add_method(
            "new_src_particle",
            (
                1.e50 * units.s**-1,
                generic_unit_system.length,
                generic_unit_system.length,
                generic_unit_system.length,
                object.NO_UNIT,
            ),
            (
                object.INDEX,
                object.ERROR_CODE,
            )
        )
        object.add_method(
            "set_state_src",
            (
                object.NO_UNIT,
                1.e50 * units.s**-1,
                generic_unit_system.length,
                generic_unit_system.length,
                generic_unit_system.length,
                object.NO_UNIT,
            ),
            (
                object.ERROR_CODE,
            )
        )
        object.add_method(
            "get_state_src",
            (
                object.INDEX,
            ),
            (
                1.e50 * units.s**-1,
                generic_unit_system.length,
                generic_unit_system.length,
                generic_unit_system.length,
                object.NO_UNIT,
                object.ERROR_CODE,
            )
        )
        object.add_method(
            "remove_src_particle",
            (
                object.INDEX,
            ),
            (
                object.ERROR_CODE,
            )
        )
        object.add_method(
            "remove_gas_particle",
            (
                object.INDEX,
            ),
            (
                object.ERROR_CODE,
            )
        )
        object.add_method(
            "set_boxsize",
            (
                generic_unit_system.length,
            ),
            (
                object.ERROR_CODE,
            )
        )
        object.add_method(
            "set_defaultspectype",
            (
                object.NO_UNIT,
            ),
            (
                object.ERROR_CODE,
            )
        )
        object.add_method(
            "set_globalHefraction",
            (
               object.NO_UNIT,
            ),
            (
                object.ERROR_CODE,
            )
        )
        object.add_method(
            "get_boxsize",
            (
            ),
            (
                generic_unit_system.length,
                object.ERROR_CODE,
            )
        )
        object.add_method(
            "get_globalHefraction",
            (
            ),
            (
                object.NO_UNIT,
                object.ERROR_CODE,
            )
        )
        object.add_method(
            "get_defaultspectype",
            (
            ),
            (
                object.NO_UNIT,
                object.ERROR_CODE,
            )
        )

        object.add_method(
            "set_raynumber",
            (
               generic_unit_system.time**-1,
            ),
            (
                object.ERROR_CODE,
            )
        )

        object.add_method(
            "get_raynumber",
            (
            ),
            (
                generic_unit_system.time**-1,
                object.ERROR_CODE,
            )
        )

        object.add_method(
            "set_iontempsolver",
            (
               object.NO_UNIT,
            ),
            (
                object.ERROR_CODE,
            )
        )

        object.add_method(
            "get_iontempsolver",
            (
            ),
            (
                object.NO_UNIT,
                object.ERROR_CODE,
            )
        )

        object.add_method(
            "set_boundary",
            (
               object.NO_UNIT,
            ),
            (
                object.ERROR_CODE,
            )
        )

        object.add_method(
            "get_boundary",
            (
            ),
            (
                object.NO_UNIT,
                object.ERROR_CODE,
            )
        )
        object.add_method(
            "get_time",
            (
            ),
            (
                generic_unit_system.time,
                object.ERROR_CODE,
            )
        )
Beispiel #15
0
 def define_methods(self, object):
     CommonCode.define_methods(self, object)
Beispiel #16
0
 def define_methods(self, object):
     CommonCode.define_methods(self, object)
Beispiel #17
0
    def define_methods(self, handler):
        CommonCode.define_methods(self, handler)
        handler.add_method('evolve_model', (generic_unit_system.time,), ( handler.ERROR_CODE, ))
        handler.add_method(
            "new_gas_particle",
            (
                generic_unit_system.mass,
                generic_unit_system.length,
                generic_unit_system.length,
                generic_unit_system.length,
                generic_unit_system.length,
                generic_unit_system.density,
                handler.NO_UNIT,
                generic_unit_system.speed**2,
                generic_unit_system.speed,
                generic_unit_system.speed,
                generic_unit_system.speed,
            ),
            (
                handler.INDEX,
                handler.ERROR_CODE,
            )
        )
        handler.add_method(
            "set_state_gas",
            (
                handler.NO_UNIT,
                generic_unit_system.mass,
                generic_unit_system.length,
                generic_unit_system.length,
                generic_unit_system.length,
                generic_unit_system.length,
                generic_unit_system.density,
                handler.NO_UNIT,
                generic_unit_system.speed**2
            ),
            (
                handler.ERROR_CODE,
            )
        )
        handler.add_method(
            "set_vel_gas",
            (
                handler.NO_UNIT,
                generic_unit_system.speed,
                generic_unit_system.speed,
                generic_unit_system.speed,
            ),
            (
                handler.ERROR_CODE,
            )
        )
        handler.add_method(
            "set_pos_gas",
            (
                handler.NO_UNIT,
                generic_unit_system.length,
                generic_unit_system.length,
                generic_unit_system.length,
            ),
            (
                handler.ERROR_CODE,
            )
        )
        handler.add_method(
            "set_rho_gas",
            (
                handler.NO_UNIT,
                generic_unit_system.density,
            ),
            (
                handler.ERROR_CODE,
            )
        )
        handler.add_method(
            "set_hsml_gas",
            (
                handler.NO_UNIT,
                generic_unit_system.length,
            ),
            (
                handler.ERROR_CODE,
            )
        )
        handler.add_method(
            "set_u_gas",
            (
                handler.NO_UNIT,
                generic_unit_system.speed**2
            ),
            (
                handler.ERROR_CODE,
            )
        )
        handler.add_method(
            "set_dudt_gas",
            (
                handler.NO_UNIT,
                generic_unit_system.length**2/generic_unit_system.time**3
            ),
            (
                handler.ERROR_CODE,
            )
        )
        handler.add_method(
            "get_dudt_gas",
            (
                handler.INDEX,
            ),
            (
                generic_unit_system.length**2/generic_unit_system.time**3,
                handler.ERROR_CODE,
            )
        )
        handler.add_method(
            "get_state_gas",
            (
                handler.INDEX,
            ),
            (
                generic_unit_system.mass,
                generic_unit_system.length,
                generic_unit_system.length,
                generic_unit_system.length,
                generic_unit_system.length,
                generic_unit_system.density,
                handler.NO_UNIT,
                generic_unit_system.speed**2,
                handler.ERROR_CODE,
            )
        )
        handler.add_method(
            "get_vel_gas",
            (
                handler.INDEX,
            ),
            (
                generic_unit_system.speed,
                generic_unit_system.speed,
                generic_unit_system.speed,
                handler.ERROR_CODE,
            )
        )
        handler.add_method(
            "new_src_particle",
            (
                1.e50 * units.s**-1,
                generic_unit_system.length,
                generic_unit_system.length,
                generic_unit_system.length,
                handler.NO_UNIT,
            ),
            (
                handler.INDEX,
                handler.ERROR_CODE,
            )
        )
        handler.add_method(
            "set_state_src",
            (
                handler.NO_UNIT,
                1.e50 * units.s**-1,
                generic_unit_system.length,
                generic_unit_system.length,
                generic_unit_system.length,
                handler.NO_UNIT,
            ),
            (
                handler.ERROR_CODE,
            )
        )
        handler.add_method(
            "set_luminosity_src",
            (
                handler.NO_UNIT,
                1.e50 * units.s**-1,
            ),
            (
                handler.ERROR_CODE,
            )
        )
        handler.add_method(
            "get_state_src",
            (
                handler.INDEX,
            ),
            (
                1.e50 * units.s**-1,
                generic_unit_system.length,
                generic_unit_system.length,
                generic_unit_system.length,
                handler.NO_UNIT,
                handler.ERROR_CODE,
            )
        )
        handler.add_method(
            "remove_src_particle",
            (
                handler.INDEX,
            ),
            (
                handler.ERROR_CODE,
            )
        )
        handler.add_method(
            "remove_gas_particle",
            (
                handler.INDEX,
            ),
            (
                handler.ERROR_CODE,
            )
        )
        handler.add_method(
            "set_boxsize",
            (
                generic_unit_system.length,
            ),
            (
                handler.ERROR_CODE,
            )
        )
        handler.add_method(
            "set_defaultspectype",
            (
                handler.NO_UNIT,
            ),
            (
                handler.ERROR_CODE,
            )
        )
        handler.add_method(
            "set_globalHefraction",
            (
               handler.NO_UNIT,
            ),
            (
                handler.ERROR_CODE,
            )
        )
        handler.add_method(
            "get_boxsize",
            (
            ),
            (
                generic_unit_system.length,
                handler.ERROR_CODE,
            )
        )
        handler.add_method(
            "get_globalHefraction",
            (
            ),
            (
                handler.NO_UNIT,
                handler.ERROR_CODE,
            )
        )
        handler.add_method(
            "get_defaultspectype",
            (
            ),
            (
                handler.NO_UNIT,
                handler.ERROR_CODE,
            )
        )

        handler.add_method(
            "set_raynumber",
            (
               generic_unit_system.time**-1,
            ),
            (
                handler.ERROR_CODE,
            )
        )

        handler.add_method(
            "get_raynumber",
            (
            ),
            (
                generic_unit_system.time**-1,
                handler.ERROR_CODE,
            )
        )

        handler.add_method(
            "set_iontempsolver",
            (
               handler.NO_UNIT,
            ),
            (
                handler.ERROR_CODE,
            )
        )

        handler.add_method(
            "get_iontempsolver",
            (
            ),
            (
                handler.NO_UNIT,
                handler.ERROR_CODE,
            )
        )

        handler.add_method(
            "set_boundary",
            (
               handler.NO_UNIT,
            ),
            (
                handler.ERROR_CODE,
            )
        )

        handler.add_method(
            "get_boundary",
            (
            ),
            (
                handler.NO_UNIT,
                handler.ERROR_CODE,
            )
        )
        handler.add_method(
            "get_time",
            (
            ),
            (
                generic_unit_system.time,
                handler.ERROR_CODE,
            )
        )
Beispiel #18
0
    def define_methods(self, object):
        CommonCode.define_methods(self, object)
        object.add_method("generate_particles", (), (object.ERROR_CODE, ))
        object.add_method("get_number_of_particles_updated", (), (
            object.NO_UNIT,
            object.ERROR_CODE,
        ))

        object.add_method("get_mass", (object.INDEX, ),
                          (nbody_system.mass, object.ERROR_CODE))
        object.add_method("get_position", (object.INDEX, ),
                          (nbody_system.length, nbody_system.length,
                           nbody_system.length, object.ERROR_CODE))
        object.add_method("get_velocity", (object.INDEX, ),
                          (nbody_system.speed, nbody_system.speed,
                           nbody_system.speed, object.ERROR_CODE))

        object.add_method("get_output_path", (), (
            object.NO_UNIT,
            object.ERROR_CODE,
        ))
        object.add_method("set_output_path", (object.NO_UNIT, ),
                          (object.ERROR_CODE, ))

        for par in [
                "_number_of_grid_intervals", "_order_of_multipole_expansion",
                "_number_of_radial_steps_correction_fns",
                "_number_of_iterations", "_halo_number_of_particles",
                "_halo_random_seed", "_bulge_number_of_particles",
                "_bulge_random_seed", "_disk_number_of_particles",
                "_disk_random_seed", "_inner_cusp_slope", "_outer_slope",
                "_Sersic_index_n", "_central_radial_vel_dispersion",
                "_halo_streaming_fraction", "_bulge_streaming_fraction"
        ]:
            object.add_method("get" + par, (), (
                object.NO_UNIT,
                object.ERROR_CODE,
            ))
            object.add_method("set" + par, (object.NO_UNIT, ),
                              (object.ERROR_CODE, ))

        for par in [
                "_halo_outer_radius", "_scale_radius", "_truncation_delta_r",
                "_disk_scale_length", "_disk_outer_radius",
                "_disk_scale_height_sech2", "_disk_truncation_dr",
                "_bulge_scale_radius", "_radial_grid_delta_r",
                "_scale_length_of_sigR2"
        ]:
            object.add_method("get" + par, (), (
                nbody_system.length,
                object.ERROR_CODE,
            ))
            object.add_method("set" + par, (nbody_system.length, ),
                              (object.ERROR_CODE, ))

        for par in ["_scale_velocity", "_bulge_velocity"]:
            object.add_method("get" + par, (), (
                nbody_system.speed,
                object.ERROR_CODE,
            ))
            object.add_method("set" + par, (nbody_system.speed, ),
                              (object.ERROR_CODE, ))

        object.add_method("get_disk_mass", (), (
            nbody_system.mass,
            object.ERROR_CODE,
        ))
        object.add_method("set_disk_mass", (nbody_system.mass, ),
                          (object.ERROR_CODE, ))
Beispiel #19
0
    def define_methods(self, handler):
        CommonCode.define_methods(self, handler)
        handler.add_method('evolve_model', (units.Myr, ),
                           (handler.ERROR_CODE, ))
        handler.add_method(
            "new_particle",
            (units.parsec, units.parsec, units.parsec, units.amu / units.cm**3,
             1.0e48 / units.s, handler.NO_UNIT, units.cm**2 / units.s**2,
             handler.NO_UNIT), (
                 handler.INDEX,
                 handler.ERROR_CODE,
             ))

        handler.add_method("delete_particle", (handler.NO_UNIT, ),
                           (handler.ERROR_CODE, ))
        handler.add_method(
            "get_state", (handler.NO_UNIT, ),
            (units.parsec, units.parsec, units.parsec, units.amu / units.cm**3,
             1.0e48 / units.s, handler.NO_UNIT, units.cm**2 / units.s**2,
             handler.NO_UNIT, handler.ERROR_CODE))
        handler.add_method(
            "set_state",
            (handler.NO_UNIT, units.parsec, units.parsec, units.parsec,
             units.amu / units.cm**3, 1.0e48 / units.s, handler.NO_UNIT,
             units.cm**2 / units.s**2, handler.NO_UNIT), (handler.ERROR_CODE))
        handler.add_method("get_internal_energy", (handler.NO_UNIT, ),
                           (units.cm**2 / units.s**2, handler.ERROR_CODE))
        handler.add_method("set_internal_energy", (
            handler.NO_UNIT,
            units.cm**2 / units.s**2,
        ), (handler.ERROR_CODE))
        handler.add_method("get_dinternal_energy_dt", (handler.NO_UNIT, ),
                           (units.cm**2 / units.s**3, handler.ERROR_CODE))
        handler.add_method("set_dinternal_energy_dt", (
            handler.NO_UNIT,
            units.cm**2 / units.s**3,
        ), (handler.ERROR_CODE))
        handler.add_method("set_position", (
            handler.NO_UNIT,
            units.parsec,
            units.parsec,
            units.parsec,
        ), (handler.ERROR_CODE))
        handler.add_method(
            "get_position", (handler.NO_UNIT, ),
            (units.parsec, units.parsec, units.parsec, handler.ERROR_CODE))
        handler.add_method("set_density", (
            handler.NO_UNIT,
            units.amu / units.cm**3,
        ), (handler.ERROR_CODE))
        handler.add_method("get_density", (handler.NO_UNIT, ),
                           (units.amu / units.cm**3, handler.ERROR_CODE))
        handler.add_method("set_flux", (
            handler.NO_UNIT,
            1.0e48 / units.s,
        ), (handler.ERROR_CODE))
        handler.add_method("get_flux", (handler.NO_UNIT, ),
                           (1.0e48 / units.s, handler.ERROR_CODE))
        handler.add_method("get_mean_intensity", (handler.NO_UNIT, ),
                           (1.0e48 / units.s, handler.ERROR_CODE))
        handler.add_method("get_diffuse_intensity", (handler.NO_UNIT, ),
                           (1.0e48 / units.s, handler.ERROR_CODE))
        handler.add_method("set_ionisation",
                           (handler.NO_UNIT, handler.NO_UNIT),
                           (handler.ERROR_CODE))
        handler.add_method("get_ionisation", (handler.NO_UNIT, ),
                           (handler.NO_UNIT, handler.ERROR_CODE))
        handler.add_method("set_metallicity",
                           (handler.NO_UNIT, handler.NO_UNIT),
                           (handler.ERROR_CODE))
        handler.add_method("get_metallicity", (handler.NO_UNIT, ),
                           (handler.NO_UNIT, handler.ERROR_CODE))
        handler.add_method('commit_particles', (), (handler.ERROR_CODE))
        handler.add_method('recommit_particles', (), (handler.ERROR_CODE))

        handler.add_method("get_timestep", (), (
            units.Myr,
            handler.ERROR_CODE,
        ))

        handler.add_method("set_timestep", (units.Myr, ),
                           (handler.ERROR_CODE, ))

        handler.add_method("get_source_Teff", (), (
            units.K,
            handler.ERROR_CODE,
        ))

        handler.add_method("set_source_Teff", (units.K, ),
                           (handler.ERROR_CODE, ))

        handler.add_method("get_hilbert_order", (), (
            handler.NO_UNIT,
            handler.ERROR_CODE,
        ))

        handler.add_method("set_hilbert_order", (handler.NO_UNIT, ),
                           (handler.ERROR_CODE, ))

        handler.add_method("set_blackbody_spectrum", (handler.NO_UNIT, ),
                           (handler.ERROR_CODE, ))

        handler.add_method("get_blackbody_spectrum", (), (
            handler.NO_UNIT,
            handler.ERROR_CODE,
        ))

        handler.add_method("get_thermal_evolution", (), (
            handler.NO_UNIT,
            handler.ERROR_CODE,
        ))

        handler.add_method("set_thermal_evolution", (handler.NO_UNIT, ),
                           (handler.ERROR_CODE, ))

        handler.add_method("get_collisional_ionization", (), (
            handler.NO_UNIT,
            handler.ERROR_CODE,
        ))

        handler.add_method("set_collisional_ionization", (handler.NO_UNIT, ),
                           (handler.ERROR_CODE, ))

        handler.add_method("get_number_frequency_bins", (), (
            handler.NO_UNIT,
            handler.ERROR_CODE,
        ))

        handler.add_method("set_number_frequency_bins", (handler.NO_UNIT, ),
                           (handler.ERROR_CODE, ))

        handler.add_method("get_metal_cooling", (), (
            handler.NO_UNIT,
            handler.ERROR_CODE,
        ))

        handler.add_method("set_metal_cooling", (handler.NO_UNIT, ),
                           (handler.ERROR_CODE, ))

        handler.add_method("get_recombination_radiation", (), (
            handler.NO_UNIT,
            handler.ERROR_CODE,
        ))

        handler.add_method("set_recombination_radiation", (handler.NO_UNIT, ),
                           (handler.ERROR_CODE, ))

        handler.add_method("get_box_size", (), (
            units.parsec,
            handler.ERROR_CODE,
        ))

        handler.add_method("set_box_size", (units.parsec, ),
                           (handler.ERROR_CODE, ))

        handler.add_method('get_time', (), (
            units.s,
            handler.ERROR_CODE,
        ))
        handler.add_method('set_time', (units.s, ), (handler.ERROR_CODE, ))

        handler.add_method("get_simplex_data_directory", (), (
            handler.NO_UNIT,
            handler.ERROR_CODE,
        ))

        handler.add_method("set_simplex_data_directory", (handler.NO_UNIT, ),
                           (handler.ERROR_CODE, ))
Beispiel #20
0
    def define_methods(self, object):
        CommonCode.define_methods(self, object)
        object.add_method('evolve_model', (units.Myr,), ( object.ERROR_CODE, ))
        object.add_method(
            "new_particle",
            (
                units.parsec,
                units.parsec,
                units.parsec,
                units.amu / units.cm**3,
                1.0e48 / units.s,
                object.NO_UNIT,
                units.cm**2 / units.s**2,
                object.NO_UNIT
                ),
            (
                object.INDEX,
                object.ERROR_CODE,
                )
            )
        
        object.add_method(
            "delete_particle",
            (
                object.NO_UNIT,
                ),
            (
                object.ERROR_CODE,
                )
            )
        object.add_method(
            "get_state",
            (
                object.NO_UNIT,
                ),
            (
                units.parsec,
                units.parsec,
                units.parsec,
                units.amu / units.cm**3,
                1.0e48 / units.s,
                object.NO_UNIT,
                units.cm**2 / units.s**2,
                object.NO_UNIT,
                object.ERROR_CODE
                )
            )
        object.add_method(
            "set_state",
            (
                object.NO_UNIT,
                units.parsec,
                units.parsec,
                units.parsec,
                units.amu / units.cm**3,
                1.0e48 / units.s,
                object.NO_UNIT,
                units.cm**2 / units.s**2,
                object.NO_UNIT
                ),
            (
                object.ERROR_CODE
                )
            )
        object.add_method(
            "get_internal_energy",
            (
                object.NO_UNIT,
                ),
            (
                units.cm**2 / units.s**2,
                object.ERROR_CODE
                )
            )
        object.add_method(
            "set_internal_energy",
            (
                object.NO_UNIT,
                units.cm**2 / units.s**2,
                ),
            (
                object.ERROR_CODE
                )
            )
        object.add_method(
            "get_dinternal_energy_dt",
            (
                object.NO_UNIT,
                ),
            (
                units.cm**2 / units.s**3,
                object.ERROR_CODE
                )
            )
        object.add_method(
            "set_dinternal_energy_dt",
            (
                object.NO_UNIT,
                units.cm**2 / units.s**3,
                ),
            (
                object.ERROR_CODE
                )
            )
        object.add_method(
            "set_position",
            (
                object.NO_UNIT,
                units.parsec,
                units.parsec,
                units.parsec,
                ),
            (
                object.ERROR_CODE
                )
            )
        object.add_method(
            "get_position",
            (
                object.NO_UNIT,
                ),
            (
                units.parsec,
                units.parsec,
                units.parsec,
                object.ERROR_CODE
                )
            )
        object.add_method(
            "set_density",
            (
                object.NO_UNIT,
                units.amu / units.cm**3,
            ),
            (
                object.ERROR_CODE
            )
        )
        object.add_method(
            "get_density",
            (
                object.NO_UNIT,
            ),
            (
                units.amu / units.cm**3,
                object.ERROR_CODE
            )
        )
        object.add_method(
            "set_flux",
            (
                object.NO_UNIT,
                1.0e48 / units.s,
            ),
            (
                object.ERROR_CODE
            )
        )
        object.add_method(
            "get_flux",
            (
                object.NO_UNIT,
            ),
            (
                1.0e48 / units.s,
                object.ERROR_CODE
            )
        )
        object.add_method(
            "get_mean_intensity",
            (
                object.NO_UNIT,
            ),
            (
                1.0e48 / units.s,
                object.ERROR_CODE
            )
        )
        object.add_method(
            "get_diffuse_intensity",
            (
                object.NO_UNIT,
            ),
            (
                1.0e48 / units.s,
                object.ERROR_CODE
            )
        )        
        object.add_method(
            "set_ionisation",
            (
                object.NO_UNIT,
                object.NO_UNIT
            ),
            (
                object.ERROR_CODE
            )
        )
        object.add_method(
            "get_ionisation",
            (
                object.NO_UNIT,
            ),
            (
                object.NO_UNIT,
                object.ERROR_CODE
            )
        )
        object.add_method(
            "set_metallicity",
            (
                object.NO_UNIT,
                object.NO_UNIT
            ),
            (
                object.ERROR_CODE
            )
        )
        object.add_method(
            "get_metallicity",
            (
                object.NO_UNIT,
            ),
            (
                object.NO_UNIT,
                object.ERROR_CODE
            )
        )
        object.add_method(
            'commit_particles',
            (),
            (object.ERROR_CODE)
        )
        object.add_method(
            'recommit_particles',
            (),
            (object.ERROR_CODE)
        )
    
        object.add_method(
            "get_timestep",
            (),
            (units.Myr, object.ERROR_CODE,)
        )
    
        object.add_method(
            "set_timestep",
            (units.Myr, ),
            (object.ERROR_CODE,)
        )

        object.add_method(
            "get_source_Teff",
            (),
            (units.K, object.ERROR_CODE,)
        )
    
        object.add_method(
            "set_source_Teff",
            (units.K, ),
            (object.ERROR_CODE,)
        )

    
        object.add_method(
            "get_hilbert_order",
            (),
            (object.NO_UNIT, object.ERROR_CODE,)
        )
    
        object.add_method(
            "set_hilbert_order",
            (object.NO_UNIT, ),
            (object.ERROR_CODE,)
        )
    
        object.add_method(
            "set_blackbody_spectrum",
            (object.NO_UNIT, ),
            (object.ERROR_CODE,)
        )

        object.add_method(
            "get_blackbody_spectrum",
            (),
            (object.NO_UNIT, object.ERROR_CODE,)
        )


        object.add_method(
            "get_thermal_evolution",
            (),
            (object.NO_UNIT, object.ERROR_CODE,)
        )
    
        object.add_method(
            "set_thermal_evolution",
            (object.NO_UNIT, ),
            (object.ERROR_CODE,)
        )

        object.add_method(
            "get_collisional_ionization",
            (),
            (object.NO_UNIT, object.ERROR_CODE,)
        )
    
        object.add_method(
            "set_collisional_ionization",
            (object.NO_UNIT, ),
            (object.ERROR_CODE,)
        )

        object.add_method(
            "get_number_frequency_bins",
            (),
            (object.NO_UNIT, object.ERROR_CODE,)
        )
    
        object.add_method(
            "set_number_frequency_bins",
            (object.NO_UNIT, ),
            (object.ERROR_CODE,)
        )


        object.add_method(
            "get_metal_cooling",
            (),
            (object.NO_UNIT, object.ERROR_CODE,)
        )
    
        object.add_method(
            "set_metal_cooling",
            (object.NO_UNIT, ),
            (object.ERROR_CODE,)
        )

        
        object.add_method(
            "get_recombination_radiation",
            (),
            (object.NO_UNIT, object.ERROR_CODE,)
        )
    
        object.add_method(
            "set_recombination_radiation",
            (object.NO_UNIT, ),
            (object.ERROR_CODE,)
        )
    
        object.add_method(
            "get_box_size",
            (),
            (units.parsec, object.ERROR_CODE,)
        )
    
        object.add_method(
            "set_box_size",
            (units.parsec, ),
            (object.ERROR_CODE,)
        )

        object.add_method(
            'get_time',
            (),
            (units.s,object.ERROR_CODE,)
        )
        object.add_method(
            'set_time',
            (units.s,),
            (object.ERROR_CODE,)
        )

        object.add_method(
            "get_simplex_data_directory",
            (),
            (object.NO_UNIT, object.ERROR_CODE,)
        )
        
        object.add_method(
            "set_simplex_data_directory",
            (object.NO_UNIT,),
            (object.ERROR_CODE,)
        )
Beispiel #21
0
 def define_methods(self, handler):
     CommonCode.define_methods(self, handler)
Beispiel #22
0
 def define_methods(self, object):
     CommonCode.define_methods(self, object)
     object.add_method(
         'evolve_model', 
         (
             units.s,
         ), 
         (
             object.ERROR_CODE,
         )
     )
     object.add_method(
         "new_particle",
         (
             units.cm**-3,
             units.K,
             units.s**-1,
         ),
         (
             object.INDEX,
             object.ERROR_CODE,
         )
     )
     object.add_method(
         "set_state",
         (
             object.NO_UNIT,
             units.cm**-3,
             units.K,
             units.s**-1,
         ),
         (
             object.ERROR_CODE,
         )
     )
     object.add_method(
         "get_state",
         (
             object.INDEX,
         ),
         (
             units.cm**-3,
             units.K,
             units.s**-1,
             object.ERROR_CODE,
         )
     )
     object.add_method(
         "get_abundance",
         (
             object.INDEX,
             object.INDEX,
         ),
         (
             object.NO_UNIT,
             object.ERROR_CODE,
         )
     )
     object.add_method(
         "set_abundance",
         (
             object.INDEX,
             object.INDEX,
             object.NO_UNIT,
         ),
         (
             object.ERROR_CODE,
         )
     )
     object.add_method(
         "delete_particle",
         (
             object.INDEX,
         ),
         (
             object.ERROR_CODE,
         )
     )
     object.add_method(
         "get_firstlast_abundance",
         (
         ),
         (
             object.NO_UNIT,
             object.NO_UNIT,
             object.ERROR_CODE,
         )
     )
     object.add_method(
         "get_time",
         (
         ),
         (
             units.s,
             object.ERROR_CODE,
         )
     )