IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 26386


Ignore:
Timestamp:
Dec 11, 2009, 1:59:41 PM (17 years ago)
Author:
bills
Message:

comment changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/addstar/src/psps_ids.c

    r26384 r26386  
    11# include "addstar.h"
    22
    3 // Compute PSPS defined IDs
     3// Compute IDs for PSPS based on recipe they defined
    44
    55uint64_t
    66CreatePSPSDetectionID(double tobs, int ccdid, int detID)
    77{
    8 //    double floor();
    98    // t0 for detection id is 2007-01-01 00:00:00 utc
    109    double  t0 = 54101.0;
    11     double diff;
    12     int itmp;
    13     uint64_t detectid;
    14        
    15     diff = floor( 100000. * (tobs - t0) );
    16     itmp = diff;
     10    double diff = floor( 100000. * (tobs - t0) );
     11    int itmp = diff;
     12
    1713    // ccdid must be < 100
    18     detectid = 1000000000*((uint64_t) itmp) + 10000000 * ((uint64_t) ccdid) +
     14    uint64_t detectid = 1000000000*((uint64_t) itmp) + 10000000 * ((uint64_t) ccdid) +
    1915             ((uint64_t) detID);
    2016
     
    2521CreatePSPSObjectID(double ra, double dec)
    2622{
     23    double zh = 0.0083333;
     24    double zid = (dec + 90.) / zh;             // 0 - 180*60*2 = 21600 < 15 bits
     25    int izone = (int) floor(zid);
     26    double zresid = zid -  ((float) izone);    // 0.0 - 1.0
     27
    2728    uint64_t part1, part2, part3;
    28     double zid, zresid;
    29     int izone;
    30     double zh = 0.0083333;
    31    
    32     zid = (dec + 90.) / zh;             // 0 - 180*60*2 = 21600 < 15 bits
    33     izone = (int) floor(zid);
    34     zresid = zid -  ((float) izone);    // 0.0 - 1.0
    35 
    3629    part1 = (uint64_t)( izone  * 10000000000000) ;
    3730    part2 = ((uint64_t)(ra * 1000000.)) * 10000 ; // 0 - 360*1e6 = 3.6e8 (< 29 bits)
    38     part3 = (int) (zresid * 10000.0) ; // 0 - 10000 (1 bit == 30/10000 arcsec (< 14 bits)
     31    part3 = (int) (zresid * 10000.0) ; // 0 - 10000 (1 bit == 30/10000 arcsec) (< 14 bits)
    3932
    4033    return part1 + part2 + part3;
Note: See TracChangeset for help on using the changeset viewer.