{"action":"created","issue":{"url":"https://api.github.com/repos/desihub/desitarget/issues/3","labels_url":"https://api.github.com/repos/desihub/desitarget/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/desihub/desitarget/issues/3/comments","events_url":"https://api.github.com/repos/desihub/desitarget/issues/3/events","html_url":"https://github.com/desihub/desitarget/issues/3","id":111289489,"number":3,"title":"targetselection.py doesn't work with astropy 1.0.5","user":{"login":"sbailey","id":218471,"avatar_url":"https://avatars.githubusercontent.com/u/218471?v=3","gravatar_id":"","url":"https://api.github.com/users/sbailey","html_url":"https://github.com/sbailey","followers_url":"https://api.github.com/users/sbailey/followers","following_url":"https://api.github.com/users/sbailey/following{/other_user}","gists_url":"https://api.github.com/users/sbailey/gists{/gist_id}","starred_url":"https://api.github.com/users/sbailey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbailey/subscriptions","organizations_url":"https://api.github.com/users/sbailey/orgs","repos_url":"https://api.github.com/users/sbailey/repos","events_url":"https://api.github.com/users/sbailey/events{/privacy}","received_events_url":"https://api.github.com/users/sbailey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-10-13T23:03:20Z","updated_at":"2015-10-14T18:34:02Z","closed_at":null,"body":"With astropy 1.0.5, targetselection.py dies with:\r\n\r\n```\r\n$ python $DESITARGET/bin/targetselection.py /data/legacysurvey/dr1/tractor/000/tractor-0009p187.fits blat.fits\r\nTraceback (most recent call last):\r\n  File \"/Users/sbailey/desi/git/desitarget/bin/targetselection.py\", line 44, in <module>\r\n    main()\r\n  File \"/Users/sbailey/desi/git/desitarget/bin/targetselection.py\", line 35, in main\r\n    mask = cut.apply(candidates)\r\n  File \"/Users/sbailey/desi/git/desitarget/py/desitarget/internal/npyquery.py\", line 145, in apply\r\n    result[s] = v.visit(self)\r\n  File \"/Users/sbailey/desi/git/desitarget/py/desitarget/internal/npyquery.py\", line 369, in visit\r\n    return self.m[t](node)\r\n  File \"/Users/sbailey/desi/git/desitarget/py/desitarget/internal/npyquery.py\", line 415, in visit_expr\r\n    ops = [self.visit(a) for a in node.operands]\r\n  File \"/Users/sbailey/desi/git/desitarget/py/desitarget/internal/npyquery.py\", line 369, in visit\r\n    return self.m[t](node)\r\n  File \"/Users/sbailey/desi/git/desitarget/py/desitarget/internal/npyquery.py\", line 415, in visit_expr\r\n    ops = [self.visit(a) for a in node.operands]\r\n  File \"/Users/sbailey/desi/git/desitarget/py/desitarget/internal/npyquery.py\", line 369, in visit\r\n    return self.m[t](node)\r\n  File \"/Users/sbailey/desi/git/desitarget/py/desitarget/internal/npyquery.py\", line 409, in visit_column\r\n    return node.apply(self.array, self.s)\r\n  File \"/Users/sbailey/desi/git/desitarget/py/desitarget/internal/npyquery.py\", line 243, in apply\r\n    return array[self.name][s]\r\n  File \"/Users/sbailey/anaconda/envs/numpy1.9/lib/python2.7/site-packages/astropy/io/fits/fitsrec.py\", line 480, in __getitem__\r\n    return self.field(key)\r\n  File \"/Users/sbailey/anaconda/envs/numpy1.9/lib/python2.7/site-packages/astropy/io/fits/fitsrec.py\", line 620, in field\r\n    field = _get_recarray_field(base, name)\r\n  File \"/Users/sbailey/anaconda/envs/numpy1.9/lib/python2.7/site-packages/astropy/io/fits/fitsrec.py\", line 1138, in _get_recarray_field\r\n    field = np.recarray.field(array, key)\r\n  File \"/Users/sbailey/anaconda/envs/numpy1.9/lib/python2.7/site-packages/numpy/core/records.py\", line 542, in field\r\n    res = fielddict[attr][:2]\r\nKeyError: 'brick_primary'\r\n```\r\nThis works with astropy 1.0.1.  I'll dig deeper and submit an astropy bug report and/or see if there is a workaround for desitarget."},"comment":{"url":"https://api.github.com/repos/desihub/desitarget/issues/comments/148147870","html_url":"https://github.com/desihub/desitarget/issues/3#issuecomment-148147870","issue_url":"https://api.github.com/repos/desihub/desitarget/issues/3","id":148147870,"user":{"login":"weaverba137","id":3780690,"avatar_url":"https://avatars.githubusercontent.com/u/3780690?v=3","gravatar_id":"","url":"https://api.github.com/users/weaverba137","html_url":"https://github.com/weaverba137","followers_url":"https://api.github.com/users/weaverba137/followers","following_url":"https://api.github.com/users/weaverba137/following{/other_user}","gists_url":"https://api.github.com/users/weaverba137/gists{/gist_id}","starred_url":"https://api.github.com/users/weaverba137/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weaverba137/subscriptions","organizations_url":"https://api.github.com/users/weaverba137/orgs","repos_url":"https://api.github.com/users/weaverba137/repos","events_url":"https://api.github.com/users/weaverba137/events{/privacy}","received_events_url":"https://api.github.com/users/weaverba137/received_events","type":"User","site_admin":false},"created_at":"2015-10-14T18:34:02Z","updated_at":"2015-10-14T18:34:02Z","body":"In addition to having the file, we also have a data model for every file.  So there should be no need to predict the column names.  They are in the data model!\r\n\r\nWhat is the big deal with normalized column names all of a sudden?  Seriously, I don't get it."}}