How to use the regions.io.ds9.core.DS9RegionParserError function in regions

To help you get started, we’ve selected a few regions examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github astropy / regions / regions / io / ds9 / read.py View on Github external
def parse_region(self, include, region_type, region_end, line):
        """
        Extract a Shape from a region string
        """
        if self.coordsys is None:
            raise DS9RegionParserError("No coordinate system specified and a"
                                       " region has been found.")
        else:
            helper = DS9RegionParser(coordsys=self.coordsys,
                                     include=include,
                                     region_type=region_type,
                                     region_end=region_end,
                                     global_meta=self.global_meta,
                                     line=line)
            helper.parse()
            self.shapes.append(helper.shape)
github astropy / regions / regions / io / ds9 / read.py View on Github external
def _raise_error(self, msg):
        if self.errors == 'warn':
            warn(msg, DS9RegionParserWarning)
        elif self.errors == 'strict':
            raise DS9RegionParserError(msg)