コード例 #1
0
ファイル: figure.py プロジェクト: panzhengyang/pygmt
    def makecpt(self, options, output=None):
        c = gmt_cpt.GMT_CPT(self._gmt_session)
        c.register_output(output)

        module_options = ' '.join([options, c.out_str, self.v])
        self._print_call('makecpt ' + module_options)
        self._gmt_session.call_module('makecpt', module_options)

        return c
コード例 #2
0
ファイル: figure.py プロジェクト: panzhengyang/pygmt
 def psscale(self, options, cpt=None):
     module_options = ' '.join(
         [options, self.ko, self.v, self.range_proj, self.ps_output])
     if cpt != None:
         c = gmt_cpt.GMT_CPT(self._gmt_session)
         c.register_input(cpt)
         module_options = module_options + ' ' + c.in_str
     self._print_call('psscale ' + module_options)
     self._gmt_session.call_module('psscale', module_options)
コード例 #3
0
ファイル: figure.py プロジェクト: panzhengyang/pygmt
    def grd2cpt(self, options, input, output=None):
        g = gmt_grid.GMT_Grid(self._gmt_session)
        g.register_input(input)
        c = gmt_cpt.GMT_CPT(self._gmt_session)
        c.register_output(output)

        module_options = ' '.join([g.in_str, options, c.out_str, self.v])
        self._print_call('grd2cpt ' + module_options)
        self._gmt_session.call_module('grd2cpt', module_options)
        return c
コード例 #4
0
ファイル: figure.py プロジェクト: panzhengyang/pygmt
    def psxy(self, options, input, cpt=None):
        '''
        Call the GMT psxy module with the text string "options" and the input "input"
        options is a text string of the flags to be given to psxy.
        '''
        d = gmt_data.GMT_Dataset(self._gmt_session)
        d.register_input(input)
        module_options = ' '.join([
            d.in_str, options, self.ko, self.v, self.range_proj, self.ps_output
        ])

        if cpt != None:
            c = gmt_cpt.GMT_CPT(self._gmt_session)
            c.register_input(cpt)
            module_options = module_options + ' ' + c.in_str

        self._print_call('psxy ' + module_options)
        self._gmt_session.call_module('psxy', module_options)
コード例 #5
0
ファイル: figure.py プロジェクト: panzhengyang/pygmt
    def grdview(self, options, input, cpt=None, intensity=None):
        '''
        Call the GMT pscontour module with the text string "options"
        '''
        g = gmt_grid.GMT_Grid(self._gmt_session)
        g.register_input(input)

        module_options = ' '.join([
            g.in_str, options, self.ko, self.v, self.range_proj, self.ps_output
        ])
        if intensity != None:
            g = gmt_grid.GMT_Grid(self._gmt_session)
            g.register_input(intensity)
            module_options = module_options + ' -I' + g.in_str
        if cpt != None:
            c = gmt_cpt.GMT_CPT(self._gmt_session)
            c.register_input(cpt)
            module_options = module_options + ' ' + c.in_str
        self._print_call('grdview ' + module_options)
        self._gmt_session.call_module('grdview', module_options)