slosar / fastcat Goto Github PK
View Code? Open in Web Editor NEWFast and dirty creation of fast and dirty mock galaxy catalogs
Fast and dirty creation of fast and dirty mock galaxy catalogs
I think there is missing an import numpy as np
in window_Humna.py because when I try to run fastcat in NERSC (edison) it raises an error
I am running the following code :
`import numpy as np
import fastcat as fc
import treecorr as tc
import healpy as hp
import os
data1=fc.Catalog(read_from="/home/nil/catalog0.h5")`
IOError Traceback (most recent call last)
in ()
5 import os
6
----> 7 data1=fc.Catalog(read_from="/home/nil/catalog0.h5")
8
/home/nil/Downloads/LSST/fastcat/catalog.pyc in init(self, N, fields, dNdz, bz, window, photoz, meta, read_from)
35 photoz=None,meta=None, read_from=None):
36 if (read_from!=None):
---> 37 self.readH5(read_from)
38 else:
39 self.data=np.zeros(N,dtype=map(lambda x:(x,np.float32),fields))
/home/nil/Downloads/LSST/fastcat/catalog.pyc in readH5(self, fname)
54 Reads Catalog from H5 file, specified as argument
55 """
---> 56 of=h5py.File(fname, "r")
57 self.data=of["objects"].value
58 self.meta=of["meta"].attrs
/home/nil/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/h5py/_hl/files.pyc in init(self, name, mode, driver, libver, userblock_size, swmr, *_kwds)
270
271 fapl = make_fapl(driver, libver, *_kwds)
--> 272 fid = make_fid(name, mode, userblock_size, fapl, swmr=swmr)
273
274 if swmr_support:
/home/nil/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/h5py/_hl/files.pyc in make_fid(name, mode, userblock_size, fapl, fcpl, swmr)
90 if swmr and swmr_support:
91 flags |= h5f.ACC_SWMR_READ
---> 92 fid = h5f.open(name, flags, fapl=fapl)
93 elif mode == 'r+':
94 fid = h5f.open(name, h5f.ACC_RDWR, fapl=fapl)
h5py/_objects.pyx in h5py._objects.with_phil.wrapper (/tmp/pip-build-2HHYDA/h5py/h5py/_objects.c:2682)()
h5py/_objects.pyx in h5py._objects.with_phil.wrapper (/tmp/pip-build-2HHYDA/h5py/h5py/_objects.c:2640)()
h5py/h5f.pyx in h5py.h5f.open (/tmp/pip-build-2HHYDA/h5py/h5py/h5f.c:1928)()
IOError: Unable to open file (Unable to open file: name = '/home/nil/catalog0.h5', errno = 2, error message = 'no such file or directory', flags = 0, o_flags = 0)
I have checked, catalog0.h5 is in /home/nil/ folder.
I also tried to run :
import numpy as np
import fastcat as fc
import treecorr as tc
import healpy as hp
import os
data1=fc.Catalog("/home/nil/catalog0.h5")
but I got another error:
TypeError Traceback (most recent call last)
in ()
5 import os
6
----> 7 data1=fc.Catalog("/home/nil/catalog0.h5")
8
/home/nil/Downloads/LSST/fastcat/catalog.pyc in init(self, N, fields, dNdz, bz, window, photoz, meta, read_from)
37 self.readH5(read_from)
38 else:
---> 39 self.data=np.zeros(N,dtype=map(lambda x:(x,np.float32),fields))
40 self.dNdz=dNdz
41 self.bz=bz
TypeError: an integer is required
Am I doing something wrong?
Would it make sense to have a getML(self,arr) function in the PhotoZ class?
Regardless of this, I think there may be a bug in getMeanRMS for Gaussian photo-z's. The function currently reads:
return arr["z"],self.sigma*(1+arr["z"])
but I think the latter is only correct if arr["z"] is the galaxy's true redshift (not its photo-z mean).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.