-
Notifications
You must be signed in to change notification settings - Fork 3
/
README
71 lines (58 loc) · 2.61 KB
/
README
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
README
------
Authors: Pierre Fernique [Centre de Donnees astronomiques de Strasbourg]
Licence: GPL3
1) What is a MOC => http://ivoa.net/documents/MOC/
2) Where is the "main" classes of this lib
space MOC => cds.moc.SMoc
time MOC => cds.moc.TMoc
space-time MOC => cds.moc.STMoc
3) Can I use HealpixMoc as I did before
Yes you can, but this class is now a wrapper to SMoc. Have a look on the source code of this
class for helping you to move to SMoc (really easy)
4) How to use MOC => cds.moc.Example.java
5) How to check that my MOC is valid: http://alasky.u-strasbg.fr/MocServer/lint
6) Examples:
a) Create and save a space MOC:
// Assuming that you have a Collection/array of longs
// which represent the Healpix (NESTED) cell numbers of your spatial region
// at a dedicated HEALPix order
// You want to create the MOC a save it in a file.
SMoc moc = new SMoc( order );
moc.bufferOn(); // Buffering is not required, required a little more space, but faster
for( long hpix : array ) moc.add( order, hpix);
moc.bufferOff(); // Stop buffering
moc.write( filename );
b) Load and compare space MOCs:
// You want to load a MOC from a file and compute the intersection with
// a spatial region that you provide as a MOC (written in ASCII format)
SMoc myMoc, interMoc;
SMoc moc = new SMoc();
moc.read( filename );
myMoc = new SMoc("3/1 2 3 4/17-19");
interMoc = moc.intersection( myMoc );
c) Generate a space MOC from a Collection of sky coordinates
// You want to generate the MOC covering a set of sky positions.
// The MOC is generated at a dedicated resolution "mocOrder=13"
// Note: angRes = Math.sqrt( 4*Math.PI/(12*Healpix.pow2(order) *
// Healpix.pow2(order) ) )
SMoc moc = new SMoc(13);
Healpix hpx = new Healpix();
for( int i=0; i<100000; i++ ) {
double lon = Math.random()*360;
double lat = Math.random()*180 -90;
moc.add( hpx, lon, lat);
}
d) Create and save a STMOC from a Collection of sky coordinates and dates
STMoc moc = new STMoc(31,13); // time order 31 => 17mn, space order 13 => 25.77"
Healpix hpx = new Healpix();
for( int i=0; i<100000; i++ ) {
double lon = Math.random()*360;
double lat = Math.random()*180 -90;
double jdmin = Math.random()*10000. + 2400000.5
double jdmax = jdmin + Math.random()*10.;
moc.add( hpx, lon, lat, jdmin, jdmax);
}
7) May I use my own HEALPix lib ?
Yes, just provide an alternative of cds.moc.Healpix.java class for implementing
cds.moc.HealpixImpl.java interface