Giter Club home page Giter Club logo

generic-catalog-reader's Introduction

Generic Catalog Reader (GCR)

A common reader interface for accessing generic catalogs

by Yao-Yuan Mao

Installation

pip install GCR

generic-catalog-reader's People

Contributors

yymao avatar j-dr avatar eiffl avatar

Watchers

Phil Marshall avatar James Cloos avatar  avatar Richard Dubois avatar  avatar

Forkers

eiffl danielsf

generic-catalog-reader's Issues

Registering external catalogs with the 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.

Issue with writing HDF5 files

@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'

Add secondary modifiers which can be applied on the Schema quantities

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`)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.