Skip to content
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

Coincidences #43

Merged
merged 53 commits into from Apr 23, 2014
Merged

Coincidences #43

merged 53 commits into from Apr 23, 2014

Conversation

153957
Copy link
Member

@153957 153957 commented Aug 23, 2013

This is meant to add the processing of coincidences to the publicdb.
Daily ESD data will be analysed for coincidences, which will be stored in the ESD.
Histograms will be generated to give an overview of the coincidences.

Currently it is meant to use all stations in the network when looking for coincidences.
We could add the processing of coincidences for cluster, though that should just be a subset of the full network..

The coincidence module in SAPPHiRE does not seems to keep a nice reference to the original data entry,
it simply copies all events that are part of a coincidence to a new table.
This increases disk usage, perhaps we can make it work with nicer pointers back to the original tables.

To be added are views which show the histograms for the daily network-wide coincidences.

Add functions to process the data,
to find and store the coincidences
inforecords is not imported
Add new /network/ urls
Add plot settings for coincidencetime and -number
Add network templates
Add links from station pages
In case of data page link with to coincidences with same date
Remove __exact, it is implied
@153957
Copy link
Member Author

153957 commented Aug 30, 2013

Points to be resolved:

  • Link to the coincidences page from the stations pages
  • Improve coincidences in SAPPHiRE to find alternative for duplication of events (to save a lot of disc space)
  • Make sure that some edge cases are handled properly
    • Only one station with data
    • Only test stations with data
    • ...
  • Add more information to coincidences page
    • Number of stations with data
    • Number of events
    • Coincidence window
  • Add info to Help page
  • Correctly fill in num_coincidences in NetworkSummary
  • Remember to add new histogram types in database when merging to master

This subclass stores coincidences differently
Searches based on a subset of stations are easier
Also less extra storage space is required
The function in the subclass skips the processing
Rename some functions to better describe their function
Fix setting the number of coincidences
@153957
Copy link
Member Author

153957 commented Sep 6, 2013

Note that it was not the observables that were taking so much space but rather the _src_timestamps.

>>> data.root.coincidences._src_timestamps.size_on_disk
75987048L
>>> data.root.coincidences.coincidences.size_on_disk
1768851L
>>> data.root.coincidences.c_index.size_in_memory
300628L
>>> data.root.coincidences.observables.size_on_disk
5566650L

Still the observables where a large fraction.
With these changes:

  • removal of _src*/observables tables
  • addition of more columns in coincidences
  • station_id also in c_index
  • new s_index table

The final file size has decreased
ESD with no coincidences: 408 MB
With old coincidences: 494 MB
With new coincidences: 415 MB

>>> data.root.coincidences.coincidences.size_on_disk
4390644L
>>> data.root.coincidences.s_index.size_in_memory
2947L
>>> data.root.coincidences.c_index.size_in_memory
583992L

Both the coincidences and c_index tables have grown a lot, but in total space was saved.

Show number of stations with data and total number of events
Small update to the help page
@153957
Copy link
Member Author

153957 commented Oct 15, 2013

Fix migration conflict

Conflicts:
	django_publicdb/status_display/urls.py
	django_publicdb/status_display/views.py
There was a conflict (two migrations numbered 0003)
The migration for network histograms/summaries is now 0004
@153957
Copy link
Member Author

153957 commented Jan 13, 2014

Use smaller coincidence window than default, because coincidental coincidences become dominant for larger windows. As can be seen in this plot, where the number of found coincidences for all events of a single day is plotted against the size of the coincidence window.

network_1day

Fix /source/ tests for status_display by checking for csv response
Remove unnecessary comments
Use assertTrue from the test class in api tests
Correct the code style to be more PEP8
Remove comments
Rename plates -> detectors
Disable test tot check if script exists, the script is in script dir,
not where the config expects it to be, which is correct for Nagios
server.
Skip multithreaded tests, they do not seem to finishes properly
Reduce output:
Disable progressbar with mock.patch
Redirect stdout/err to devnull
Set histograms logger level to INFO
Download data for a second station
Use Django's .count() instead of len() when appropriate
Use self.fail() instead of self.assertTrue(False)
Rename some variables for consistency
Import all histograms.models directly
Improved path parsing in datastore setup script
Allow esd and coincidences to be run without multithreading
Clearer variable names for network summaries
Better docstrings
More consistent string formatting for logger
Improve some docstrings
Use DATE1/2 in function names instead of the dates
Add tests for coincidences (not yet for coincidences histograms)
Include a date/station combination to only have test-station data.
There should be no coincidences for that date.
Update test fixture to set is_test to true for the test station.
Update and remove some comments
Fix some spacing/indentation
Add tick to distinguish between 1 and 0 values,
to Number of stations per coincidence.
Update plot title
@153957
Copy link
Member Author

153957 commented Mar 10, 2014

Todo:

  • Use station numbers in coincidence column names (s2, s3, s501, s502, etc)
  • Add nice links to get to the correct page easily

Pass a SAPPHiRE cluster object to CoincidencesESD to give it the
station numbers
The cluster is very limited, it does not contain correct positions, nor
any detectors.
Extended the max pulseheight range for histograms to 2500 mV
This should fit all possible pulseheights: 4096 * .57 = 2335 mV
The bin size is still the same (10 mV)
Also increased the range for the plot in the flot settings.
To ensure the same plot range for all histograms.
Slightly thinner plot lines
The pulse histograms once again have the same number of bins.
The bin width is kept constant.
Also improve some docstrings
@153957
Copy link
Member Author

153957 commented Apr 22, 2014

Adding support for clusters will be easier once HiSPARC/sapphire#19 is finished.

Still subject to change.
The purpose of the links may not be obvious for everyone.
Increases visibility of MPV peaks
Also fix comment about coincidence window
Resolved conflicts:
	django_publicdb/api/tests.py
	django_publicdb/api/views.py
	django_publicdb/histograms/esd.py
	django_publicdb/status_display/nagios.py
@153957
Copy link
Member Author

153957 commented Apr 23, 2014

Finishing touches:

  • Add (sub)cluster coincidence histograms
  • Add downloading of coicnidences (with events), as streaming JSON?

These points will be worked on later (new PR)

153957 added a commit that referenced this pull request Apr 23, 2014
Add support for coincidences in the ESD.
This uses sapphire.analysis.coincidences.CoincidencesESD
to look for coincidences between all (non-test) stations in the network.
Overview pages have been added to show histograms of the number
of coincidences per hour and the number of stations in each coincidence.
Also many other fixes:
- improved tests (not flawless yet)
- increased range for pulseheights/integral histograms
- esd jobs listen to multiprocessing setting
- ...
@153957 153957 merged commit cb90fe4 into master Apr 23, 2014
@153957 153957 deleted the coincidences branch April 30, 2014 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant