Last change
on this file since 2199 was 1757, checked in by Kana Sugimoto, 14 years ago |
New Development: Yes
JIRA Issue: Yes (CAS-2211)
Ready for Test: Yes
Interface Changes: Yes
What Interface Changed: ASAP 3.0.0 interface changes
Test Programs:
Put in Release Notes: Yes
Module(s): all the CASA sd tools and tasks are affected.
Description: Merged ATNF-ASAP 3.0.0 developments to CASA (alma) branch.
Note you also need to update casa/code/atnf.
|
File size:
1.3 KB
|
Line | |
---|
1 | #!/usr/bin/env python
|
---|
2 |
|
---|
3 | from asap import *
|
---|
4 | from numpy import array
|
---|
5 |
|
---|
6 | # don't print any messages
|
---|
7 | rcParams['verbose'] = 0
|
---|
8 | # load data unaveraged
|
---|
9 |
|
---|
10 | scan = scantable("../test/data/tid-t002.rpf", average=False)
|
---|
11 | print scan
|
---|
12 | # select only one IF/Pol/Beam
|
---|
13 | sel = selector()
|
---|
14 | sel.set_ifs(0)
|
---|
15 | sel.set_polarisations(0)
|
---|
16 | sel.set_beams(0)
|
---|
17 | scan.set_selection(sel)
|
---|
18 |
|
---|
19 | # plot in GHz
|
---|
20 | scan.set_unit("GHz")
|
---|
21 |
|
---|
22 | # get all spectra into a matrix [ ncycle x nchan ]
|
---|
23 | mat = array([ spectrum for spectrum in scan ])
|
---|
24 |
|
---|
25 | # find the min/max values
|
---|
26 | xax = scan.get_abcissa()
|
---|
27 | xmin = min(xax[0])
|
---|
28 | xmax = max(xax[0])
|
---|
29 |
|
---|
30 | # a bit more complicate because we want to plot nice time axis labels
|
---|
31 | yax = scan.get_time(asdatetime=True)
|
---|
32 | ymin = min(xyplotter.date2num(yax))
|
---|
33 | ymax = max(xyplotter.date2num(yax))
|
---|
34 |
|
---|
35 |
|
---|
36 | # the date labels are a bit wide, so set the viewport
|
---|
37 | xyplotter.axes([0.2,0.1,0.7,0.8])
|
---|
38 |
|
---|
39 | # plot the waterfall
|
---|
40 | xyplotter.imshow(mat,
|
---|
41 | aspect='auto', # scale to fill the plot
|
---|
42 | origin='lower', # start at the bottom-left
|
---|
43 | extent=[xmin,xmax,ymin,ymax], # give the axes coordinates
|
---|
44 | interpolation='nearest'
|
---|
45 | )
|
---|
46 | xyplotter.gca().yaxis_date() # tell the plotter that the yaxis is using dates
|
---|
47 |
|
---|
48 | # display axis labels
|
---|
49 | xyplotter.xlabel(xax[1])
|
---|
50 | xyplotter.ylabel("Obs. Time")
|
---|
51 |
|
---|
52 | #xyplotter.savefig("test.ps",orientation="landscape")
|
---|
Note:
See
TracBrowser
for help on using the repository browser.