Skip to content

Commit

Permalink
Merge pull request #336 from fact-project/mc_gain_ceres_12
Browse files Browse the repository at this point in the history
Add new default gain file for MCs simulated with ceres 12
  • Loading branch information
maxnoe authored Mar 6, 2018
2 parents 502807e + cfa23fb commit 0fd6a6b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
2 changes: 0 additions & 2 deletions src/main/java/fact/extraction/BasicExtraction.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
import stream.Processor;
import stream.annotations.Parameter;
import stream.annotations.Service;
import stream.io.CsvStream;
import stream.io.SourceURL;

import java.time.ZonedDateTime;

Expand Down
5 changes: 4 additions & 1 deletion src/main/java/fact/gainservice/GainService.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public class GainService implements Service{
@Parameter(defaultValue = "classpath:/gains_20120503-20171103.fits.gz")
public URL gainFile = GainService.class.getResource("/gains_20120503-20171103.fits.gz");

@Parameter(defaultValue = "classpath:/mc_gain_ceres_12.csv")
public URL simulationGainFile = GainService.class.getResource("/mc_gain_ceres_12.csv");

TreeMap<ZonedDateTime, double[]> gains;
private double[] gainsSimulations = null;

Expand Down Expand Up @@ -99,7 +102,7 @@ public double[] getSimulationGains() {
private void loadGainsSimulations() {
double[] integralGains = new double[Constants.N_PIXELS];

SourceURL url = new SourceURL(GainService.class.getResource("/defaultIntegralGains.csv"));
SourceURL url = new SourceURL(simulationGainFile);
try {
CsvStream stream = new CsvStream(url, " ");
stream.setHeader(false);
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/mc_gain_ceres_12.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This is a calibration file with gains according to a single pe analysis on closed shutter pedestal simulations with ceres_12.
# Entries are the median of all 1440 pixels (except for the 12 broken pixels), rounded to zero digits.
# The result of the spe analysis was: mean/median = 266.0 mV 0.5 ns; std_dev = 8.0 mV 0.5 ns
266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0 266.0
8 changes: 8 additions & 0 deletions src/test/java/fact/gainservice/GainServiceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,12 @@ public void testGetNearest () {
assertEquals(2, gains[0], 1e-12);

}

@Test
public void testLoadSimulationGain() {
GainService gainService = new GainService();
double[] gains = gainService.getSimulationGains();

assertEquals(266.0, gains[0], 1e-10);
}
}

0 comments on commit 0fd6a6b

Please sign in to comment.