Skip to content

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

Description

@ericmorganson

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions