Changeset 2718 for trunk/python
- Timestamp:
- 01/09/13 14:27:57 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asapplotter.py
r2717 r2718 1837 1837 asaplog.post("WARN") 1838 1838 1839 # # Center and spacing1840 # dirarr = array(self._data.get_directionval()).transpose()1841 # print "Pointing range: (x, y) = (%f - %f, %f - %f)" %\1842 # (dirarr[0].min(),dirarr[0].max(),dirarr[1].min(),dirarr[1].max())1843 # dircent = [0.5*(dirarr[0].max() + dirarr[0].min()),1844 # 0.5*(dirarr[1].max() + dirarr[1].min())]1845 # del dirarr1846 # if center is None:1847 # #asaplog.post()1848 # asaplog.push("Grid center is not specified. Automatically calculated from pointing center.")1849 # #asaplog.post("WARN")1850 # #center = [dirarr[0].mean(), dirarr[1].mean()]1851 # center = dircent1852 # elif (type(center) in (list, tuple)) and len(center) > 1:1853 # from numpy import pi1854 # # make sure center_x is in +-pi of pointing center1855 # # (assumes dirs are in rad)1856 # rotnum = round(abs(center[0] - dircent[0])/(2*pi))1857 # if center[0] < dircent[0]: rotnum *= -11858 # cenx = center[0] - rotnum*2*pi1859 # center = [cenx, center[1]]1860 # else:1861 # msg = "Direction of grid center should be a list of float (R.A., Dec.)"1862 # raise ValueError, msg1863 # asaplog.push("Grid center: (%f, %f) " % (center[0],center[1]))1864 1865 # if spacing is None:1866 # #asaplog.post()1867 # asaplog.push("Grid spacing not specified. Automatically calculated from map coverage")1868 # #asaplog.post("WARN")1869 # # automatically get spacing1870 # dirarr = array(self._data.get_directionval()).transpose()1871 # wx = 2. * max(abs(dirarr[0].max()-center[0]),1872 # abs(dirarr[0].min()-center[0]))1873 # wy = 2. * max(abs(dirarr[1].max()-center[1]),1874 # abs(dirarr[1].min()-center[1]))1875 # ## slightly expand area to plot the edges1876 # #wx *= 1.11877 # #wy *= 1.11878 # xgrid = wx/max(self._cols-1.,1.)1879 # #xgrid = wx/float(max(self._cols,1.))1880 # xgrid *= cos(center[1])1881 # ygrid = wy/max(self._rows-1.,1.)1882 # #ygrid = wy/float(max(self._rows,1.))1883 # # single pointing (identical R.A. and/or Dec. for all spectra.)1884 # if xgrid == 0:1885 # xgrid = 1.1886 # if ygrid == 0:1887 # ygrid = 1.1888 # # spacing should be negative to transpose plot1889 # spacing = [- xgrid, - ygrid]1890 # del dirarr, xgrid, ygrid1891 # #elif isinstance(spacing, str):1892 # # # spacing is a quantity1893 # elif (type(spacing) in (list, tuple)) and len(spacing) > 1:1894 # for i in xrange(2):1895 # val = spacing[i]1896 # if not isinstance(val, float):1897 # raise TypeError("spacing should be a list of float")1898 # if val > 0.:1899 # spacing[i] = -val1900 # spacing = spacing[0:2]1901 # else:1902 # msg = "Invalid spacing."1903 # raise TypeError(msg)1904 # asaplog.push("Spacing: (%f, %f) (projected)" % (spacing[0],spacing[1]))1905 1906 1839 # Prepare plotter 1907 1840 self._assert_plotter(action="reload")
Note:
See TracChangeset
for help on using the changeset viewer.