forked from CDAT/cdat
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmanageElements.py
More file actions
1864 lines (1567 loc) · 71.6 KB
/
manageElements.py
File metadata and controls
1864 lines (1567 loc) · 71.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
## This file aims at removing elets creation from dpeending on a Canvas, we will try to simply have
## b = vcs.createboxfill()
## rather than
## x=vcs.init()
## b=x.createboxfill()
import vcs
import boxfill,meshfill,isofill,isoline,unified1D,template,projection
import colormap
import fillarea,marker,line,texttable,textorientation,textcombined,vector
from xmldocs import plot_keywords_doc,graphics_method_core,axesconvert,\
xaxisconvert,yaxisconvert, plot_1D_input, plot_2D_input, plot_output,\
plot_2_1D_input, create_GM_input, get_GM_input, boxfill_output, \
isofill_output, isoline_output, yxvsx_output, xyvsy_output, xvsy_output,\
scatter_output, outfill_output, outline_output, plot_2_1D_options
import random
import warnings
from error import vcsError
import dv3d
def check_name_source(name,source,typ):
"""makes ure it is a unique name for this type or generates a name for user"""
elts = vcs.listelements(typ)
if name is None:
rnd = random.randint(0,1000000000000000)
name = '__%s_%i' % (typ,rnd)
while name in elts:
rnd = random.randint(0,1000000000000000)
name = '__%s_%i' % (typ,rnd)
if isinstance(name,unicode):
name = str(name)
if not isinstance(name,str):
raise vcsError, '%s object name must be a string or %s name' % (typ,typ)
if not isinstance(source,str):
exec("ok = vcs.is%s(source)" % (typ,))
else:
ok=0
if (not isinstance(source,str)) and ok==0:
raise vcsError,'Error %s object source must be a string or a %s object' % (typ,typ)
elif ok:
source=source.name
if name in elts:
raise vcsError, "Error %s object named %s already exists" % (typ,name)
if not source in elts and typ!="display":
raise vcsError, "Error source %s object (%s) does not exist!" % (typ,source)
return name,source
def createtemplate(name=None, source='default'):
"""
Function: createtemplate # Construct a new template
Description of Function:
Create a new template given the the name and the existing template to copy
the attributes from. If no existing template name is given, then the default
template will be used as the template to which the attributes will be copied
from.
If the name provided already exists, then a error will be returned. Template
names must be unique.
Example of Use:
con=vcs.createtemplate('example1') # create 'example1' template from 'default' template
vcs.listelements('template') # Show all the existing templates
con=vcs.createtemplate('example2','quick') # create 'example2' from 'quick' template
"""
name,source = check_name_source(name,source,'template')
return template.P(name, source)
def gettemplate(Pt_name_src='default'):
"""
Function: gettemplate # Construct a new template
Description of Function:
VCS contains a list of predefined templates. This function will create a
template class object from an existing VCS template. If no template name
is given, then template 'default' will be used.
Note, VCS does not allow the modification of `default' attribute
sets. However, a `default' attribute set that has been copied under a
different name can be modified. (See the createtemplate function.)
Example of Use:
vcs.listelements('template') # Show all the existing templates
templt=vcs.gettemplate() # templt instance of 'default' template
templt2=vcs.gettemplate('quick') # templt2 contains 'quick' template
"""
# Check to make sure the argument passed in is a STRING
if not isinstance(Pt_name_src,str):
raise vcsError, 'The argument must be a string.'
if not Pt_name_src in vcs.elements["template"].keys():
raise ValueError, "template '%s' does not exists" % Pt_name_src
return vcs.elements["template"][Pt_name_src]
def createprojection(name=None, source='default'):
"""
Function: createprojection # Construct a new projection method
Description of Function:
Create a new projection method given the the name and the existing
projection method to copy the attributes from. If no existing
projection method name is given, then the default projection
method will be used as the projection method to which the attributes will
be copied from.
If the name provided already exists, then a error will be returned. Projection
method names must be unique.
Example of Use:
vcs.show('projection')
p=vcs.createprojection('example1',)
vcs.show('projection')
p=vcs.createprojection('example2','quick')
vcs.show('projection')
"""
name,source = check_name_source(name,source,'projection')
return projection.Proj(name, source)
def getprojection(Proj_name_src='default'):
"""
Function: getprojection # Construct a new projection method
Description of Function:
VCS contains a list of graphics methods. This function will create a
projection class object from an existing VCS projection method. If
no projection name is given, then projection 'default' will be used.
Note, VCS does not allow the modification of `default' attribute
sets. However, a `default' attribute set that has been copied under a
different name can be modified. (See the createprojection function.)
Example of Use:
vcs.show('projection') # Show all the existing projection methods
p=vcs.getprojection() # box instance of 'default' projection
# method
p2=vcs.getprojection('quick') # box2 instance of existing 'quick' projection
# graphics method
"""
# Check to make sure the argument passed in is a STRING
if not isinstance(Proj_name_src,str):
raise vcsError, 'The argument must be a string.'
if not Proj_name_src in vcs.elements["projection"]:
raise vcsError,"No such projection '%s'" % Proj_name_src
return vcs.elements["projection"][Proj_name_src]
def createboxfill(name=None, source='default'):
"""
Options:::
%s
%s
%s
:::
Input:::
%s
:::
Output:::
%s
:::
Function: createboxfill # Construct a new boxfill graphics method
Description of Function:
Create a new boxfill graphics method given the the name and the existing
boxfill graphics method to copy the attributes from. If no existing
boxfill graphics method name is given, then the default boxfill graphics
method will be used as the graphics method to which the attributes will
be copied from.
If the name provided already exists, then a error will be returned. Graphics
method names must be unique.
Example of Use:
vcs.show('boxfill')
box=vcs.createboxfill('example1',)
vcs.show('boxfill')
box=vcs.createboxfill('example2','quick')
vcs.show('boxfill')
#########################################################################################################################
########################################### ###############################################
########################################## End createboxfill Description ################################################
######################################### #################################################
#########################################################################################################################
"""
name,source = check_name_source(name,source,'boxfill')
return boxfill.Gfb(name, source)
createboxfill.__doc__ = createboxfill.__doc__ % (plot_keywords_doc,graphics_method_core,axesconvert, create_GM_input, boxfill_output)
def getboxfill(Gfb_name_src='default'):
"""
Options:::
%s
%s
%s
:::
Input:::
%s
:::
Output:::
%s
:::
Function: getboxfill # Construct a new boxfill graphics method
Description of Function:
VCS contains a list of graphics methods. This function will create a
boxfill class object from an existing VCS boxfill graphics method. If
no boxfill name is given, then boxfill 'default' will be used.
Note, VCS does not allow the modification of `default' attribute
sets. However, a `default' attribute set that has been copied under a
different name can be modified. (See the createboxfill function.)
Example of Use:
vcs.show('boxfill') # Show all the existing boxfill graphics methods
box=vcs.getboxfill() # box instance of 'default' boxfill graphics
# method
box2=vcs.getboxfill('quick') # box2 instance of existing 'quick' boxfill
# graphics method
######################################################################################################################
########################################### ###############################################
########################################## End getboxfill Description ################################################
######################################### #################################################
######################################################################################################################
"""
# Check to make sure the argument passed in is a STRING
if not isinstance(Gfb_name_src,str):
raise vcsError, 'The argument must be a string.'
if not Gfb_name_src in vcs.elements["boxfill"].keys():
raise "The boxfill method: '%s' does not seem to exist"
return vcs.elements["boxfill"][Gfb_name_src]
getboxfill.__doc__ = getboxfill.__doc__ % (plot_keywords_doc,graphics_method_core,axesconvert, get_GM_input, boxfill_output)
def createtaylordiagram(name=None, source='default'):
"""
Function: createtaylordiagram # Construct a new taylordiagram graphics method
Description of Function:
Create a new taylordiagram graphics method given the the name and the existing
taylordiagram graphics method to copy the attributes from. If no existing
taylordiagram graphics method name is given, then the default taylordiagram graphics
method will be used as the graphics method to which the attributes will
be copied from.
If the name provided already exists, then a error will be returned. Graphics
method names must be unique.
Example of Use:
vcs.show('taylordiagram')
td=vcs.createtaylordiagram('example1',)
vcs.show('taylordiagram')
td=vcs.createtaylordiagram('example2','quick')
vcs.show('taylordiagram')
"""
name,source = check_name_source(name,source,'taylordiagram')
if name in vcs.elements["taylordiagram"].keys():
raise vcsError, 'Error creating taylordiagram graphic method: '+Gtd_name+' already exist'
if not source in vcs.elements["taylordiagram"].keys():
raise vcsError, 'Error creating taylordiagram graphic method '+Gtd_name_src+' does not exist'
n=vcs.taylor.Gtd(name,source)
return n
def gettaylordiagram(Gtd_name_src='default'):
"""
Function: gettaylordiagram # Construct a new taylordiagram graphics method
Description of Function:
VCS contains a list of graphics methods. This function will create a
taylordiagram class object from an existing VCS taylordiagram graphics method. If
no taylordiagram name is given, then taylordiagram 'default' will be used.
Note, VCS does not allow the modification of `default' attribute
sets. However, a `default' attribute set that has been copied under a
different name can be modified. (See the createboxfill function.)
Example of Use:
vcs.show('taylordiagram') # Show all the existing taylordiagram graphics methods
td=vcs.gettaylordiagram() # td instance of 'default' taylordiagram graphics
# method
td2=vcs.gettaylordiagram('default') # td2 instance of existing 'default' taylordiagram
# graphics method
"""
# Check to make sure the argument passed in is a STRING
if not isinstance(Gtd_name_src,str):
raise vcsError, 'The argument must be a string.'
if not Gtd_name_src in vcs.elements["taylordiagram"].keys():
raise vcsError("The taylordiagram graphic method %s does not exists" % Gtd_name_src)
else:
return vcs.elements["taylordiagram"][Gtd_name_src]
def createmeshfill(name=None, source='default'):
"""
Function: createmeshfill # Construct a new meshfill graphics method
Description of Function:
Create a new meshfill graphics method given the the name and the existing
meshfill graphics method to copy the attributes from. If no existing
meshfill graphics method name is given, then the default meshfill graphics
method will be used as the graphics method to which the attributes will
be copied from.
If the name provided already exists, then a error will be returned. Graphics
method names must be unique.
Example of Use:
vcs.show('meshfill')
mesh=vcs.createmeshfill('example1',)
vcs.show('meshfill')
mesh=vcs.createmeshfill('example2','quick')
vcs.show('meshfill')
"""
name,source = check_name_source(name,source,'meshfill')
return meshfill.Gfm(name, source)
def getmeshfill(Gfm_name_src='default'):
"""
Function: getmeshfill # Construct a new meshfill graphics method
Description of Function:
VCS contains a list of graphics methods. This function will create a
meshfill class object from an existing VCS meshfill graphics method. If
no meshfill name is given, then meshfill 'default' will be used.
Note, VCS does not allow the modification of `default' attribute
sets. However, a `default' attribute set that has been copied under a
different name can be modified. (See the createmeshfill function.)
Example of Use:
a=vcs.init()
a.show('meshfill') # Show all the existing meshfill graphics methods
mesh=a.getmeshfill() # mesh instance of 'default' meshfill graphics
# method
mesh2=a.getmeshfill('quick') # mesh2 instance of existing 'quick' meshfill
# graphics method
"""
# Check to make sure the argument passed in is a STRING
if not isinstance(Gfm_name_src,str):
raise vcsError, 'The argument must be a string.'
if not Gfm_name_src in vcs.elements["meshfill"]:
raise ValueError,"meshfill '%s' does not exists" % Gfm_name_src
return vcs.elements["meshfill"][Gfm_name_src]
def createisofill(name=None, source='default'):
"""
Options:::
%s
%s
%s
:::
Input:::
%s
:::
Output:::
%s
:::
Function: createisofill # Construct a new isofill graphics method
Description of Function:
Create a new isofill graphics method given the the name and the existing
isofill graphics method to copy the attributes from. If no existing
isofill graphics method name is given, then the default isofill graphics
method will be used as the graphics method to which the attributes will
be copied from.
If the name provided already exists, then a error will be returned. Graphics
method names must be unique.
Example of Use:
vcs.show('isofill')
iso=vcs.createisofill('example1',)
vcs.show('isofill')
iso=vcs.createisofill('example2','quick')
vcs.show('isofill')
#########################################################################################################################
########################################### ###############################################
########################################## End createisofill Description ################################################
######################################### #################################################
#########################################################################################################################
"""
name,source = check_name_source(name,source,'isofill')
return isofill.Gfi(name, source)
createisofill.__doc__ = createisofill.__doc__ % (plot_keywords_doc, graphics_method_core, axesconvert, create_GM_input, isofill_output)
def getisofill(Gfi_name_src='default'):
"""
Options:::
%s
%s
%s
:::
Input:::
%s
:::
Output:::
%s
:::
Function: getisofill Construct a new isofill graphics method
Description of Function:
VCS contains a list of graphics methods. This function will create a
isofill class object from an existing VCS isofill graphics method. If
no isofill name is given, then isofill 'default' will be used.
Note, VCS does not allow the modification of `default' attribute
sets. However, a `default' attribute set that has been copied under a
different name can be modified. (See the createisofill function.)
Example of Use:
vcs.show('isofill') # Show all the existing isofill graphics methods
iso=vcs.getisofill() # iso instance of 'default' isofill graphics
# method
iso2=vcs.getisofill('quick') # iso2 instance of existing 'quick' isofill
# graphics method
######################################################################################################################
########################################### ###############################################
########################################## End getisofill Description ################################################
######################################### #################################################
######################################################################################################################
"""
# Check to make sure the argument passed in is a STRING
if not isinstance(Gfi_name_src,str):
raise vcsError, 'The argument must be a string.'
if not Gfi_name_src in vcs.elements["isofill"]:
raise ValueError,"The isofill '%s' does not exists" % Gfi_name_src
return vcs.elements["isofill"][Gfi_name_src]
getisofill.__doc__ = getisofill.__doc__ % (plot_keywords_doc,graphics_method_core,axesconvert, get_GM_input, isofill_output)
def createisoline(name=None, source='default'):
"""
Options:::
%s
%s
%s
:::
Input:::
%s
:::
Output:::
%s
:::
Function: createisoline # Construct a new isoline graphics method
Description of Function:
Create a new isoline graphics method given the the name and the existing
isoline graphics method to copy the attributes from. If no existing
isoline graphics method name is given, then the default isoline graphics
method will be used as the graphics method to which the attributes will
be copied from.
If the name provided already exists, then a error will be returned. Graphics
method names must be unique.
Example of Use:
vcs.show('isoline')
iso=vcs.createisoline('example1',)
vcs.show('isoline')
iso=vcs.createisoline('example2','quick')
vcs.show('isoline')
#########################################################################################################################
########################################### ###############################################
########################################## End createisoline Description ################################################
######################################### #################################################
#########################################################################################################################
"""
name,source = check_name_source(name,source,'isoline')
return isoline.Gi(name, source)
createisoline.__doc__ = createisoline.__doc__ % (plot_keywords_doc,graphics_method_core,axesconvert, create_GM_input, isoline_output)
def getisoline(Gi_name_src='default'):
"""
Options:::
%s
%s
%s
:::
Input:::
%s
:::
Output:::
%s
:::
Function: getisoline # Construct a new isoline graphics method
Description of Function:
VCS contains a list of graphics methods. This function will create a
isoline class object from an existing VCS isoline graphics method. If
no isoline name is given, then isoline 'default' will be used.
Note, VCS does not allow the modification of `default' attribute
sets. However, a `default' attribute set that has been copied under a
different name can be modified. (See the createisoline function.)
Example of Use:
vcs.show('isoline') # Show all the existing isoline graphics methods
iso=vcs.getisoline() # iso instance of 'default' isoline graphics
# method
iso2=vcs.getisoline('quick') # iso2 instance of existing 'quick' isoline
gm.linewidth=0
# graphics method
######################################################################################################################
########################################### ###############################################
########################################## End getisoline Description ################################################
######################################### #################################################
######################################################################################################################
"""
# Check to make sure the argument passed in is a STRING
if not isinstance(Gi_name_src,str):
raise vcsError, 'The argument must be a string.'
if not Gi_name_src in vcs.elements["isoline"]:
raise ValueError,"The isoline '%s' does not exists" % Gi_name_src
return vcs.elements["isoline"][Gi_name_src]
getisoline.__doc__ = getisoline.__doc__ % (plot_keywords_doc,graphics_method_core,axesconvert, get_GM_input, isoline_output)
def create1d(name=None,source='default'):
name,source = check_name_source(name,source,'1d')
return unified1D.G1d(name,source)
def get1d(name):
# Check to make sure the argument passed in is a STRING
if not isinstance(name,str):
raise vcsError, 'The argument must be a string.'
if not name in vcs.elements["1d"]:
raise ValueError,"The 1d '%s' graphics method does not exists" % name
return vcs.elements["1d"][name]
def createxyvsy(name=None, source='default'):
"""
Options:::
%s
%s
%s
:::
Input:::
%s
:::
Output:::
%s
:::
Function: createxyvsy # Construct a new Xyvsy graphics method
Description of Function:
Create a new Xyvsy graphics method given the the name and the existing
Xyvsy graphics method to copy the attributes from. If no existing
Xyvsy graphics method name is given, then the default Xyvsy graphics
method will be used as the graphics method to which the attributes will
be copied from.
If the name provided already exists, then a error will be returned. Graphics
method names must be unique.
Example of Use:
a=vcs.init()
vcs.show('xyvsy')
xyy=vcs.createxyvsy('example1',)
vcs.show('xyvsy')
xyy=vcs.createxyvsy('example2','quick')
vcs.show('xyvsy')
#######################################################################################################################
########################################### ###############################################
########################################## End createxyvsy Description ################################################
######################################### #################################################
#######################################################################################################################
"""
if source[-7:]=="_xyvsy_":
source = source[:-7]
name,source = check_name_source(name,source,'xyvsy')
gm = unified1D.G1d(name+"_xyvsy_", source+"_xyvsy_")
gm.flip = True
vcs.elements["xyvsy"][name]=gm
return gm
createxyvsy.__doc__ = createxyvsy.__doc__ % (plot_keywords_doc, graphics_method_core, axesconvert, create_GM_input, xyvsy_output)
def getxyvsy(GXy_name_src='default'):
"""
Options:::
%s
%s
%s
:::
Input:::
%s
:::
Output:::
%s
:::
Function: getxyvsy # Construct a new Xyvsy graphics method
Description of Function:
VCS contains a list of graphics methods. This function will create a
Xyvsy class object from an existing VCS Xyvsy graphics method. If
no Xyvsy name is given, then Xyvsy 'default' will be used.
Note, VCS does not allow the modification of `default' attribute
sets. However, a `default' attribute set that has been copied under a
different name can be modified. (See the createxyvsy function.)
Example of Use:
a=vcs.init()
vcs.show('xyvsy') # Show all the existing Xyvsy graphics methods
xyy=vcs.getxyvsy() # xyy instance of 'default' Xyvsy graphics
# method
xyy2=vcs.getxyvsy('quick') # xyy2 instance of existing 'quick' Xyvsy
# graphics method
####################################################################################################################
########################################### ###############################################
########################################## End getxyvsy Description ################################################
######################################### #################################################
####################################################################################################################
"""
# Check to make sure the argument passed in is a STRING
if not isinstance(GXy_name_src,str):
raise vcsError, 'The argument must be a string.'
if GXy_name_src[-7:]=="_xyvsy_":
GXy_name_src = GXy_name_src[:-7]
if not GXy_name_src in vcs.elements["xyvsy"]:
raise ValueError,"The xyvsy '%s' graphics method does not exists" % GXy_name_src
return vcs.elements["xyvsy"][GXy_name_src]
getxyvsy.__doc__ = getxyvsy.__doc__ % (plot_keywords_doc, graphics_method_core, axesconvert, get_GM_input, xyvsy_output)
def createyxvsx(name=None, source='default'):
"""
Options:::
%s
%s
%s
:::
Input:::
%s
:::
Output:::
%s
:::
Function: createyxvsx # Construct a new Yxvsx graphics method
Description of Function:
Create a new Yxvsx graphics method given the the name and the existing
Yxvsx graphics method to copy the attributes from. If no existing
Yxvsx graphics method name is given, then the default Yxvsx graphics
method will be used as the graphics method to which the attributes will
be copied from.
If the name provided already exists, then a error will be returned. Graphics
method names must be unique.
Example of Use:
a=vcs.init()
vcs.show('yxvsx')
yxx=vcs.createyxvsx('example1',)
vcs.show('yxvsx')
yxx=vcs.createyxvsx('example2','quick')
vcs.show('yxvsx')
#######################################################################################################################
########################################### ###############################################
########################################## End createyxvsx Description ################################################
######################################### #################################################
#######################################################################################################################
"""
if source[-7:]=="_yxvsx_":
source = source[:-7]
name,source = check_name_source(name,source,'yxvsx')
gm = unified1D.G1d(name+"_yxvsx_", source+"_yxvsx_")
vcs.elements["yxvsx"][name]=gm
return gm
createyxvsx.__doc__ = createyxvsx.__doc__ % (plot_keywords_doc, graphics_method_core, axesconvert, create_GM_input, yxvsx_output)
def getyxvsx(GYx_name_src='default'):
"""
Options:::
%s
%s
%s
:::
Input:::
%s
:::
Output:::
%s
:::
Function: getyxvsx # Construct a new Yxvsx graphics method
Description of Function:
VCS contains a list of graphics methods. This function will create a
Yxvsx class object from an existing VCS Yxvsx graphics method. If
no Yxvsx name is given, then Yxvsx 'default' will be used.
Note, VCS does not allow the modification of `default' attribute
sets. However, a `default' attribute set that has been copied under a
different name can be modified. (See the createyxvsx function.)
Example of Use:
a=vcs.init()
vcs.show('yxvsx') # Show all the existing Yxvsx graphics methods
yxx=vcs.getyxvsx() # yxx instance of 'default' Yxvsx graphics
# method
yxx2=vcs.getyxvsx('quick') # yxx2 instance of existing 'quick' Yxvsx
# graphics method
####################################################################################################################
########################################### ###############################################
########################################## End getyxvsx Description ################################################
######################################### #################################################
####################################################################################################################
"""
# Check to make sure the argument passed in is a STRING
if not isinstance(GYx_name_src,str):
raise vcsError, 'The argument must be a string.'
if GYx_name_src[-7:] == "_yxvsx_":
GYx_name_src=GYx_name_src[:-7]
if not GYx_name_src in vcs.elements["yxvsx"]:
raise ValueError,"The Yxvsx '%s' graphics method does not exists" % GYx_name_src
return vcs.elements["yxvsx"][GYx_name_src]
getyxvsx.__doc__ = getyxvsx.__doc__ % (plot_keywords_doc, graphics_method_core, axesconvert, get_GM_input, yxvsx_output)
def createxvsy( name=None, source='default'):
"""
Options:::
%s
%s
%s
:::
Input:::
%s
:::
Output:::
%s
:::
Function: createxvsy # Construct a new XvsY graphics method
Description of Function:
Create a new XvsY graphics method given the the name and the existing
XvsY graphics method to copy the attributes from. If no existing
XvsY graphics method name is given, then the default XvsY graphics
method will be used as the graphics method to which the attributes will
be copied from.
If the name provided already exists, then a error will be returned. Graphics
method names must be unique.
Example of Use:
a=vcs.init()
vcs.show('xvsy')
xy=vcs.createxvsy('example1',)
vcs.show('xvsy')
xy=vcs.createxvsy('example2','quick')
vcs.show('xvsy')
######################################################################################################################
########################################### ###############################################
########################################## End createxvsy Description ################################################
######################################### #################################################
######################################################################################################################
"""
if source[-6:]=="_xvsy_":
source = source[:-6]
name,source = check_name_source(name,source,'xvsy')
gm = unified1D.G1d(name+"_xvsy_", source+"_xvsy_")
vcs.elements["xvsy"][name]=gm
return gm
createxvsy.__doc__ = createxvsy.__doc__ % (plot_keywords_doc, graphics_method_core, axesconvert, create_GM_input, xvsy_output)
def getxvsy(GXY_name_src='default'):
"""
Options:::
%s
%s
%s
:::
Input:::
%s
:::
Output:::
%s
:::
Function: getxvsy # Construct a new XvsY graphics method
Description of Function:
VCS contains a list of graphics methods. This function will create a
XvsY class object from an existing VCS XvsY graphics method. If
no XvsY name is given, then XvsY 'default' will be used.
Note, VCS does not allow the modification of `default' attribute
sets. However, a `default' attribute set that has been copied under a
different name can be modified. (See the createxvsy function.)
Example of Use:
a=vcs.init()
vcs.show('xvsy') # Show all the existing XvsY graphics methods
xy=vcs.getxvsy() # xy instance of 'default' XvsY graphics
# method
xy2=vcs.getxvsy('quick') # xy2 instance of existing 'quick' XvsY
# graphics method
###################################################################################################################
########################################### ###############################################
########################################## End getxvsy Description ################################################
######################################### #################################################
###################################################################################################################
"""
# Check to make sure the argument passed in is a STRING
if not isinstance(GXY_name_src,str):
raise vcsError, 'The argument must be a string.'
if GXY_name_src[-6:] == "_xvsy_":
GXY_name_src=GXY_name_src[:-6]
if not GXY_name_src in vcs.elements["xvsy"]:
raise ValueError,"The xvsy '%s' graphics method does not exists" % GXY_name_src
return vcs.elements["xvsy"][GXY_name_src]
getxvsy.__doc__ = getxvsy.__doc__ % (plot_keywords_doc, graphics_method_core, axesconvert, get_GM_input, xvsy_output)
def createvector( name=None, source='default'):
"""
Function: createvector # Construct a new vector graphics method
Description of Function:
Create a new vector graphics method given the the name and the existing
vector graphics method to copy the attributes from. If no existing
vector graphics method name is given, then the default vector graphics
method will be used as the graphics method to which the attributes will
be copied from.
If the name provided already exists, then a error will be returned. Graphics
method names must be unique.
Example of Use:
a=vcs.init()
vcs.show('vector')
vec=vcs.createvector('example1',)
vcs.show('vector')
vec=vcs.createvector('example2','quick')
vcs.show('vector')
"""
name,source = check_name_source(name,source,'vector')
return vector.Gv(name, source)
def getvector(Gv_name_src='default'):
"""
Function: getvector # Construct a new vector graphics method
Description of Function:
VCS contains a list of graphics methods. This function will create a
vector class object from an existing VCS vector graphics method. If
no vector name is given, then vector 'default' will be used.
Note, VCS does not allow the modification of `default' attribute
sets. However, a `default' attribute set that has been copied under a
different name can be modified. (See the createvector function.)
Example of Use:
a=vcs.init()
vcs.show('vector') # Show all the existing vector graphics methods
vec=vcs.getvector() # vec instance of 'default' vector graphics
# method
vec2=vcs.getvector('quick') # vec2 instance of existing 'quick' vector
# graphics method
"""
# Check to make sure the argument passed in is a STRING
if not isinstance(Gv_name_src,str):
raise vcsError, 'The argument must be a string.'
if not Gv_name_src in vcs.elements["vector"]:
raise ValueError, "The vector '%s' does not exist" % Gv_name_src
return vcs.elements["vector"][Gv_name_src]
def createscatter( name=None, source='default'):
"""
Options:::
%s
%s
%s
:::
Input:::
%s
:::
Output:::
%s
:::
Function: createscatter # Construct a new scatter graphics method
Description of Function:
Create a new scatter graphics method given the the name and the existing
scatter graphics method to copy the attributes from. If no existing
scatter graphics method name is given, then the default scatter graphics
method will be used as the graphics method to which the attributes will
be copied from.
If the name provided already exists, then a error will be returned. Graphics
method names must be unique.
Example of Use:
a=vcs.init()
vcs.show('scatter')
sct=vcs.createscatter('example1',)
vcs.show('scatter')
sct=vcs.createscatter('example2','quick')
vcs.show('scatter')
#########################################################################################################################
########################################### ###############################################
########################################## End createscatter Description ################################################
######################################### #################################################
#########################################################################################################################
"""
if source[-9:] == "_scatter_":
source=source[:-9]
name,source = check_name_source(name,source,'scatter')
gm = unified1D.G1d(name+"_scatter_", source+"_scatter_")
gm.linewidth=0
vcs.elements["scatter"][name]=gm
return gm
createscatter.__doc__ = createscatter.__doc__ % (plot_keywords_doc,graphics_method_core,axesconvert, create_GM_input, scatter_output)
def getscatter(GSp_name_src='default'):
"""
Options:::
%s
%s
%s
:::
Input:::
%s
:::
Output:::
%s
:::
Function: getscatter # Construct a new scatter graphics method
Description of Function:
VCS contains a list of graphics methods. This function will create a
scatter class object from an existing VCS scatter graphics method. If
no scatter name is given, then scatter 'default' will be used.
Note, VCS does not allow the modification of `default' attribute
sets. However, a `default' attribute set that has been copied under a
different name can be modified. (See the createscatter function.)
Example of Use:
a=vcs.init()
vcs.show('scatter') # Show all the existing scatter graphics methods
sct=vcs.getscatter() # sct instance of 'default' scatter graphics