Exemplo n.º 1
0
    def run_EAZY(self, EAZYFilters, EAZYID):

        F = FLARE.filters.add_filters(EAZYFilters)

        hf_EAZY = eazy.eazy(ID=self.ID).run(self.hf, F, phot_type='')

        # --- append EAZY group to original file

        hf_EAZY.copy(f'EAZY', self.hf, name=f'EAZY/{EAZYID}')

        self.hf[f'EAZY/{EAZYID}'].attrs['filters'] = EAZYFilters
Exemplo n.º 2
0
    def run_EAZY(self, hf):

        F = FLARE.filters.add_filters(self.Filters)

        hf_EAZY = eazy.eazy(ID='all', create_POFZ_FILE=True).run_new(
            hf, F, path=lambda f: f'photometry/small_circular_kron/{f}/')

        # --- append EAZY group to original file

        hf_EAZY.copy(f'EAZY', hf, name=f'EAZY')

        return hf
Exemplo n.º 3
0
    def run_list(self, list, run_EAZY=False):

        Sources = []

        for i in range(len(list['z'])):
            p = {k: v[i] for k, v in list.items()}
            Sources.append(self.run_single(p))

        hf = self.write_to_HDF5(
            Sources,
            OutputFolder=
            f'data/{self.surveyName}/{self.fieldName}/{self.SimType}')

        if self.verbose:

            def get_name_shape(name, item):
                shape = ''
                if hasattr(item, 'value'):
                    shape = item.shape
                print(name, shape)

            hf.visititems(get_name_shape)

        if run_EAZY:

            hf_EAZY = eazy.eazy(ID=self.ID,
                                create_POFZ_FILE=True).run(hf, self.F)

            # --- append EAZY group to original file

            hf_EAZY.copy('EAZY', hf)

        if self.verbose:

            def get_name_shape(name, item):
                shape = ''
                if hasattr(item, 'value'):
                    shape = item.shape
                print(name, shape)

            hf.visititems(get_name_shape)

        hf.close()
Exemplo n.º 4
0
    def run(self, N, run_EAZY=False):

        # run for many galaxies, run EAZY, and output as HDF5

        Sources = self.run_many(N)

        hf = self.write_to_HDF5(Sources)

        if self.verbose:

            def get_name_shape(name, item):
                shape = ''
                if hasattr(item, 'value'):
                    shape = item.shape
                print(name, shape)

            hf.visititems(get_name_shape)

        if run_EAZY:

            hf_EAZY = eazy.eazy(ID=self.ID).run_new(hf,
                                                    self.F,
                                                    path=lambda f: f'obs/{f}/')

            # --- append EAZY group to original file

            hf_EAZY.copy('EAZY', hf)

        if self.verbose:

            def get_name_shape(name, item):
                shape = ''
                if hasattr(item, 'value'):
                    shape = item.shape
                print(name, shape)

            hf.visititems(get_name_shape)

        hf.close()