-
Notifications
You must be signed in to change notification settings - Fork 3
Tutorial
thespacedoctor edited this page Nov 10, 2015
·
2 revisions
> from HMpTy import htm
> mesh16 = htm.HTM(16)
> mesh16.get_depth()
16
> mesh16.lookup_id(34.67583, -45.83729)
array([38212953442])
Note this returns a numpy array
> mesh16.lookup_id([34.67583,56.3434234,345.3434533], [-45.83729,65.234345,70.343224])
array([38212953442, 66553803098, 53494138281])
> mesh16.intersect(34.67583, -45.83729, 2.0/3600., inclusive=True)
array([38212953440, 38212953442, 38212953443, 38212953568, 38212953569, 38212953571])
> mesh16.area()
1.200619190041304e-06
The output is in degrees.
# match within two arcseconds
two = 2.0/3600.
> ra1 = [200.0, 200.0, 200.0, 175.23, 21.36]
> dec1 = [24.3, 24.3, 24.3, -28.25, -15.32]
> ra2 = [200.0, 200.0, 200.0, 175.23, 55.25]
> dec2 = [24.3+0.75*two, 24.3 + 0.25*two, 24.3 - 0.33*two, -28.25 + 0.58*two, 75.22]
> indexList1,indexList2,separation = mesh16.match(ra1,dec1,ra2,dec2,two,maxmatch=0)
> for i in xrange(indexList1.size):
print indexList1[i],indexList2[i],separation[i]
The output is the index of first list, with the matched index of the second list and the distance between the two points.
0 1 0.00013888984367
0 2 0.00018333285694
0 0 0.000416666032158
1 1 0.00013888984367
1 2 0.00018333285694
1 0 0.000416666032158
2 1 0.00013888984367
2 2 0.00018333285694
2 0 0.000416666032158
3 3 0.000322221232243