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

Erna is producing redundant queries #71

Open
jebuss opened this issue May 24, 2018 · 1 comment
Open

Erna is producing redundant queries #71

jebuss opened this issue May 24, 2018 · 1 comment

Comments

@jebuss
Copy link
Member

jebuss commented May 24, 2018

With the new fact_conditions package the options

@click.argument('earliest_night')
@click.argument('latest_night' )

and

@click.option('--source', help='Name of the source to analyze. e.g Crab', default='Crab')

are at least redundant, because with a conditions file containing fSourceName and cuts on fNight you could end up with a query like this.

Querying data with conditions: 
fNight >= 20150901 AND 
fNight <= 20160401 AND 
fSourceName = "Crab" AND 
fCurrentsMedMeanBeg < 8 AND fMoonZenithDistance > 100 AND 
fThresholdMinSet < 350 AND fEffectiveOn > 0.95 AND 
fTriggerRateMedian > 40 AND fTriggerRateMedian < 85 AND 
fThresholdMinSet < (14 * fCurrentsMedMeanBeg + 265) AND 
fZenithDistanceMean < 30.5 AND fZenithDistanceMean > 5.5 AND 
fNight >= 20150901 AND 
fNight <= 20160401 AND 
fSourceName = 'Crab'

In some case this might be just redundant. In other cases this might cause contradicting queries and failures is processing that are not easy to debug.

Thus, i'd like to raise the question it we would like to get rid of:

@click.argument('earliest_night')
@click.argument('latest_night' )

and

@click.option('--source', help='Name of the source to analyze. e.g Crab', default='Crab')

in:
https://github.com/fact-project/erna/blob/master/erna/scripts/process_fact_data.py
https://github.com/fact-project/erna/blob/master/erna/scripts/process_fact_data_qsub.py
https://github.com/fact-project/erna/blob/master/erna/scripts/fetch_fact_runs.py

@tarrox
Copy link
Collaborator

tarrox commented May 25, 2018

I think at least making them into options and thus optional would be a good compromise, if you want to keep them. This would also be nice for simple test; if for example you wanted to decrease the timeframe to test if stuff works correctly in your analysis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants