Examples of HDF5Dataset


Examples of pymontecarlo.util.hdf5.HDF5Dataset

        super.saveResults(root, key);

        HDF5Group group = root.requireSubgroup(key);

        String transitionName;
        HDF5Dataset ds;
        int[][] emptyData = new int[][] { { 0 } };
        for (XRayTransition transition : transitions) {
            transitionName = transition.getIUPACName();

            ds = group.createDataset(transitionName, emptyData);

            ds.setAttribute("gnf", gnfIntensities.get(transition), 0.0);
            ds.setAttribute("enf", enfIntensities.get(transition), 0.0);
            ds.setAttribute("et", etIntensities.get(transition), 0.0);
        }
    }
View Full Code Here

Examples of pymontecarlo.util.hdf5.HDF5Dataset

        Trajectory trajectory;
        String name;
        double[][] data;
        int interactionsSize;
        Double[] interaction;
        HDF5Dataset dataset;
        for (int i = 0; i < trajectories.size(); i++) {
            trajectory = trajectories.get(i);

            name = "trajectory" + i;

            interactionsSize = trajectory.interactions.size();
            data = new double[interactionsSize][6];
            for (int j = 0; j < interactionsSize; j++) {
                interaction = trajectory.interactions.get(j);
                data[j][0] = interaction[0];
                data[j][1] = interaction[1];
                data[j][2] = interaction[2];
                data[j][3] = interaction[3];
                data[j][4] = interaction[4];
                data[j][5] = interaction[5];
            }

            dataset = group.createDataset(name, data);

            dataset.setAttribute("primary", trajectory.primary ? 1 : 0);
            dataset.setAttribute("particle", 1); // Electron
            dataset.setAttribute("collision", trajectory.collision);
            dataset.setAttribute("exit_state", trajectory.exitState);
        }
    }
View Full Code Here

Examples of pymontecarlo.util.hdf5.HDF5Dataset

        HDF5Group group = root.requireSubgroup(key);

        double normFactor = (double) trajectoryCount;

        String transitionName;
        HDF5Dataset ds;
        double gcf, gbf, gnf;
        double ecf, ebf, enf;
        int[][] emptyData = new int[][] { { 0 } };
        for (XRayTransition transition : accumCharac.getTransitions()) {
            transitionName = transition.getIUPACName();

            ds = group.createDataset(transitionName, emptyData);

            gnf = accumCharac.getGenerated(transition) / normFactor;
            enf = accumCharac.getEmitted(transition) / normFactor;

            gcf = ecf = 0.0;
            if (accumCharacFluo != null) {
                gcf = accumCharacFluo.getGenerated(transition) / normFactor;
                ecf = accumCharacFluo.getEmitted(transition) / normFactor;
            }

            gbf = ebf = 0.0;
            if (accumBremssFluo != null) {
                gbf = accumBremssFluo.getGenerated(transition) / normFactor;
                ebf = accumBremssFluo.getEmitted(transition) / normFactor;
            }

            ds.setAttribute("gcf", gcf, 0.0);
            ds.setAttribute("gbf", gbf, 0.0);
            ds.setAttribute("gnf", gnf, 0.0);
            ds.setAttribute("gt", gnf + gcf + gbf, 0.0);

            ds.setAttribute("ecf", ecf, 0.0);
            ds.setAttribute("ebf", ebf, 0.0);
            ds.setAttribute("enf", enf, 0.0);
            ds.setAttribute("et", enf + ecf + ebf, 0.0);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.