icecube.simprod.jcorsika.corsika_options.coconut_options module

class icecube.simprod.jcorsika.corsika_options.coconut_options.CoconutOption(name, group, const, help, requires, conflicts)

Bases: tuple

conflicts

Alias for field number 5

const

Alias for field number 2

group

Alias for field number 1

help

Alias for field number 3

name

Alias for field number 0

requires

Alias for field number 4

class icecube.simprod.jcorsika.corsika_options.coconut_options.CoconutOptionCollection(version)

Bases: object

Class to handle the conversion from a human-readable option format (for optparse) and the options to be used with coconut. The actual options in coconut are version-dependent, so one needs to create an instance of this class for each version.

The available versions are stored in the available_versions data member.

available_versions = ['73700', '74005', '75000', '75600', '75700']
get_coconut_options(options)

Convert a dictionary of options (in a readable format) to the actual option values used in coconut. The options in coconut change with versions.

This function converts something like this (from option parsing or whatever):

{ 'float': 'float_default',
  'he_model': 'sibyll',
  'le_model': 'fluka',
  'geometry': 'flat',
  'other': ['slant', 'neutrino', 'muprod', 'history']
}

into something like this (actual coconut options):

{ 'float': '2',
  'geometry': '1',
  'he_model': '6',
  'le_model': '2',
  'other': ['9', '6', 'i', 's']
}

Note that each key corresponds to a section in coconut.

name_from_option = None
name_from_options(opt, names=False)

Name of an executable from the compile options.

Input options like this:

{ 'float': '2',
  'geometry': '1',
  'he_model': '6',
  'le_model': '2',
  'other': ['9', '6', 'i', 's']
}
result in names like this:

‘2_6_2_1_6_9_i_s’

if names==True, the output looks more like this:

‘float_default_sibyll_fluka_flat_neutrino_slant_muprod_history’

old_name_from_options(options)

Name of an executable from the compile options using the old convention.

Older tarballs have executables with names like these:

corsika73700Linux_EPOS_fluka_curved
corsika73700Linux_EPOS_fluka_thin
corsika73700Linux_EPOS_fluka_curved_thin
corsika73700Linux_EPOS_fluka

Note that the names of the models do not correspond to my “standard” names

option_from_name = None
options = None
options_from_name(name, names=False)

Compile options of an executable from its name.

Input like this:

'2_6_2_1_6_9_i_s'

result in options like this:

{ 'float': '2',
  'geometry': '1',
  'he_model': '6',
  'le_model': '2',
  'other': ['9', '6', 'i', 's']
}

if names==True, the output looks more like this:

{ 'float': 'float_default',
  'geometry': 'flat',
  'he_model': 'sibyll',
  'le_model': 'fluka',
  'other': ['neutrino', 'slant', 'muprod', 'history']
}