-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parameter improvment and some small new abilities #348
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some unneeded getters and setters
Why are "UnixTimeUTC" and "StartCellData" Parameters now? I think this is not needed and only adds fuzz.
public String badPixelKey = "badPixels"; | ||
|
||
@Parameter(required = false, description = "The key to the unixTimeUTC of the Event.") | ||
public String unixTimeKey = "UnixTimeUTC"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this a parameter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use this processor twice for different inputs with different times one will use 'UnixTimeUTC' the other 'LONS_UnixTimeUTC'. This is due to the fact that i have to calibrate the pedestal that I superimpose.
@@ -36,6 +36,12 @@ | |||
@Parameter(required = false, description = "The minimum number of neighboring pixels required for interpolation", defaultValue = "3") | |||
public int minPixelToInterpolate = 3; | |||
|
|||
@Parameter(required = false, description = "The key for the resulting badPixelSet.") | |||
public String badPixelKey = "badPixels"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this an xml Parameter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use the processor twice, so i added this in case someone want to preserve the output and not override the key with the second processor. I think it is cleaner this way, but I can remove it.
@@ -38,6 +38,9 @@ | |||
@Parameter(required = true) | |||
public String startCellKey = null; | |||
|
|||
@Parameter(required = false, description = "The key containing the UnixTimeUTC") | |||
public String unixTimeKey = "UnixTimeUTC"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this a parameter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use this processor twice for different inputs with different times one will use 'UnixTimeUTC' the other 'LONS_UnixTimeUTC'. This is due to the fact that i have to calibrate the pedestal that I superimpose.
@@ -58,6 +58,9 @@ | |||
@Service(required = false, description = "Name of the service that provides aux files") | |||
public AuxiliaryService auxService; | |||
|
|||
@Parameter(required = false, description = "The key containing the UnixTimeUTC") | |||
public String unixTimeKey = "UnixTimeUTC"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this a Parameter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use this processor twice for different inputs with different times one will use 'UnixTimeUTC' the other 'LONS_UnixTimeUTC'. This is due to the fact that i have to get the sourceposition of the pedestal that I superimpose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is LONS supposed to mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Light of night sky' before it was PED but we already have stuff that is called pedestal so I use LONS, that way there is no conflict with the other stuff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm against inventing new abbreviations that nobody uses. The commonly used abbreviation is NSB
for night sky background
} | ||
|
||
|
||
public static Logger getLog() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
} | ||
|
||
|
||
public static void setLog(Logger log) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -18,7 +18,11 @@ | |||
@Parameter(required = true) | |||
public String outputKey = null; | |||
|
|||
int limitEvents = 20; | |||
@Parameter(required = false, description = "The key containing the UnixTimeUTC") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this a parameter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the case someone wants to set it, we have an variable in 'settings.properties' for this but no way to set it in this processor (only in the jumpRemoval). So either this one goes or, the thing in setting.properties makes little sense because it is a constant.
Please also add |
Added the -SNAPSHOT to the version. |
As 1.0.1 is released now, the version for this should be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! The UnixTimeKey stuff is ok for me. Couldyou maybe provide an example XML that is using the TimeseriesFeatures and the CombineDataArrays? If you put that to examples/studies
it will run with the unit tests (?) and one can see how and why it is used. Otherwise, I would asume it would be deleted in later versions.
As we now require the timestamp key anyways, we could remove conversions from unixtimeutc to zoneddatetime and just do it once, maybe even in the readers and just use the timestamp key everywhere |
I'm not sure if I know what you mean. Could you point me to a file / line? |
I think he means this neat feature here |
@jebuss Everywhere we do calculations involving timestamps we use We use
|
Ok, @maxnoe I see your point. IMHO, it is neither a show stopper for this PR nor is there a larger clarity in opening a new issue and a new PR for this, since this PR is anyways a collection of several features. So both ways do make sense. So I would say its up to @tarrox if he can put afford in adding the I would be happy if we could finish this PR soon. |
data.put(outputKey, calibrated); | ||
else { | ||
short[] decalibratedShortData = new short[calibrated.length]; | ||
// System.arraycopy(rawData, 0, rawfloatData, 0, rawfloatData.length); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed this one and the other.
|
||
// add color value if set | ||
//TODO add color value if set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please just remove this line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
vraw /= drsGainMean[offsetPos]; | ||
vraw *= 1907.35; | ||
triggerOffsetPos = pixel * drsTriggerOffsetMean.length / Constants.N_PIXELS | ||
+ slice; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line break makes things worse imho
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed this one and the other ones too
|
||
// add color value if set | ||
//TODO add color value if set | ||
|
||
return data; | ||
} | ||
|
||
public double[] applyDrsCalibration(double[] data, double[] destination, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think two functions would be more clear. applyDrsCalibration
and revertDrsCalibration
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
split into two functions
Replaced the |
* @return The decalibrated data array | ||
*/ | ||
public double[] reverseDrsCalibration(double[] data, double[] destination, short[] startCellVector) { | ||
if (destination == null || destination.length != data.length) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe throwing in case the length do not match is better, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was legacy code, but yeah i can't think of any reason where giving a different length is intentional and not an error or lazyness. Changed in the next commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
|
||
// Get variables out of data item | ||
int[] currentTime = (int[]) item.get("UnixTimeUTC"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This processor apperently still uses UnixTimeUTC
and not timestamp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is currently intentional, this is because the previousEventInfo
holds UnixTimeUTC
and not timestamp
, this would need to be changed. I would suggest its own PR, especially as the SamplePedestalEvent
processor needs also to be changed (currently in its own branch, PR will be created once this PR is finished).
Added issue #362 for the missing unixtime->timestamp changes. So we can finish this PR quickly. |
primarily adding the ability to set the UnixTimeUTC key.
This changes are necessary for the work I do, to make the pull easier I split the last pull request #246 up into three pull request this being the first one.