pymchelper.readers.shieldhit package#
Submodules#
pymchelper.readers.shieldhit.binary_spec module#
- class pymchelper.readers.shieldhit.binary_spec.SHBDOTagID(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
 Bases:
IntEnumList of Tag ID numbers for BDO 2016 and 2019 formats. Must be synchronized with tags in sh_bdo.h and sh_detect.h in SH12A.
- apro0 = 51969#
 
- apzlscl = 52234#
 
- beamdivk = 51982#
 
- beamdivx = 51980#
 
- beamdivy = 51981#
 
- beamphi = 51979#
 
- beamtheta = 51978#
 
- beamx = 51971#
 
- beamy = 51972#
 
- beamz = 51973#
 
- comment = 65484#
 
- ct_ang = 52736#
 
- ct_icnt = 52737#
 
- ct_len = 52738#
 
- data_block = 56763#
 
- debug = 65485#
 
- dele = 52224#
 
- demin = 52225#
 
- det_dif_start = 56590#
 
- det_dif_stop = 56591#
 
- det_difftype = 56584#
 
- det_dmat = 56582#
 
- det_dsize = 56586#
 
- det_dsizexyz = 56587#
 
- det_dtype = 56579#
 
- det_geotyp = 56576#
 
- det_nbin = 56577#
 
- det_nbine = 56583#
 
- det_part = 56578#
 
- det_parta = 56581#
 
- det_partz = 56580#
 
- det_thresh = 56593#
 
- det_voxvol = 56592#
 
- det_xyz_start = 56588#
 
- det_xyz_stop = 56589#
 
- det_zonestart = 56585#
 
- detector_type = 56624#
 
- detector_unit = 56764#
 
- error = 65486#
 
- estimator_number = 60929#
 
- estimator_rescale_per_particle = 60931#
 
- ext_nproj = 52239#
 
- ext_ptvdose = 52240#
 
- filedate = 2#
 
- filename_or_geotype = 60928#
 
- format = 5#
 
- geo_n_bins = 57348#
 
- geo_non_equidist_grid = 57352#
 
- geo_p_start = 57346#
 
- geo_q_stop = 57347#
 
- geo_rotation = 57349#
 
- geo_unit_ids = 57354#
 
- geo_units = 57353#
 
- geo_volume = 57350#
 
- geo_zones = 57351#
 
- geometry_name = 57345#
 
- geometry_type = 57344#
 
- host = 4#
 
- iemtrans = 52230#
 
- iextspec = 52231#
 
- intrfast = 52232#
 
- intrslow = 52233#
 
- inucre = 52229#
 
- ioffset = 52235#
 
- irifimc = 52236#
 
- irifitrans = 52237#
 
- irifizone = 52238#
 
- itypms = 52227#
 
- itypst = 52226#
 
- ixfirs = 52241#
 
- jpart0 = 51968#
 
- number_of_pages = 60930#
 
- oln = 52228#
 
- page_diff_flag = 56784#
 
- page_diff_size = 56788#
 
- page_diff_start = 56786#
 
- page_diff_stop = 56787#
 
- page_diff_type = 56785#
 
- page_diff_units = 56789#
 
- page_filter_e_min = 56818#
 
- page_filter_emax = 56819#
 
- page_filter_name = 56816#
 
- page_filter_rules_no = 56817#
 
- page_medium_scoring = 56630#
 
- page_medium_transport = 56629#
 
- page_normalized = 56626#
 Given: - the data in page->data as x_j - for j instances of this simulation - which was done with I_j number of paritcles.
The resulting data will be termed X and has the units given by SHBDO_PAG_DATA_UNIT
0: X = x_1 for GEOMAP type scorers 1: X = sum_j x_j COUNT, … 2: X = (sum_j x_j) / (sum_j I_j) NORMCOUNT, … 3: X = (sum_j x_j * I_j) / (sum_j I_j) LET, …
- page_number = 56625#
 
- page_offset = 56628#
 
- page_scale_factor = 56627#
 
- page_unit_ids = 56631#
 
- phase_space_population = 56800#
 
- rt_nstat = 43520#
 
- rt_time = 43521#
 
- rt_timesim = 43522#
 
- shbuilddate = 1#
 
- shversion = 0#
 
- sigmat0 = 51977#
 
- sigmax = 51974#
 
- sigmay = 51975#
 
- tmax0 = 51976#
 
- tmax0amu = 51984#
 
- tmax0mev = 51983#
 
- tmax0nuc = 51985#
 
- user = 3#
 
- zpro0 = 51970#
 
- class pymchelper.readers.shieldhit.binary_spec.SHBDOUnitID(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
 Bases:
IntEnum- SH_SCORING_UNIT_AU = 1#
 
- SH_SCORING_UNIT_CM = 10#
 
- SH_SCORING_UNIT_CM2 = 11#
 
- SH_SCORING_UNIT_CM3 = 12#
 
- SH_SCORING_UNIT_COUNT = 60#
 
- SH_SCORING_UNIT_DEGREES = 50#
 
- SH_SCORING_UNIT_DOSERAD = 45#
 
- SH_SCORING_UNIT_DOSEREM = 46#
 
- SH_SCORING_UNIT_GPCM3 = 22#
 
- SH_SCORING_UNIT_GY = 41#
 
- SH_SCORING_UNIT_GYRBE = 42#
 
- SH_SCORING_UNIT_GYRE = 43#
 
- SH_SCORING_UNIT_INVALID = -1#
 
- SH_SCORING_UNIT_KEVPUM = 30#
 
- SH_SCORING_UNIT_KGPM3 = 23#
 
- SH_SCORING_UNIT_M = 16#
 
- SH_SCORING_UNIT_M2 = 17#
 
- SH_SCORING_UNIT_M3 = 18#
 
- SH_SCORING_UNIT_MATID = 90#
 
- SH_SCORING_UNIT_MEV = 70#
 
- SH_SCORING_UNIT_MEVCM2PG = 32#
 
- SH_SCORING_UNIT_MEVPAMU = 72#
 
- SH_SCORING_UNIT_MEVPC2 = 81#
 
- SH_SCORING_UNIT_MEVPCM = 31#
 
- SH_SCORING_UNIT_MEVPG = 40#
 
- SH_SCORING_UNIT_MEVPNUC = 71#
 
- SH_SCORING_UNIT_NONE = 0#
 
- SH_SCORING_UNIT_NUCN = 80#
 
- SH_SCORING_UNIT_NZONE = 91#
 
- SH_SCORING_UNIT_PCM = 13#
 
- SH_SCORING_UNIT_PCM2 = 14#
 
- SH_SCORING_UNIT_PCM3 = 15#
 
- SH_SCORING_UNIT_PCT = 2#
 
- SH_SCORING_UNIT_PM = 19#
 
- SH_SCORING_UNIT_PM2 = 20#
 
- SH_SCORING_UNIT_PM3 = 21#
 
- SH_SCORING_UNIT_PMIL = 3#
 
- SH_SCORING_UNIT_RADIANS = 51#
 
- SH_SCORING_UNIT_RELATIVE = 4#
 
- SH_SCORING_UNIT_SR = 52#
 
- SH_SCORING_UNIT_SV = 44#
 
- SH_SCORING_UNIT_U = 82#
 
- SH_SCORING_UNIT_UNKNOWN = -2#
 
pymchelper.readers.shieldhit.general module#
- class pymchelper.readers.shieldhit.general.SHFileFormatId(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
 Bases:
IntEnumSHIELD-HIT12A file format ids, as described in sh_file_format.h file
- ascii = 3#
 
- bdo2016 = 1#
 
- bdo2019 = 2#
 
- bin2010 = 0#
 
- csv = 4#
 
- class pymchelper.readers.shieldhit.general.SHReaderASCII(filename)[source]#
 Bases:
objectReads plain text files with data saved by binary-to-ascii converter.
- class pymchelper.readers.shieldhit.general.SHReaderFactory(filename)[source]#
 Bases:
ReaderFactory
- pymchelper.readers.shieldhit.general.extract_sh_ver(file_path: PathLike) str[source]#
 BDO binary files, introduced in 2016 (BDO2016 and BDO2019 formats) contain information about SH VER :param filename: Binary file filename :return: SH12 version (as a string, i.e. 0.7) or None if version information was not found in the file
pymchelper.readers.shieldhit.reader_base module#
- class pymchelper.readers.shieldhit.reader_base.SHReader(filename)[source]#
 Bases:
ReaderReads binary output files generated by SHIELD-HIT12A code.
- property corename: str#
 Extracts and returns the “corename” of the file, which is a base name stripped of any trailing 4-digit integers and underscores. This method is applicable to files with extensions .bdo or .bdox.
The expected file naming conventions are: - corenameABCD.bdo or corename_ABCD.bdo (where ABCD is a 4-digit integer) - corename.bdo
If the file does not follow these conventions or has a different extension, an empty string is returned.
- Returns:
 The corename of the file, or an empty string if the extension is invalid.