Open keflavich opened 2 years ago
We should probably have a mode='fix' or something to handle poorly-behaved cases like this.
mode='fix'
ValueError Traceback (most recent call last) /scratch/local/20668739/ipykernel_7930/2849726456.py in <module> ----> 1 cube = SpectralCube.read('/orange/adamginsburg/sgrb2/2013.1.00269.S/merge/fullcubes_r0/full_SgrB2_TETC7m_r0_spw3_lines.fits', use_dask=True) /blue/adamginsburg/adamginsburg/repos/spectral-cube/spectral_cube/io/core.py in __call__(self, filename, *args, **kwargs) 116 kwargs['target_cls'] = BaseSpectralCube 117 try: --> 118 return registry.read(BaseSpectralCube, filename, *args, **kwargs) 119 except IsADirectoryError: # See note above StringWrapper 120 return registry.read(BaseSpectralCube, StringWrapper(filename), *args, **kwargs) /blue/adamginsburg/adamginsburg/repos/astropy/astropy/io/registry/compat.py in wrapper(registry, *args, **kwargs) 41 registry = default_registry 42 # get and call bound method from registry instance ---> 43 return getattr(registry, method_name)(*args, **kwargs) 44 45 return wrapper /blue/adamginsburg/adamginsburg/repos/astropy/astropy/io/registry/core.py in read(self, cls, format, cache, *args, **kwargs) 197 198 reader = self.get_reader(format, cls) --> 199 data = reader(*args, **kwargs) 200 201 if not isinstance(data, cls): /blue/adamginsburg/adamginsburg/repos/spectral-cube/spectral_cube/io/fits.py in load_fits_cube(input, hdu, meta, target_cls, use_dask, **kwargs) 219 cube = SC(data, wcs, mask, meta=meta, header=header) 220 else: --> 221 cube = VRSC(data, wcs, mask, meta=meta, header=header, 222 beam_table=beam_table, major_unit=beam_units[0], 223 minor_unit=beam_units[1]) /blue/adamginsburg/adamginsburg/repos/spectral-cube/spectral_cube/dask_spectral_cube.py in __init__(self, data, *args, **kwargs) 1415 # data storage) because spectral operations will take forever. 1416 data = da.asarray(data, name=str(uuid.uuid4())) -> 1417 super().__init__(data, *args, **kwargs) 1418 if self._unit is None and unit is not None: 1419 self._unit = unit /blue/adamginsburg/adamginsburg/repos/spectral-cube/spectral_cube/spectral_cube.py in __init__(self, major_unit, minor_unit, *args, **kwargs) 3708 if beam_table is not None: 3709 # CASA beam tables are in arcsec, and that's what we support -> 3710 beams = Beams(major=u.Quantity(beam_data_table['BMAJ'], major_unit), 3711 minor=u.Quantity(beam_data_table['BMIN'], minor_unit), 3712 pa=u.Quantity(beam_data_table['BPA'], u.deg), /blue/adamginsburg/adamginsburg/repos/radio-beam/radio_beam/multiple_beams.py in __new__(cls, major, minor, pa, areas, default_unit, meta, beams) 89 90 if np.any(minor > major): ---> 91 raise ValueError("Minor axis greater than major axis.") 92 93 self = super(Beams, cls).__new__(cls, value=_to_area(major, minor).value, unit=u.sr) ValueError: Minor axis greater than major axis.
We should probably have a
mode='fix'
or something to handle poorly-behaved cases like this.