Commit f8dc3694 authored by Lukasz Waskiewicz's avatar Lukasz Waskiewicz
Browse files

refs #1494 obliczeine redshiftMax

parent 9f49dd3a
......@@ -114,6 +114,10 @@ public class DataMappingProcessor implements ItemProcessor<Hdf5Group, Data> {
if (metadata.containsColumn("mainBranchMaximumVmax")) {
node.setMainBranchMaximumVmax(getDoubleFromRow(metadata, nodeRow, "mainBranchMaximumVmax"));
}
//not sure what the column name is
if (metadata.containsColumn("mainBranchMaximumRedshift")) {
node.setRedshiftMax(getDoubleFromRow(metadata, nodeRow, "mainBranchMaximumRedshift"));
}
double[] angularMomentum = nodeRow.getDoubleArray(metadata, "angularMomentum");
node.setAngularMomentum_x(angularMomentum[0]);
node.setAngularMomentum_y(angularMomentum[1]);
......
......@@ -18,6 +18,9 @@ public class MergerTreeNode extends Hdf5 {
private long descendantHostIndex;
private long descendantSnapshot;
private double redshift;
private double redshiftMax;
public MergerTreeNode() {
}
......@@ -31,6 +34,8 @@ public class MergerTreeNode extends Hdf5 {
this.descendantHostIndex = node.descendantHostIndex;
this.descendantSnapshot = node.descendantSnapshot;
this.isInterpolated = node.isInterpolated;
this.redshift = node.redshift;
this.redshiftMax = node.redshiftMax;
}
public MergerTreeNode(Node node) {
......@@ -43,6 +48,8 @@ public class MergerTreeNode extends Hdf5 {
this.descendantHostIndex = node.getHostIndex();
this.descendantSnapshot = node.getDescendantSnapshot();
this.isInterpolated = node.getIsInterpolated();
this.redshift = node.getRedshift();
this.redshiftMax = node.getRedshiftMax();
}
public long getSnapshot() {
......@@ -116,5 +123,21 @@ public class MergerTreeNode extends Hdf5 {
public void setDescendantSnapshot(long descendantSnapshot) {
this.descendantSnapshot = descendantSnapshot;
}
public double getRedshift() {
return redshift;
}
public void setRedshift(double redshift) {
this.redshift = redshift;
}
public double getRedshiftMax() {
return redshiftMax;
}
public void setRedshiftMax(double redshiftMax) {
this.redshiftMax = redshiftMax;
}
}
......@@ -60,6 +60,8 @@ public class Node extends Hdf5 {
private double redshift;
private double redshiftMax;
private double velocityDispersion;
private double position_x;
......@@ -122,6 +124,7 @@ public class Node extends Hdf5 {
this.velocity_x = node.velocity_x;
this.velocity_y = node.velocity_y;
this.velocity_z = node.velocity_z;
this.redshiftMax = node.redshiftMax;
}
public long getBranchId() {
......@@ -428,4 +431,12 @@ public class Node extends Hdf5 {
this.mainBranchMaximumNp = mainBranchMaximumNp;
}
public double getRedshiftMax() {
return redshiftMax;
}
public void setRedshiftMax(double redshiftMax) {
this.redshiftMax = redshiftMax;
}
}
......@@ -6,6 +6,7 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
......@@ -53,11 +54,21 @@ public class TreeNodesProcessor {
}
branchNodes.get(haloBranch).add(node.toProcessedNode());
haloBranch.incrementNumberOfSubhalos();
haloBranch.setRedshiftMax(Math.max(haloBranch.getRedshiftMax(), node.getRedshift()));
haloTree.incrementNumberOfSubhalos();
node.setTreeId(haloTree.getTree_id());
node.setBranchId(haloBranch.getBranch_id());
node.setTreeGroupId(treeGroup.getTree_group_id());
}
for (Map<SubhaloBranch, Collection<ProcessedMergerTreeNode>> branchNodes : resultTrees.values()) {
for (Entry<SubhaloBranch, Collection<ProcessedMergerTreeNode>> entry : branchNodes.entrySet()) {
for (ProcessedMergerTreeNode node : entry.getValue()) {
if (node.getRedshiftMax() <= 0) {
node.setRedshiftMax(entry.getKey().getRedshiftMax());
}
}
}
}
return result;
}
......
......@@ -25,6 +25,7 @@ public class ProcessedNode extends Node {
setDescendantSnapshot(processedNode.getDescendantSnapshot());
setTreeId(processedNode.getTreeId());
setBranchId(processedNode.getBranchId());
setRedshiftMax(processedNode.getRedshiftMax());
}
public Long getMergerTreeNodeId() {
......
......@@ -102,6 +102,10 @@ public class ProcessedNodeWithAscendants implements Serializable {
return delegate.getIsInterpolated();
}
public double getRedshift() {
return delegate.getRedshift();
}
public void setIsInterpolated(Long isInterpolated) {
delegate.setIsInterpolated(isInterpolated);
}
......
......@@ -60,6 +60,8 @@ public class Subhalo implements Serializable {
private final Double redshift;
private final Double redshift_max;
private final Double x;
private final Double y;
......@@ -178,6 +180,7 @@ public class Subhalo implements Serializable {
this.redshift = node.getRedshift();
this.main_branch_maximum_npart = Utils.nullIfMinusOne(node.getMainBranchMaximumNp());
this.main_branch_maximum_vmax = node.getMainBranchMaximumVmax();
this.redshift_max = node.getRedshiftMax();
if (optionalSubhalo.isPresent()) {
ProcessedSubhalo subhalo = optionalSubhalo.get();
this.fof_id = Utils.nullIfMinusOne(subhalo.getFofId());
......@@ -558,4 +561,8 @@ public class Subhalo implements Serializable {
this.parent_subhalo_id = Utils.nullIfMinusOne(parent_subhalo_id);
}
public Double getRedshift_max() {
return redshift_max;
}
}
......@@ -14,6 +14,8 @@ public class SubhaloBranch implements Serializable {
private final Long tree_group_id;
private Double redshiftMax = 0d;
private Long nsub = 0l;
public SubhaloBranch(Long branchId, SubhaloTree haloTree) {
......@@ -41,5 +43,13 @@ public class SubhaloBranch implements Serializable {
public void incrementNumberOfSubhalos() {
nsub++;
}
public Double getRedshiftMax() {
return redshiftMax;
}
public void setRedshiftMax(Double redshiftMax) {
this.redshiftMax = redshiftMax;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment