FUNCTION READ_SIMCAT, file ;+ ; For reading NetCDF files containing simulated catalogues ; produced by the Marsden et al. (2010) FIR galaxy evolution model. ; ; USAGE: data_struct = READ_SIMCAT(filename) ; ; The format of the output data structure can be viewed by typing ; ; IDL> HELP, data_struct, /STRUCT ; ; CREATED BY: gmarsden@phas.ubc.ca, 2010-10-06 ;- id = NCDF_OPEN(file) NCDF_VARGET, id, "lambda", lambda NCDF_VARGET, id, "luminosity", lum NCDF_VARGET, id, "colour", col NCDF_VARGET, id, "redshift", red NCDF_VARGET, id, "flux", flux NCDF_ATTGET, id, "flux", "units", fluxu fluxu = STRING(fluxu) NCDF_ATTGET, id, "lambda", "units", lambdau lambdau = STRING(lambdau) NCDF_ATTGET, id, "luminosity", "units", lumu lumu = STRING(lumu) NCDF_ATTGET, id, "luminosity", "comment", lumcomm lumcomm = STRING(lumcomm) NCDF_ATTGET, id, "area", area, /GLOBAL NCDF_ATTGET, id, "area_units", areau, /GLOBAL areau = STRING(areau) NCDF_CLOSE, id nbands = N_ELEMENTS(lambda) nsrcs = N_ELEMENTS(lum) data = {lambda:lambda, lambdau:lambdau, lum:lum, lumu:lumu, lumcomm:lumcomm, $ col:col, red:red, flux:flux, fluxu:fluxu, $ area:area, areau:areau, nbands:nbands, nsrcs:nsrcs} RETURN, data END