Project

General

Profile

Bug #3870

galaxy tile ids

Added by Brian Nord over 6 years ago.

Status:
Assigned
Priority:
High
Assignee:
Category:
-
Target version:
-
Start date:
05/14/2013
Due date:
% Done:

0%

Estimated time:
Duration:

Description

running the pipeline through to SimObsGalSpec, I find an error in assigning tile airmasses to galaxies. The first fix for this is to use a list comprehension that accumulates indices of tile IDs that are matched to galaxies. However, not all galaxies have a tileid. This should be a problem if we select on whether a galaxy has been allocated to a fiber first. I don't see it anywhere in this piece of code, so I just want to check that this is the right place to add it before I do so.

We could alternatively select galaxies that don't have tileid = -1, but we should still only be looking at galaxies that have a fiber ... during the redshift measurement, is there anywhere a selection on whether a galaxy has a fiber?

Reference code: 06-SimulateObservedGalaxySpectra/SimulateObservedGalaxySpectra_Hambrecht/SimulateObservedGalaxySpectra.py
Reference section of code (with some modifications):
class SimulateObservedGalaxySpectra:
def init(self):
with archive.archive(data_bank,'r') as ar:
self.A = ar['/spectrum_generator/A']
self.B = ar['/spectrum_generator/B']
self.C = ar['/spectrum_generator/C']
self.D = ar['/spectrum_generator/D']
self.E = ar['/spectrum_generator/E']
self.lambda_survey = ar['/spectrum_generator/lambda_survey']
self.airmasses = ar['/tiling/airmass']
self.galaxy_tile_id = ar['/gal/tile_id']
self.tile_id_list = ar['/tiling/tile_id']
self.z_trues = ar['/gal/z_true']
print 'gal tile id ', self.galaxy_tile_id
print 'tile id ', self.tile_id_list
indices = numpy.array([ numpy.where(self.tile_id_list==gal_tile_id)[0] for gal_tile_id in self.galaxy_tile_id])
print 'indices', indices
#self.airmass = [ self.airmasses[numpy.where(self.tile_id_list==gal_tile_id)[0]] for gal_tile_id in self.galaxy_tile_id]
self.airmass = [self.airmasses[index] for index in indices]

#self.airmass = self.airmasses[numpy.where(self.tile_id_list==self.galaxy_tile_id)] # this doesn't work because you can't match to differently sized arrays


Also available in: Atom PDF