示例#1
0
    def test_n_lambda(self):
        """
        Compare auto velocity against setting same min, max, and n_lambda
        """

        sg_auto = SpectrumGenerator(
            lambda_min='auto', lambda_max='auto',
            dlambda=1.0, bin_space='velocity')
        sg_auto.make_spectrum("ray.h5", lines=self.line_list,
                              store_observables=True)

        sg_comp = SpectrumGenerator(
            lambda_min=sg_auto.lambda_field[0],
            lambda_max=sg_auto.lambda_field[-1],
            n_lambda=sg_auto.lambda_field.size,
            bin_space='velocity')
        sg_comp.make_spectrum("ray.h5", lines=self.line_list,
                              store_observables=True)
        compare_spectra(sg_auto, sg_comp, 'manually setting n_lambda')
示例#2
0
    def test_dlambda(self):
        """
        Compare auto wavelength against setting same min, max, and dlambda
        """

        sg_auto = SpectrumGenerator(lambda_min='auto',
                                    lambda_max='auto',
                                    dlambda=0.01)
        sg_auto.make_spectrum("ray.h5",
                              lines=self.line_list,
                              store_observables=True)

        sg_comp = SpectrumGenerator(lambda_min=sg_auto.lambda_field[0],
                                    lambda_max=sg_auto.lambda_field[-1],
                                    dlambda=sg_auto.bin_width)
        sg_comp.make_spectrum("ray.h5",
                              lines=self.line_list,
                              store_observables=True)
        compare_spectra(sg_auto, sg_comp, 'manually setting dlambda')