Skip to content
Discussion options

You must be logged in to vote

Thanks for the question @AmChamb ! This is in fact pretty simple to do if you are able and willing to compile a small C programme, like @ebknudsen said. The C-code itself is basically the example at https://mctools.github.io/mcpl/usage_c/#extracting-subset-of-particles-from-file but with the filtering if-statement changed to reflect your desired requirement of having a nonzero particle weight.

So in a file called myfilter.c put the following code:

#include "mcpl.h"
#include <stdio.h>

int main(int argc,char**argv) {
  if (argc!=3) {
    printf("Please supply input and output filenames\n");
    return 1;
  }
  const char * infilename = argv[1];
  const char * outfilename = argv[2];
  mcpl_…

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@tkittel
Comment options

@willend
Comment options

willend Nov 12, 2025
Collaborator

@tkittel
Comment options

@willend
Comment options

willend Nov 13, 2025
Collaborator

Comment options

You must be logged in to vote
1 reply
@AmChamb
Comment options

Answer selected by AmChamb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants