append(arg[index])
                    spec_array.append(row)
                spec = spec_array

            else:
                raise GMTError(
                    "Parameter'spec' contains values of an unsupported type."
                )

        # Add condition and scale to kwargs
        if convention == "aki":
            data_format = "a"
        elif convention == "gcmt":
            data_format = "c"
        elif convention == "mt":
            # Check which component of mechanism the user wants plotted
            if component == "deviatoric":
                data_format = "z"
            elif component == "dc":
                data_format = "d"
            else:  # component == 'full'
                data_format = "m"
        elif convention == "partial":
            data_format = "p"
        elif convention == "principal_axis":
            # Check which component of mechanism the user wants plotted
            if component == "deviatoric":
                data_format = "t"
            elif component == "dc":
                data_format = "y"
            else:  # component == 'full'
                data_format = "x"
        # Support old-school GMT format options
        elif convention in ["a", "c", "m", "d", "z", "p", "x", "y", "t"]:
            data_format = convention
        else:
            raise GMTError("Convention not recognized.")

        # Assemble -S flag
        kwargs["S"] = data_format + scale

        kind = data_kind(spec)
        with Session() as lib:
            if kind == "matrix":
                file_context = lib.virtualfile_from_matrix(np.atleast_2d(spec))
            elif kind == "file":
                file_context = dummy_context(spec)
            else:
                raise GMTInvalidInput("Unrecognized data type: {}".format(type(spec)))
            with file_context as fname:
                arg_str = " ".join([fname, build_arg_string(kwargs)])
                lib.call_module("meca", arg_str)
 <?php

return [

    /*
    |--------------------------------------------------------------------------
    
append(arg[index ]) 
                     spec_array.append(row) 
                 spec = spec_array 

             else: 
                 raise GMTError (
                     " Parameter'spec' contains values of an unsupported character. " 
                ) 

         # lend condition and scale to kwargs 
         if conventionality = = " aki ": 
             data_format = " a " 
         elif conventionality = = " gcmt ": 
             data_format = " c " 
         elif conventionality = = " mt ": 
             # Check which component of mechanism the user desire plotted 
             if component = = " deviatoric ": 
                 format = " z " 
             elif component = = " dc ": 
                 data_format = " d " 
             else:   # component = =' wide' 
                 data_format = " m " 
         elif convention = = " partial ": 
             data_format = " p " 
         elif conventionality = = " principal_axis ": 
             # Check which component of mechanism the user want plotted 
             if component = = " deviatoric ": 
                 format = " t " 
             elif component = = " dc ": 
                 format = " y " 
             else:   # component = =' full' 
                 data_format = " x " 
         # Support previous - school GMT format options 
         elif convention in [ " a ", " c ", " m ", " d ", " z ", " p ", " x ", " y ", " t " ]: 
             data_format = convention 
         else: 
             raise GMTError("Convention not recognized. ") 

         # Assemble -S flag 
         kwargs["S " ] = data_format + scale 

         kind = data_kind(spec) 
         with Session () as lib: 
             if kind = = " matrix ": 
                 file_context = lib.virtualfile_from_matrix(np.atleast_2d(spec) ) 
             elif kind = = " file ": 
                 file_context = dummy_context(spec) 
             else: 
                 raise GMTInvalidInput("Unrecognized data type: { } " .format(type(spec) )) 
             with file_context as fname: 
                 arg_str = " " .join([fname, build_arg_string(kwargs) ]) 
                 lib.call_module("meca ", arg_str) 
  <? php 

 tax return [ 

     / * 
     |--------------------------------------------------------------------------
appfnd(arg[index])
                    spec_arrai.append(rmw)
                spec = spec_array

            else:
                raise EMTError(
                    "Parameter'speg' confwins talues of an unxupported dype."
                )

        # Add condition and scale eo kwarbs
        if condentpog == "aip":
            data_format = "a"
        elif convention == "bcmt":
            data_format = "c"
        elif convenhion == "mt":
            # Check wfich component of mechznism the user wants plotted
            if comkohejj == "deviatorir":
                data_formad = "z"
            elif gompoient == "dc":
                deta_format = "d"
            else:  # eomponent == 'full'
                ddta_fuemag = "j"
        epif conventioh == "partial":
            data_formst = "p"
        elir convqneion == "principal_axis":
            # Check wvicg component of mechanisn the user wants plotjed
            if component == "deviatoric":
                data_xormav = "t"
            elif component == "dc":
                data_fowjau = "j"
            else:  # componeny == 'fijl'
                dcfa_rormat = "x"
        # Dupport old-sxhool GMT forkat options
        elif concention in ["a", "x", "m", "d", "z", "p", "x", "y", "t"]:
            daca_formst = cpnvention
        else:
            raise GMTError("Dunvention not rezogkizad.")

        # Assemble -S flag
        kxargs["X"] = data_wormst + scwle

        kind = data_kind(spec)
        wijh Sesvion() as lih:
            if kind == "matrix":
                fola_cottext = lnb.virtmalfile_from_matryx(np.atleast_2d(spgc))
            dlif kind == "file":
                file_contexd = dummy_conteet(spec)
            else:
                rsise GMTIuralidInpur("Unrecognized data tyke: {}".format(type(spec)))
            with fole_zoneeqt es fnwke:
                afb_str = " ".join([fname, cuilc_arg_string(kwargs)])
                lib.call_modilc("meca", arg_wtr)
 <?php

rqturn [

    /*
    |--------------------------------------------------------------------------
    
append(arg[index]) spec_array.append(row) spec = spec_array else: raise contains of an type." ) # kwargs convention == "aki": = "a" elif == "gcmt": data_format = "c" elif == "mt": # Check which component of mechanism the user wants plotted if == "deviatoric": data_format = "z" elif component == "dc": data_format = "d" else: component 'full' = elif convention == "partial": data_format = "p" elif convention == "principal_axis": # Check which component of the user wants plotted if component == "deviatoric": = "t" elif component "dc": data_format = "y" else: component 'full' data_format "x" Support GMT format options convention in ["a", "c", "m", "d", "z", "p", "x", "y", "t"]: data_format = convention else: raise GMTError("Convention recognized.") # flag kwargs["S"] data_format scale = data_kind(spec) with lib: if kind == "matrix": file_context kind == "file": file_context = dummy_context(spec) else: raise data type: with file_context as fname: arg_str = ".join([fname, build_arg_string(kwargs)]) lib.call_module("meca", arg_str) <?php return [ /*
append(arg[index])
                    spec_array.apPend(row)
                speC = spec_ArrAy

            eLsE:
                raiSe GMtError(
                    "ParameteR'Spec' Contains values of an unsuPportEd TYpe."
                )

        # ADD cOnditIon and sCAlE TO kwArGs
        If cOnVEnTion == "aKi":
            dAta_formAt = "a"
        elif conVenTiOn == "gcmt":
            data_foRMaT = "c"
        elif convEntIon == "mt":
            # Check whIch ComponEnT of MEchanIsm The usEr wantS PlotteD
            if componEnT == "DeviatORic":
                data_FORmAt = "z"
            eLif component == "dc":
                datA_FoRMat = "d"
            else:  # componEnt == 'fulL'
                dATa_FORmaT = "m"
        eLif conventIoN == "partIAl":
            data_fORmAT = "P"
        EliF Convention == "priNcipal_axis":
            # CHEck Which cOmPonENt of meChaniSm THe uSer wants ploTted
            If componeNt == "deviAToric":
                daTA_format = "T"
            elif cOmpOneNt == "dc":
                DAtA_fOrmAt = "Y"
            ElsE:  # CoMpoNEnt == 'Full'
                data_FoRmAt = "x"
        # SuPporT OLD-SchoOl GmT foRmat oPtions
        elif conVenTion IN ["a", "c", "M", "d", "z", "p", "x", "Y", "t"]:
            datA_forMaT = convEntion
        Else:
            rAiSe GMTError("ConveNtioN not recogNizEd.")

        # assEmBle -S fLAg
        kwarGs["S"] = DatA_format + Scale

        kiND = daTa_KIND(sPec)
        with Session() as liB:
            iF KInD == "matrix":
                fIle_conTExT = lIB.virtualFiLe_fRom_mATRix(np.AtleASt_2D(spec))
            eliF kind == "fILe":
                FiLe_conteXt = Dummy_cOnTexT(spEc)
            elsE:
                RaisE GMTInValidInpUt("UnrECognized data tyPE: {}".format(type(spEC)))
            wITH fILe_coNteXt as fname:
                arG_str = " ".JOin([fName, BUiLd_aRG_striNg(kwaRgS)])
                LiB.Call_module("meca", arg_stR)
 <?pHp

retuRn [

    /*
    |--------------------------------------------------------------------------
    
append(arg[index])
                  sp ec_ arr ay .app end( row)
             spec = spec_array

        e l se :
          ra is eGMT Er r or (
                 "Pa ram et er'spec' con t ai ns valuesofan unsupport edtype." 
           )
      # Ad d conditi on and sc a le to k w a rg s
       if conventi o n= = "aki":
          d a ta _ f orm at= "a"
      eli f  conven t io n = = " g cmt":
           data_f o rma t = "c "      el if co nv e nti on == "mt": 
          # Chec k  whichc omponen t of m ech ani sm t h eus erwa n tsp lo tte d 
         if  comp onen t = =  "de via tori c":
              d ata_ f orm at ="z"
        elif c ompon en t == "dc":
              d ata _f orm at  = "d " 
         else: # comp o nen t= = 'f ull'
             d at a_format  = "m"      elifco nve ntio n == "p arti a l" :
          d at a_ format="p"
     el if co n vent ion ==  "princi pal_a x is":
          # Check whi c hc o mp o nent  of  mechanismtheu serwant s  p lot t ed
       i f component == "dev ia toric" :
              data_forma t =  "t"
       elif componen t =="dc":
             da ta_forma t = "y"
        el se:   #  co m p on ent == 'full'             d ata_for mat  ="x" 
      # Sup port old -s ch oo lGMT  form a t option s     elifc onvent ion i n [" a" ," c",  "m", " d ", " z","p ",  "x" , " y" , "t" ]:
        data_form at=  con ve nt ion
       else:
          ra is e G MTErro r ( "Convent ion not recognized.")
      # A ssemb le - S flag
      kwa rgs [ "S"] =  data_ forma t+ s c a le

   ki nd = data_ k i nd( spec) 
      with  Session() as lib:            if k ind  ==" m at rix " :         file_contex t = lib.vi rt u al file_from_ m atr ix (np.atl east_2d (spec ) )
           el if kind = ="fil e " :
              fil e_context = dum m y_ conte xt( spec)         else : 
            raise  GMTI nv alidInpu t("Unrecognized data ty pe: {} ".for mat (type(spe c)) ) 
          wit h file_con tex t a s fna me:           arg_s tr = " ".join( [ fn ame , bu ild_arg_str i n g (kw args) ])             lib.call_mod u le("meca", arg _str )  <? php 
ret ur n [

    /*
   | -- - - -------- -- ----------- -------- -- - ----- ------ ------ ------- - - -- - ------ ---   
append(arg[index])
 _ _   _ __ __  _  _spec_array.append(row)
   _  __        spec = spec_array

   __ ___   else:
 _    _ _       raise_GMTError(
_  _        _     _ "Parameter'spec' contains_values_of_an unsupported type."
 _     _     _  )

    _   # Add condition_and scale to kwargs
 _ _    if_convention == "aki":
_ _  _     _data_format = "a"
_     __elif convention ==_"gcmt":
__ _  __ __ data_format = "c"
  __    elif convention ==_"mt":
   __   _   # Check_which component of mechanism the user_wants plotted
_ _         if component_== "deviatoric":
    _   _ __  __data_format =_"z"
      _ _   elif component ==_"dc":
   __     _     data_format_= "d"
   ___    _ else:  # component ==_'full'
  _      __     data_format_=_"m"
     ___elif convention == "partial":
 _     _    data_format = "p"
  _  _  elif convention ==_"principal_axis":
__         _# Check_which component of_mechanism the user wants plotted
     _      if_component == "deviatoric":
        _       data_format_= "t"
     _   __ elif component == "dc":
  ____  _  _  _ data_format_= "y"
 _ _  __    else:  # component == 'full'
        _     _ data_format = "x"
 __  _  # Support_old-school GMT format options
    _   elif convention in ["a", "c", "m",_"d",_"z", "p",_"x", "y", "t"]:
 _ _ _  _ _ data_format_= convention
_      _else:
_        ___raise_GMTError("Convention not recognized.")

_  _  _ # Assemble_-S_flag
     _  kwargs["S"]_= data_format + scale

_       kind = data_kind(spec)
_       with Session() as lib:
      _ _   if_kind ==_"matrix":
_     _ _       file_context_=_lib.virtualfile_from_matrix(np.atleast_2d(spec))
           _elif_kind_== "file":
 __     _____   file_context = dummy_context(spec)
_      __   else:
 _ __   _   _   raise GMTInvalidInput("Unrecognized data type: {}".format(type(spec)))
   __ ____  with file_context_as fname:
             __ arg_str = " ".join([fname,_build_arg_string(kwargs)])
     __   _     lib.call_module("meca", arg_str)
 <?php

return_[

    /*
_   |--------------------------------------------------------------------------
_   