A common reader interface for accessing generic catalogs
by Yao-Yuan Mao
pip install GCR
This project forked from yymao/generic-catalog-reader
To access actual catalogs, visit https://github.com/LSSTDESC/gcr-catalogs
License: MIT License
A common reader interface for accessing generic catalogs
by Yao-Yuan Mao
pip install GCR
In some cases the users may want to use the GCR API for their own catalogs but don't necessarily want to integrate with the official DESCQA ones. There should be a function to register a new galaxy catalog class defined outside of the GCR package.
Example use case:
>>> from GCR import register_reader, load_catalog
>>> register_reader(MyReaderClass)
>>> cat = load_catalog('my_catalog.yaml')
where MyReaderClass
is my own non official reader.
@yymao while you are it, just had the following problem
catalog.get_quantities(required_quantities, return_hdf5=filename)
File "/global/homes/f/flanusse/repo/WLMassMap/python/desc/wlmassmap/mocks/GCR/BaseGalaxyCatalog.py", line 340, in get_quantities
f.create_dataset(q, data=self._concatenate_quantities(q, pre_filters, post_filters)[q], chunks=True, compression="gzip", shuffle=True, fletcher32=True)
File "/global/homes/f/flanusse/repo/WLMassMap/python/desc/wlmassmap/mocks/GCR/BaseGalaxyCatalog.py", line 300, in _concatenate_quantities
for data in self._get_quantities_iter(quantities, pre_filters, post_filters):
File "/global/homes/f/flanusse/repo/WLMassMap/python/desc/wlmassmap/mocks/GCR/BaseGalaxyCatalog.py", line 283, in _get_quantities_iter
rest_quantities = quantities.union(self._get_quantities_from_filters(post_filters))
AttributeError: 'str' object has no attribute 'union'
As a user, it would be very convenient if I could add my own modifiers which can be applied on the standard fields defined in the DESC Schema, without any knowledge of the native format.
Simple example, I want to simulate some photometric redshifts using the following:
catalog.add_quantity_modifier('redshift_photometric', (lambda x: x + sigma * (1+x) *randn(len(x)), 'redshift'))
This fails with the following:
ValueError: Native quantity `redshift` does not exist (required by `redshift_photometric`)
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.