icecube / corsika_reader Goto Github PK
View Code? Open in Web Editor NEWLicense: BSD 2-Clause "Simplified" License
License: BSD 2-Clause "Simplified" License
We already have a Corsika namespace so we should remove the Corsika prefix from type names.
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); }
These create compiler warnings that look bad during code review.
For reading data from files, streams are customarily used.
Remove Corsika prefix.
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.
Asserts, used in the tests are currently begin disabled by CMake.
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
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?
We should probably try to thing about some common use cases for Corsika Reader and make some examples for these use cases.
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:
Currently we use many different methods of error handling:
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.
Check if file is pipe and flag as not seekable if needed.
Something like:
S_ISFIFO(s.st_mode) || S_ISSOCK(s.st_mode)
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
As far as I can tell RawFile is simply a wrapper around VRawStream.
Is there any reason to keep it? @javierggt
Currently the file is opened an extra time to check the format spec.
Maybe copy this data to the first block instead?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.