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

Float-Array mismatch error on lsd-import fits? #8

Open
ericmorganson opened this issue Aug 21, 2011 · 1 comment
Open

Float-Array mismatch error on lsd-import fits? #8

ericmorganson opened this issue Aug 21, 2011 · 1 comment
Assignees

Comments

@ericmorganson
Copy link

Summary:
lsd-import of a fits table produces float/array mismatch error

lsd-import fits sdss_ps1_match $INFILE
Importing from 1 pieces:
------ rolling back 20110821140158.500967 ---------

Traceback (most recent call last):
File "/a41217d5/LSD/stable/bin/lsd-import", line 88, in
args.func(args)
File "/a41217d5/LSD/stable/bin/lsd-import", line 53, in chunk_importer
import_from_chunks(db, importer, chunks)
File "/a41217d5/LSD/stable/bin/lsd-import", line 30, in import_from_chunks
for (chunk, nloaded, nin) in pool.imap_unordered(chunks, import_from_chunks_aux, (db, importer,), progress_callback=pool2.progress_pass):
File "/a41217d5/LSD/stable/lib/python2.7/site-packages/lsd/pool2.py", line 459, in imap_unordered
for result in mapper(item, *mapper_args):
File "/a41217d5/LSD/stable/bin/lsd-import", line 20, in import_from_chunks_aux
ret = importer(db, chunk, *importer_args)
File "/a41217d5/LSD/stable/lib/python2.7/site-packages/lsd/importers/fits.py", line 43, in call
ids = db.table(self.tabname).append(rows, _update=self.import_primary_key)
File "/a41217d5/LSD/stable/lib/python2.7/site-packages/lsd/table.py", line 1167, in append
cols[key][need_key] = self.pix.obj_id_from_pos(lon, lat, t)
File "/a41217d5/LSD/stable/lib/python2.7/site-packages/lsd/pixelization.py", line 222, in obj_id_from_pos
(x, y) = bhpix.proj_bhealpix(ra, dec)
File "/a41217d5/LSD/stable/lib/python2.7/site-packages/lsd/bhpix.py", line 53, in proj_bhealpix
(hxx, hyy) = proj_healpix(l, b)
File "/a41217d5/LSD/stable/lib/python2.7/site-packages/lsd/bhpix.py", line 23, in proj_healpix
z = cos(radians(90.-b))
TypeError: unsupported operand type(s) for -: 'float' and 'numpy.ndarray'

Background:
$INFILE is a fits file output produced by LSD. It initially had two columns called "sdss.ra" and "sdss.dec" which were not the spatial columns. I thought the '.' might cause problems and changed them to sdss_ra and sdss_dec. This did not affect anything. Looking at the ra and dec used for spatial sorting:

blah[1].data['ra']
array([ 350.00996409, 350.04883905, 350.03341515, ..., 355.77349801,
355.71030779, 355.77579255])
blah[1].data['dec']
array([ 70.01368437, 70.02155921, 70.01437617, ..., 71.53092708,
71.53523562, 71.53410173])

They are not obviously invalid.

@ghost ghost assigned mjuric Sep 6, 2011
@mjuric
Copy link
Owner

mjuric commented Sep 6, 2011

Weird... Can you send me the offending FITS file?

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

No branches or pull requests

2 participants