-
Notifications
You must be signed in to change notification settings - Fork 30
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
added DESCQAGEN directory to DESCQA #46
Open
duncandc
wants to merge
17
commits into
LSSTDESC:master
Choose a base branch
from
duncandc:descqagen
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
60e2c34
added code for apparent_mag_func_test
1483c20
some updates
46c58c1
Merge remote-tracking branch 'origin' into descqagen
8cad5d2
fixed typo
00a17da
fixed bug in area calc
bde442d
updated validation data
2c6cb37
Merge branch 'master' into descqagen
yymao 69e8d43
Merge branch 'master' into descqagen
yymao 6d5d888
small updates
3e58d83
Merge branch 'descqagen' of https://github.com/duncandc/descqa into d…
cc84285
Merge remote-tracking branch 'origin/master' into descqagen
2b35a05
Merge branch 'master' into descqagen
yymao 5f2057a
small changes
0debaaa
saving more info about extrapolations
ee4add0
Merge remote-tracking branch 'origin/master' into descqagen
07f6dbc
fix py3 syntax error
yymao bd2f655
remove unused numpy
yymao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This directory stores downloaded data products |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
""" | ||
run sql queries on HSC database | ||
""" | ||
|
||
from __future__ import print_function, division | ||
import sys | ||
sys.path.append("..") | ||
from defaults import PROJECT_DIRECTORY, DATA_DIRECTORY | ||
|
||
|
||
def main(): | ||
""" | ||
run scripted SQL download. | ||
|
||
to download the HSC data for this project, in the temrinal window type: | ||
$user python download_data.py data | ||
|
||
to download the HSC randoms for this project, in the temrinal window type: | ||
$user python download_data.py randoms | ||
|
||
Before running this script, edit the hsc_credentials.txt file in the sql directory. | ||
""" | ||
|
||
if sys.argv[1] == 'data': | ||
sql_file = PROJECT_DIRECTORY + 'sql/hsc_data.sql' | ||
savename = DATA_DIRECTORY + 'hsc_data.csv' | ||
elif sys.argv[1] == 'randoms': | ||
sql_file = PROJECT_DIRECTORY + 'sql/hsc_randoms.sql' | ||
savename = DATA_DIRECTORY + 'hsc_randoms.csv' | ||
else: | ||
print("specify either 'data' or 'randoms' as a positional argument.") | ||
sys.exit() | ||
|
||
# read in username and password for HSC account | ||
user_info_file = PROJECT_DIRECTORY + 'sql/hsc_credentials.txt' | ||
f = open(user_info_file, 'r') | ||
username = f.readline().strip() | ||
password = f.readline().strip() | ||
f.close() | ||
if (username == 'username') | (password == 'password'): | ||
print("Please alter the file: {0}, to be your username and password".format(user_info_file)) | ||
print("It is possible your username and password are 'username' and 'password'. Shame on you.") | ||
|
||
# open sql query string | ||
f = open(sql_file, 'r') | ||
sql = f.read() | ||
f.close() | ||
|
||
# run query script | ||
import subprocess | ||
exec_script = PROJECT_DIRECTORY+'sql/hscReleaseQuery.py' | ||
process = subprocess.call(['python', exec_script, '--user', username, '--password', password, sql_file]) | ||
|
||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
cols = {'object_id':(0,'i8'), | ||
'parent_id':(1,'i8'), | ||
'ira':(2,'f4'), | ||
'idec':(3,'f4'), | ||
'imag_cmodel':(4,'f4'), | ||
'imag_cmodel_err':(5,'f4'), | ||
'iflux_cmodel_flags':(6,'bool_'), | ||
'iflux_cmodel':(7,'f4'), | ||
'iflux_cmodel_err':(8,'f4'), | ||
'merge_measurement_i':(9,'f4'), | ||
'a_g':(10,'f4'), | ||
'a_r':(11,'f4'), | ||
'a_i':(12,'f4'), | ||
'a_z':(13,'f4'), | ||
'a_y':(14,'f4'), | ||
'rmag_forced_cmodel':(15,'f4'), | ||
'rmag_forced_cmodel_err':(16,'f4'), | ||
'rflux_forced_cmodel':(17,'f4'), | ||
'rflux_forced_cmodel_err':(18,'f4'), | ||
'rflux_forced_cmodel_flags':(19,'bool_'), | ||
'imag_forced_cmodel':(20,'f4'), | ||
'imag_forced_cmodel_err':(21,'f4'), | ||
'iflux_forced_cmodel':(22,'f4'), | ||
'iflux_forced_cmodel_err':(23,'f4'), | ||
'iflux_forced_cmodel_flags':(24,'bool_'), | ||
'gmag_forced_cmodel':(25,'f4'), | ||
'zmag_forced_cmodel':(26,'f4'), | ||
'ymag_forced_cmodel':(27,'f4'), | ||
'tract':(28,'f4'), | ||
'patch':(29,'f4'), | ||
'gcountinputs':(30,'f4'), | ||
'rcountinputs':(31,'f4'), | ||
'icountinputs':(32,'f4'), | ||
'zcountinputs':(33,'f4'), | ||
'ycountinputs':(34,'f4'), | ||
'iflags_pixel_bright_object_center':(35,'bool_'), | ||
'iflags_pixel_bright_object_any':(36,'bool_'), | ||
'iblendedness_flags':(37,'bool_'), | ||
'iblendedness_abs_flux':(38,'f4')} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
cols = {'object_id':(0,'i8'), | ||
'ra':(1,'f4'), | ||
'dec':(2,'f4'), | ||
'tract':(3,'f4'), | ||
'patch':(4,'f4'), | ||
'gcountinputs':(5,'f4'), | ||
'rcountinputs':(6,'f4'), | ||
'icountinputs':(7,'f4'), | ||
'zcountinputs':(8,'f4'), | ||
'ycountinputs':(9,'f4'), | ||
'iflags_pixel_bright_object_center':(10,'bool_'), | ||
'iflags_pixel_bright_object_any':(11,'bool_') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import os | ||
|
||
PROJECT_DIRECTORY = os.path.dirname(os.path.abspath(__file__))+'/' | ||
DATA_DIRECTORY = PROJECT_DIRECTORY + 'data/' |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
savename
is not used in the following script. Is this intended?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.
hmmm, I dont see where the filename that is used to save the data is specified... let me try to reload this into my memory...
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.
Just a gentle reminder: @duncandc any luck on solving this minor issue?