Skip to content

Commit

Permalink
Merge pull request #131 from fact-project/jebuss/forErna
Browse files Browse the repository at this point in the history
Jebuss/for erna
  • Loading branch information
jebuss committed May 10, 2016
2 parents c8e27bb + fc5aae6 commit 0789e63
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#Changelog for the fact-tools

## Version 0.14.1 -- 10.05.2016
* Bug fix for the calculation of the source position in Monte Carlos:
* Corsika, Ceres and FACT-Tools are using different definitions of the Zd/Az coordinate systen. In FACT-Tools 0.14.0 we change to the definition used by Astropy, but a bug was left in the coordinate transformation for MCs. Now this transformation was changed to fit the definition used in Astropy
* Example XMLs to be used with the tourque/maui grid wrapper, called ERNA (https://github.com/fact-project/erna)

## Version 0.14.0 -- 03.05.2016

* Bug fix for the calculation of the source position (and position of stars in the camera):
Expand Down
81 changes: 81 additions & 0 deletions examples/forErna/std_analysis_mc_erna.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<container>
<!--
This Process contains the standard analysis for FACT, with modifications to be used with the SGE/TORQUE cluster
execution tool ERNA (Easy RuN Access) https://github.com/fact-project/erna
-->
<properties url="classpath:/default/settings_mc.properties" />

<property name="integralGainFile" value="classpath:/default/defaultIntegralGains.csv" />

<service id="calibService" class="fact.calibrationservice.ConstantCalibService" />

<!-- Has to be a FactFileListMultiStream in order to work on tasks from gridmap and the executor script.-->
<stream id="fact" class="fact.io.FactFileListMultiStream" url="${input}">
<stream class="fact.io.zfits.ZFitsStream" id="_" />
</stream>

<process id="1" input="fact">

<fact.utils.Remapping
key="Data"
outputKey="Data"
/>
<fact.utils.RemappingKeys
keys="McCherPhotWeight,McCherPhotNumber,McMuonCherPhotWeight,McNoisePhotWeight,McCherArrTimeMean,McCherArrTimeVar,McCherArrTimeMin,McCherArrTimeMax"
/>

<fact.datacorrection.DrsCalibration
key="Data"
outputKey="DataCalibrated"
/>

<fact.datacorrection.RemoveSpikes
dataKey="DataCalibrated"
outputKey="DataCalibrated"
startCellKey="StartCellData"
leftBorder="${removeSpikes_leftBorder}"
spikeLimit="${removeSpikes_spikeLimit}"
topSlopeLimit="${removeSpikes_topSlopeLimit}"
maxSpikeLength="${removeSpikes_maxSpikeLength}"
/>
<fact.datacorrection.InterpolateTimeSeries
calibService="calibService"
dataKey="DataCalibrated"
dataOutputKey="DataCalibrated"
/>

<!-- Extraction -->
<!-- BasicExtraction, RisingEdgeForPositions, RisingEdgePolynomFit, TimeOverThreshold,
PhotonChargeTimeOverThreshold, HandleSaturation, CorrectPixelDelays-->
<include url="classpath:/default/mc/extraction_mc.xml" />
<!-- Output: photoncharge, arrivalTime -->

<!-- Cleaning -->
<!-- SourcePosition(Cetatauri), CoreNeighborCleanTimeNeighbor-->
<include url="classpath:/default/mc/cleaning_mc.xml" />
<!-- Output: shower -->

<!-- Parameter calculation (only source independent) -->
<!-- ArrayMean(photoncharge,arrivalTime), ArrayStatistics(photoncharge,arrivalTime,maxSlopes,
arrivalTimePos,maxSlopesPos,maxAmplitudePosition,photonchargeSaturated,arrivalTimeTOT),
Size, DistributionFromShower, M3Long, Length, Width, NumberOfIslands, TimeGraident,
Concentration, ConcentrationCore, ConcentrationAtCenterOfGravity, Leakage, TimeSpread,
ShowerSlope, Disp -->
<include url="classpath:/default/mc/parameterCalc_mc.xml" />
<!-- Output: source independent parameters -->

<!-- Parameter calculation (only source dependent) -->
<!-- SourcePosition(${sourcename}), AntiSourcePosition(5), Alpha(for 6 Sources),
Distance(for 6 Sources), CosDeltaAlpha(for 6 Sources), Theta(for 6 Sources) -->
<include url="classpath:/default/mc/sourceParameter_mc.xml" />
<!-- Output: source dependent parameters -->

<!-- its important that you output a valid json file for this to work in conjuction with gridmap -->
<fact.io.JSONWriter keys="${keysForOutput}"
url="${output}"
writeListOfItems="True"
pixelSetsAsInt="True"
/>
<!-- <fact.io.PrintKeysOnConsole keys="${keysForOutput}" /> -->
</process>
</container>
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>de.sfb876</groupId>
<artifactId>fact-tools</artifactId>
<name>fact-tools</name>
<version>0.14.0</version>
<version>0.14.1</version>
<url>http://sfb876.de/fact-tools/</url>

<description>
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/fact/features/source/SourcePosition.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,10 @@ public Data process(Data data) {
double pointingAz = Utils.valueToDouble(data.get(pointingAzKey));
double sourceZd = Utils.valueToDouble(data.get(sourceZdKey));
double sourceAz = Utils.valueToDouble(data.get(sourceAzKey));
// Due to the fact, that Ceres handle the coordinate in a different way, we have to undo
// the coordinate transformation from Ceres
pointingAz = 180 - pointingAz;
sourceAz = 180 - sourceAz;
// Due to the fact, that Ceres handle the coordinate in a different way, we have to
// rotate the coordinate system by 180 deg such that 0 deg is north
pointingAz = 180 + pointingAz;
sourceAz = 180 + sourceAz;
// Now we can calculate the source position from the zd,az coordinates for pointing and source
double[] sourcePosition = getSourcePosition(pointingAz, pointingZd, sourceAz, sourceZd);
data.put(outputKey, sourcePosition);
Expand Down

0 comments on commit 0789e63

Please sign in to comment.