Commit a43baab3 authored by marc's avatar marc
Browse files

added floor for steps and import some math stuff"

parent 99ff93a8
......@@ -5,7 +5,9 @@ from astropy import units as u
from astropy.coordinates import SkyCoord
import sys
import logging
import math
from math import floor
from math import cos
from math import radians
'''
Setup logging
......@@ -59,15 +61,15 @@ class CreatePointings(Ui_FormCreatePoinings):
pointings=0
raSign=-1
# m x n matrix of pointings with stepsSize steps
for decStep in range (-m,m):
for decStep in range (floor(-m/2),floor(m/2)):
decOffset=decCentrePoint+decStep*stepSize
raSign=-raSign
for raStep in range(-n,n):
for raStep in range(floor(-n/2),floor(n/2)):
if raSign==1:
raOffset=raCentrePoint+((stepSize*raStep*raSign)/math.cos(math.radians(decOffset)))
raOffset=raCentrePoint+((stepSize*raStep*raSign)/cos(radians(decOffset)))
else:
#raOffset=raCentrePoint+((stepSize*raStep+stepSize/2)*raSign)/math.cos(math.radians(decOffset))
raOffset=raCentrePoint+((stepSize*(raStep+1))*raSign)/math.cos(math.radians(decOffset))
raOffset=raCentrePoint+((stepSize*(raStep+1))*raSign)/cos(radians(decOffset))
logger.debug('raOffset: {0} raSign {1}'.format(raOffset,raSign))
self.measList.append(SkyCoord(ra=raOffset*u.degree,dec=decOffset*u.degree,frame='icrs'))
pointings+=1
......
......@@ -202,8 +202,11 @@
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>30</number>
<number>20</number>
</property>
<property name="value">
<number>1</number>
......@@ -215,6 +218,9 @@
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>30</number>
</property>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment