def get_energy(self): energy = plane.Energy() lower = 1.0 upper = 2.0 lower1 = 1.1 upper1 = 2.1 lower2 = 1.2 upper2 = 2.2 samples = [ shape.SubInterval(lower, lower1), shape.SubInterval(lower2, upper), shape.SubInterval(upper1, upper2) ] interval = shape.Interval(lower, upper2, samples) energy.bounds = interval energy.dimension = 100 energy.resolving_power = 2.0 energy.sample_size = 1.1 energy.bandpass_name = "e" if self.caom_version >= 24: energy.energy_bands.add(plane.EnergyBand.GAMMARAY) energy.energy_bands.add(plane.EnergyBand.OPTICAL) energy.transition = wcs.EnergyTransition("species", "transition") return energy
def get_spectral_wcs(self): axis = self.get_coord_axis1d() energy = chunk.SpectralWCS(axis, "energy specsys") if self.complete: energy.ssysobs = "energy ssysobs" energy.ssyssrc = "energy ssyssrc" energy.restfrq = 1.0 energy.restwav = 2.0 energy.velosys = 3.0 energy.zsource = 4.0 energy.velang = 5.0 energy.bandpassName = "energy bandpassName" energy.resolvingPower = 6.0 energy.transition = wcs.EnergyTransition("H", "21cm") return energy
def __init__(self): pass @staticmethod def good_wcs(self): return None @staticmethod def bad_wcs(self): return None # There's got to be a better way to do this, but of the 2 ways I tried, # none is really great. Leaving these here for now. BANDPASS_NAME = "H-Alpha-narrow" TRANSITION = wcs.EnergyTransition("H", "alpha") class EnergyTestUtil: def __init__(self): pass @staticmethod def good_wcs(): px = float(0.5) sx = float(400.0) nx = float(200.0) ds = float(1.0) # SpectralWCS energy = EnergyTestUtil.getTestRange(True, px, sx * nx * ds, nx, ds)