Code Monkey home page Code Monkey logo

corsika_reader's People

Contributors

javierggt avatar matthiasplum avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

corsika_reader's Issues

Rename types

We already have a Corsika namespace so we should remove the Corsika prefix from type names.

Questionable Use of Types

We should always use size_t not int or float whenever referring to a quantity of something.
E.g.
int i = auxDepth.size();
int size() const { return int(fN); }

ShowerParticleList.h missing

Hello,

The example in /share/examples/cpp/example_1 is not working because there's no ShowerParticleList.h. Here's the error:


fatal error: corsika/ShowerParticleList.h: No such file or directory
compilation terminated.

I'm using the tagged version.

Consistent Formatting

We need to decide on a coding style. Personally it seems strange to put the return type on another line like:
void
CorsikaShowerFile::Close()
Also stuff like indentation should be consistent.

It also seems sloppy to put editor specific code in the source like:
// Configure (x)emacs for this file ...
// Local Variables:
// mode:c++
// compile-command: "make -C .. -k"
// End:

Also "#pragma once" should probably be preferred to:
#ifndef io_CorsikaShower_h
#define io_CorsikaShower_h

Logging

Would it be sufficient just to define a few global functions that print to stdout like the following?
log_info(...)
log_warning(...)
log_error(...)

Or maybe would we also want to print the source file and line number?

IceTop detector simulation: I3CorsikaInjector and .bz2 files

Moving this from Trac.

Hi everyone,
i have a technical question concerning the read-in of compressed CORSIKA files (.bz2) for the IceTop? detector simulation. I use the simulation sets 10410 and 10889.
I learned that the current version of the I3CorsikaInjector can not treat bz2 files.
Thus i build the following solution:

  1. Copy the compressed CORSIKA file .bz2 file to my directory
  2. Unpack it
  3. Use it
  4. Delete it
    This solution works fine but it is very, very time consuming. Copying & unpacking bz2 files limits the number of jobs i can run in parallel to a very small number because i easily exceed 1TB (i already have some hundreds of GB of data which i really need). I want to run more jobs in parallel, because otherwise i still need months to finish my detector simulation. I do not have this time :(
    The detector simulation i do bases on the detector response of different particle types (separately!) and anyway takes more time than a "usual" simulation.
    Is there a solution? Are there some lines of code i can add in order to make I3CorsikaInjector treat .bz2 files? I heard that it may be possible when "if stream" is changed to "boost::iostreams::filtering_istream", but i am completely unfamiliar with this.
    Can you please help me?
    Cheers, Daniel

Error handling

Currently we use many different methods of error handling:

  1. CorsikaIOException
  2. enum Status
  3. INFO, ERROR, FATAL

The main question for designing a error handling API is whether we need to recover from and error.
If we need to recover, we should probably use CorsikaIOException and use try{} as needed.
Otherwise we could just use an assert-like method that prints a message and aborts on error.

Disable seeking if pipe

Check if file is pipe and flag as not seekable if needed.
Something like:
S_ISFIFO(s.st_mode) || S_ISSOCK(s.st_mode)

RawParticleIterator & ShowerFileParticleIterator not usable with python3

The simple example code

raw = corsika.RawStream(filename)
block = corsika.Block()
raw.get_next_block(block)
print(block.ID)
raw.get_next_block(block)
print(block.ID)
particles = raw.particles()

for p in particles:
      print(p)

is causing an error message for the particle iterator

RUNH
EVTH
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Input In [4], in <cell line: 15>()
     11 print(block.ID)
     13 particles = raw.particles()
---> 15 for p in particles:
     16       print(p)

TypeError: iter() returned non-iterator of type 'RawParticleIterator'

Same error for ShowerFileParticleIterator. Most likely due to python3

Avoid Reopening File

Currently the file is opened an extra time to check the format spec.
Maybe copy this data to the first block instead?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.