:py:mod:`n2j.trainval_data.graphs.cosmodc2_graph` ================================================= .. py:module:: n2j.trainval_data.graphs.cosmodc2_graph .. autoapi-nested-parse:: Training input graph X created from the postprocessed CosmoDC2 catalog Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: n2j.trainval_data.graphs.cosmodc2_graph.CosmoDC2Graph n2j.trainval_data.graphs.cosmodc2_graph.CosmoDC2GraphHealpix .. py:class:: CosmoDC2Graph(in_dir, healpixes, raytracing_out_dirs, aperture_size, n_data, features, subsample_pdf_func=None, n_subsample=None, subsample_with_replacement=True, stop_mean_std_early=False, n_cores=20, num_workers=4, out_dir=None, seed=123) Bases: :py:obj:`torch.utils.data.dataset.ConcatDataset` Concatenation of multiple CosmoDC2GraphHealpix instances, with an added data transformation functionality .. py:method:: data_stats() Statistics of the X, Y data used for standardizing .. py:method:: data_stats_valtest() Statistics of the X, Y data on validation set used for resampling to mimic training dist. Mean, std computation skipped. .. py:method:: __getitem__(idx) .. py:class:: CosmoDC2GraphHealpix(healpix, in_dir, raytracing_out_dir, aperture_size, n_data, features, n_cores=20, out_dir=None, debug=False) Bases: :py:obj:`n2j.trainval_data.graphs.base_graph.BaseGraph` Set of graphs representing a single healpix of the CosmoDC2 field .. py:property:: n_features .. py:property:: raw_dir :type: str .. py:property:: raw_file_name .. py:property:: raw_file_names .. py:property:: processed_file_fmt .. py:property:: processed_file_path_fmt .. py:property:: processed_file_names A list of files relative to self.processed_dir which needs to be found in order to skip the processing .. py:attribute:: columns :value: ['ra', 'dec', 'galaxy_id', 'redshift'] .. py:method:: get_los_node() Properties of the sightline galaxy, with unobservable features (everything other than position) appropriately masked out. Parameters ---------- ra_los : ra of sightline, in arcmin dec_los : dec of sightline, in arcmin .. py:method:: download() Called when `raw_file_names` aren't found .. py:method:: get_gals_iterator(healpix, columns, chunksize=100000) Get an iterator over the galaxy catalog defining the line-of-sight galaxies .. py:method:: get_edges(ra_dec) Get the edge indices from the node positions Parameters ---------- ra_dec : `np.ndarray` ra and dec of nodes, of shape `[n_nodes, 2]` Returns ------- `torch.LongTensor` edge indices, of shape `[2, n_edges]` .. py:method:: _save_graph_to_disk(i) .. py:method:: _get_y_class(y) .. py:method:: process_single(i) Process a single sightline indexed i .. py:method:: process() Process multiple sightline in parallel .. py:method:: len() .. py:method:: get(idx)