IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 37570


Ignore:
Timestamp:
Nov 8, 2014, 7:34:47 PM (12 years ago)
Author:
eugene
Message:

first pass at loadICRF

Location:
branches/eam_branches/ipp-20140904/Ohana/src
Files:
2 added
12 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140904/Ohana/src/addstar/Makefile

    r37422 r37570  
    2626loadstarpar  : $(BIN)/loadstarpar.$(ARCH)
    2727loadstarpar_client : $(BIN)/loadstarpar_client.$(ARCH)
     28loadICRF  : $(BIN)/loadICRF.$(ARCH)
     29loadICRF_client : $(BIN)/loadICRF_client.$(ARCH)
    2830loadwise     : $(BIN)/loadwise.$(ARCH)
    2931dumpskycells : $(BIN)/dumpskycells.$(ARCH)
     
    3335mkcmf        : $(BIN)/mkcmf.$(ARCH)
    3436
    35 all: addstar addstar_client sedstar load2mass loadstarpar loadstarpar_client skycells mkcmf loadwise loadsupercos dumpskycells findskycell
    36 
    37 INSTALL = addstar addstar_client sedstar load2mass loadstarpar loadstarpar_client skycells mkcmf loadwise loadsupercos dumpskycells findskycell
     37all: addstar addstar_client sedstar load2mass loadstarpar loadstarpar_client loadICRF loadICRF_client skycells mkcmf loadwise loadsupercos dumpskycells findskycell
     38
     39INSTALL = addstar addstar_client sedstar load2mass loadstarpar loadstarpar_client loadICRF loadICRF_client skycells mkcmf loadwise loadsupercos dumpskycells findskycell
    3840
    3941# I need to fix the client/server version of addstar now that I have dropped Stars
     
    277279$(SRC)/psps_ids.$(ARCH).o
    278280
     281LOAD-ICRF = \
     282$(SRC)/loadICRF.$(ARCH).o \
     283$(SRC)/ConfigInit.$(ARCH).o \
     284$(SRC)/SetSignals.$(ARCH).o \
     285$(SRC)/Shutdown.$(ARCH).o \
     286$(SRC)/SkyRegionUtils.$(ARCH).o \
     287$(SRC)/args_loadICRF.$(ARCH).o \
     288$(SRC)/find_matches_ICRF.$(ARCH).o \
     289$(SRC)/loadICRF_catalog.$(ARCH).o \
     290$(SRC)/loadICRF_io.$(ARCH).o \
     291$(SRC)/loadICRF_make_subset.$(ARCH).o \
     292$(SRC)/loadICRF_readstars.$(ARCH).o \
     293$(SRC)/loadICRF_remote_hosts.$(ARCH).o \
     294$(SRC)/loadICRF_save_remote.$(ARCH).o \
     295$(SRC)/loadICRF_table.$(ARCH).o \
     296$(SRC)/psps_ids.$(ARCH).o
     297
     298LOAD-ICRF-CLIENT = \
     299$(SRC)/loadICRF_client.$(ARCH).o \
     300$(SRC)/ConfigInit.$(ARCH).o \
     301$(SRC)/SetSignals.$(ARCH).o \
     302$(SRC)/Shutdown.$(ARCH).o \
     303$(SRC)/SkyRegionUtils.$(ARCH).o \
     304$(SRC)/args_loadICRF.$(ARCH).o \
     305$(SRC)/find_matches_ICRF.$(ARCH).o \
     306$(SRC)/loadICRF_catalog.$(ARCH).o \
     307$(SRC)/loadICRF_io.$(ARCH).o \
     308$(SRC)/loadICRF_make_subset.$(ARCH).o \
     309$(SRC)/loadICRF_readstars.$(ARCH).o \
     310$(SRC)/loadICRF_remote_hosts.$(ARCH).o \
     311$(SRC)/loadICRF_save_remote.$(ARCH).o \
     312$(SRC)/loadICRF_table.$(ARCH).o \
     313$(SRC)/psps_ids.$(ARCH).o
     314
    279315LOAD-WISE = \
    280316$(SRC)/loadwise.$(ARCH).o \
     
    356392$(LOAD-STARPAR)        : $(INC)/addstar.h $(INC)/loadstarpar.h
    357393$(LOAD-STARPAR-CLIENT) : $(INC)/addstar.h $(INC)/loadstarpar.h
     394$(LOAD-ICRF)           : $(INC)/addstar.h $(INC)/loadICRF.h
     395$(LOAD-ICRF-CLIENT)    : $(INC)/addstar.h $(INC)/loadICRF.h
    358396$(LOAD-WISE)           : $(INC)/addstar.h $(INC)/WISE.h
    359397$(MKCMF)               : $(INC)/mkcmf.h
     
    370408$(BIN)/loadstarpar.$(ARCH)    : $(LOAD-STARPAR)
    371409$(BIN)/loadstarpar_client.$(ARCH) : $(LOAD-STARPAR-CLIENT)
     410$(BIN)/loadICRF.$(ARCH)       : $(LOAD-ICRF)
     411$(BIN)/loadICRF_client.$(ARCH): $(LOAD-ICRF-CLIENT)
    372412$(BIN)/loadsupercos.$(ARCH)   : $(LOAD-SUPERCOS)
    373413$(BIN)/skycells.$(ARCH)       : $(SKYCELLS)
  • branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/args_loadICRF.c

    r37567 r37570  
    11# include "addstar.h"
    2 # include "loadstarpar.h"
     2# include "loadICRF.h"
    33
    44static void help (void);
    55static void help_client (void);
    66
    7 AddstarClientOptions args_loadstarpar (int argc, char **argv, AddstarClientOptions options) {
     7AddstarClientOptions args_loadICRF (int argc, char **argv, AddstarClientOptions options) {
    88 
    99  int N;
     
    5959    remove_argument (N, &argc, argv);
    6060  }
    61   /* only add to existing objects */
    62   options.only_match = FALSE;
    63   if ((N = get_argument (argc, argv, "-only-match"))) {
    64     options.only_match = TRUE;
    65     remove_argument (N, &argc, argv);
    66   }
    6761  /* replace measurement, don't duplicate (ref/cat only) */
    6862  options.replace = FALSE;
     
    7973  }
    8074
    81   /* other addstar options which cannot be used in loadstarpar */
     75  /* other addstar options which cannot be used in loadICRF */
    8276  options.photcode = 0;
    8377  options.timeref = 0;
     
    9791
    9892  if (argc < 2) {
    99     fprintf (stderr, "USAGE: loadstarpar [options] (fitsfile) [..more files]\n");
     93    fprintf (stderr, "USAGE: loadICRF [options] (file) [..more files]\n");
    10094    exit (2);
    10195  }
     
    10397}
    10498
    105 AddstarClientOptions args_loadstarpar_client (int argc, char **argv, AddstarClientOptions options) {
     99AddstarClientOptions args_loadICRF_client (int argc, char **argv, AddstarClientOptions options) {
    106100 
    107101  int N;
     
    175169  }
    176170
    177   /* other addstar options which cannot be used in loadstarpar */
     171  /* other addstar options which cannot be used in loadICRF */
    178172  options.photcode = 0;
    179173  options.timeref = 0;
     
    193187
    194188  if (argc != 1) {
    195     fprintf (stderr, "USAGE: loadstarpar_client -cpt (file) -input (file)\n");
     189    fprintf (stderr, "USAGE: loadICRF_client -cpt (file) -input (file)\n");
    196190    exit (2);
    197191  }
     
    201195static void help () {
    202196
    203   fprintf (stderr, "USAGE: loadstarpar [options] (file) [..more files]\n");
    204   fprintf (stderr, "  add data from stellar parameter file to DVO\n\n");
     197  fprintf (stderr, "USAGE: loadICRF [options] (file) [..more files]\n");
     198  fprintf (stderr, "  add data from ICRF list to DVO\n\n");
    205199
    206200  fprintf (stderr, "  optional flags:\n");
    207   fprintf (stderr, "  -only-match                 : only add measurements to existing objects\n");
    208201  fprintf (stderr, "  -replace                    : replace time/photcode measurements (no duplication)\n");
    209202  fprintf (stderr, "  -v                          : verbose mode\n");
     
    215208static void help_client () {
    216209
    217   fprintf (stderr, "USAGE: loadstarpar_client -D CATDIR catdir -hostID ID -hostdir (dir) -cpt (filename) -input (input) [options]\n");
     210  fprintf (stderr, "USAGE: loadICRF_client -D CATDIR catdir -hostID ID -hostdir (dir) -cpt (filename) -input (input) [options]\n");
    218211  fprintf (stderr, "  add data from stellar parameter file to DVO\n\n");
    219212
    220213  fprintf (stderr, "  optional flags:\n");
    221   fprintf (stderr, "  -only-match                 : only add measurements to existing objects\n");
    222214  fprintf (stderr, "  -replace                    : replace time/photcode measurements (no duplication)\n");
    223215  fprintf (stderr, "  -v                          : verbose mode\n");
  • branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadICRF.c

    r37567 r37570  
    11# include "addstar.h"
    2 # include "loadstarpar.h"
     2# include "loadICRF.h"
    33
    4 /* This is the DVO program to upload Greg Green's stellar parametersq into a DVO database.
    5    It is modeled on the loadwise program and is expected to be run only rarely (once?).
    6    The stellar parameter data are delivered as *.fits files.  It does not allow a subset
    7    of the sky to be uploaded; entire stellar parameter files are loaded if supplied on the
    8    command line.
     4/* This is the DVO program to upload ICRF QSO data (eg, from Leonid Petrov) into a DVO
     5   database.  It is modeled on the loadstarpar program and is expected to be run only
     6   rarely (once?).  The ICRF QSO parameter data are delivered as text file.  It does not
     7   allow a subset of the sky to be uploaded; entire QSO parameter files are loaded if
     8   supplied on the command line.
    99
    10    USAGE: loadstarpar -D CATDIR (catdir) (file.fits) [...more files]
     10   USAGE: loadICRF -D CATDIR (catdir) (file.fits) [...more files]
    1111*/
    1212
     
    1616  AddstarClientOptions options;
    1717
    18   // need to construct these options with args_loadstarpar...
    1918  options = ConfigInit (&argc, argv);
    20   options = args_loadstarpar (argc, argv, options);
     19  options = args_loadICRF (argc, argv, options); // XXX fix args after rest is done
    2120
    2221  // load the full sky description table (dvodb must exist)
     
    4746  SkyList *skylist = SkyListByPatch (sky, -1, &UserPatch);
    4847
     48  // argv[i] are a list of input tables; load one at a time
    4949  for (i = 1; i < argc; i++) {
    5050    fprintf (stderr, "loading %s\n", argv[i]);
    51     loadstarpar_table (skylist, hosts, argv[i], &options);
     51    loadICRF_table (skylist, hosts, argv[i], &options);
    5252  }
    5353  exit (0);
  • branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadICRF_catalog.c

    r37567 r37570  
    11# include "addstar.h"
    2 # include "loadstarpar.h"
     2# include "loadICRF.h"
    33
    4 int loadstarpar_catalog (StarPar_Stars *stars, int Nstars, SkyRegion *region, char *filename, AddstarClientOptions *options) {
     4int loadICRF_catalog (ICRF_Stars *stars, int Nstars, SkyRegion *region, char *filename, AddstarClientOptions *options) {
    55
    66  Catalog catalog;
     
    1010  catalog.catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
    1111  catalog.catmode   = dvo_catalog_catmode (CATMODE);      // set the default catmode from config data
    12   catalog.catflags = LOAD_AVES | LOAD_SECF | LOAD_STARPAR;
     12  catalog.catflags = LOAD_AVES | LOAD_SECF | LOAD_MEAS;
    1313  catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
    1414   
     
    1919  }
    2020
    21   find_matches_starpar (region, stars, Nstars, &catalog, options);
     21  find_matches_ICRF (region, stars, Nstars, &catalog, options);
    2222   
    2323  dvo_catalog_save (&catalog, VERBOSE);
  • branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadICRF_client.c

    r37567 r37570  
    11# include "addstar.h"
    2 # include "loadstarpar.h"
     2# include "loadICRF.h"
    33
    44int main (int argc, char **argv) {
     
    66  AddstarClientOptions options;
    77
    8   // need to construct these options with args_loadstarpar...
     8  // need to construct these options with args_loadICRF...
    99  options = ConfigInit (&argc, argv);
    10   options = args_loadstarpar_client (argc, argv, options);
     10  options = args_loadICRF_client (argc, argv, options);
    1111
    1212  // client is called with a pointer to the file to be loaded
     
    1818
    1919  int Nstars;
    20   StarPar_Stars *stars = loadstarpar_load_stars (INPUT, &Nstars);
     20  ICRF_Stars *stars = loadICRF_load_stars (INPUT, &Nstars);
    2121
    22   loadstarpar_catalog (stars, Nstars, skylist->regions[0], CPT_FILE, &options);
     22  loadICRF_catalog (stars, Nstars, skylist->regions[0], CPT_FILE, &options);
    2323
    2424  free (stars);
  • branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadICRF_io.c

    r37567 r37570  
    11# include "addstar.h"
    2 # include "loadstarpar.h"
     2# include "loadICRF.h"
    33
    4 int loadstarpar_save_stars (char *filename, StarPar_Stars *stars, int Nstars) {
     4int loadICRF_save_stars (char *filename, ICRF_Stars *stars, int Nstars) {
    55
    66  Header header;
     
    2424  gfits_free_matrix (&matrix);
    2525
    26   gfits_create_table_header (&theader, "BINTABLE", "STARPAR");
     26  gfits_create_table_header (&theader, "BINTABLE", "ICRF");
    2727
    2828  gfits_define_bintable_column (&theader, "D", "RA",       "", "degree", 1.0, 0.0);
    2929  gfits_define_bintable_column (&theader, "D", "DEC",      "", "degree", 1.0, 0.0);
    30   gfits_define_bintable_column (&theader, "E", "GLON",     "", "degree", 1.0, 0.0);
    31   gfits_define_bintable_column (&theader, "D", "GLAT",     "", "degree", 1.0, 0.0);
    32   gfits_define_bintable_column (&theader, "E", "Ebv",      "", "", 1.0, 0.0);
    33   gfits_define_bintable_column (&theader, "E", "dEbv",     "", "", 1.0, 0.0);
    34   gfits_define_bintable_column (&theader, "E", "DistMag",  "", "", 1.0, 0.0);
    35   gfits_define_bintable_column (&theader, "E", "dDistMag", "", "", 1.0, 0.0);
    36   gfits_define_bintable_column (&theader, "E", "M_r",      "", "", 1.0, 0.0);
    37   gfits_define_bintable_column (&theader, "E", "dM_r",     "", "", 1.0, 0.0);
    38   gfits_define_bintable_column (&theader, "E", "FeH",      "", "", 1.0, 0.0);
    39   gfits_define_bintable_column (&theader, "E", "dFeH",     "", "", 1.0, 0.0);
    40   gfits_define_bintable_column (&theader, "J", "averef",   "", "", 1.0, FT_BZERO_INT32);
    41   gfits_define_bintable_column (&theader, "J", "objID",    "", "", 1.0, FT_BZERO_INT32);
    42   gfits_define_bintable_column (&theader, "J", "catID",    "", "", 1.0, FT_BZERO_INT32);
     30  gfits_define_bintable_column (&theader, "E", "RA_ERR",   "", "arcsec", 1.0, 0.0);
     31  gfits_define_bintable_column (&theader, "E", "DEC_ERR",  "", "arcsec", 1.0, 0.0);
     32  gfits_define_bintable_column (&theader, "E", "F_PSF",    "", "", 1.0, 0.0);
     33  gfits_define_bintable_column (&theader, "E", "dF_PSF",   "", "", 1.0, 0.0);
     34  gfits_define_bintable_column (&theader, "E", "F_AP",     "", "", 1.0, 0.0);
     35  gfits_define_bintable_column (&theader, "E", "dF_AP",    "", "", 1.0, 0.0);
     36  gfits_define_bintable_column (&theader, "E", "M_PSF",    "", "", 1.0, 0.0);
     37  gfits_define_bintable_column (&theader, "E", "dM_PSF",   "", "", 1.0, 0.0);
     38  gfits_define_bintable_column (&theader, "E", "M_AP",     "", "", 1.0, 0.0);
     39  gfits_define_bintable_column (&theader, "E", "dM_AP",    "", "", 1.0, 0.0);
     40  gfits_define_bintable_column (&theader, "J", "PHOTCODE", "", "", 1.0, FT_BZERO_INT32);
     41  gfits_define_bintable_column (&theader, "J", "FLAGS",    "", "", 1.0, FT_BZERO_INT32);
    4342
    4443  int i;
    45   double       *ra       = NULL; ALLOCATE (ra      , double      , Nstars); for (i = 0; i < Nstars; i++) ra      [i] = stars[i].starpar.R ;
    46   double       *dec      = NULL; ALLOCATE (dec     , double      , Nstars); for (i = 0; i < Nstars; i++) dec     [i] = stars[i].starpar.D ;
    47   float        *glon     = NULL; ALLOCATE (glon    , float       , Nstars); for (i = 0; i < Nstars; i++) glon    [i] = stars[i].starpar.galLon  ;
    48   float        *glat     = NULL; ALLOCATE (glat    , float       , Nstars); for (i = 0; i < Nstars; i++) glat    [i] = stars[i].starpar.galLat  ;
    49   float        *Ebv      = NULL; ALLOCATE (Ebv     , float       , Nstars); for (i = 0; i < Nstars; i++) Ebv     [i] = stars[i].starpar.Ebv     ;
    50   float        *dEbv     = NULL; ALLOCATE (dEbv    , float       , Nstars); for (i = 0; i < Nstars; i++) dEbv    [i] = stars[i].starpar.dEbv    ;
    51   float        *DistMag  = NULL; ALLOCATE (DistMag , float       , Nstars); for (i = 0; i < Nstars; i++) DistMag [i] = stars[i].starpar.DistMag ;
    52   float        *dDistMag = NULL; ALLOCATE (dDistMag, float       , Nstars); for (i = 0; i < Nstars; i++) dDistMag[i] = stars[i].starpar.dDistMag;
    53   float        *M_r      = NULL; ALLOCATE (M_r     , float       , Nstars); for (i = 0; i < Nstars; i++) M_r     [i] = stars[i].starpar.M_r     ;
    54   float        *dM_r     = NULL; ALLOCATE (dM_r    , float       , Nstars); for (i = 0; i < Nstars; i++) dM_r    [i] = stars[i].starpar.dM_r    ;
    55   float        *FeH      = NULL; ALLOCATE (FeH     , float       , Nstars); for (i = 0; i < Nstars; i++) FeH     [i] = stars[i].starpar.FeH     ;
    56   float        *dFeH     = NULL; ALLOCATE (dFeH    , float       , Nstars); for (i = 0; i < Nstars; i++) dFeH    [i] = stars[i].starpar.dFeH    ;
    57   unsigned int *averef   = NULL; ALLOCATE (averef  , unsigned int, Nstars); for (i = 0; i < Nstars; i++) averef  [i] = stars[i].starpar.averef  ;
    58   unsigned int *objID    = NULL; ALLOCATE (objID   , unsigned int, Nstars); for (i = 0; i < Nstars; i++) objID   [i] = stars[i].starpar.objID   ;
    59   unsigned int *catID    = NULL; ALLOCATE (catID   , unsigned int, Nstars); for (i = 0; i < Nstars; i++) catID   [i] = stars[i].starpar.catID   ;
     44  double       *ra       = NULL; ALLOCATE (ra      , double      , Nstars); for (i = 0; i < Nstars; i++) ra      [i] = stars[i].R ;
     45  double       *dec      = NULL; ALLOCATE (dec     , double      , Nstars); for (i = 0; i < Nstars; i++) dec     [i] = stars[i].D ;
     46  float        *dR       = NULL; ALLOCATE (dR      , float       , Nstars); for (i = 0; i < Nstars; i++) dR      [i] = stars[i].measure.dXccd   ;
     47  float        *dD       = NULL; ALLOCATE (dD      , float       , Nstars); for (i = 0; i < Nstars; i++) dD      [i] = stars[i].measure.dYccd   ;
     48  float        *Fpsf     = NULL; ALLOCATE (Fpsf    , float       , Nstars); for (i = 0; i < Nstars; i++) Fpsf    [i] = stars[i].measure.FluxPSF ;
     49  float        *dFpsf    = NULL; ALLOCATE (dFpsf   , float       , Nstars); for (i = 0; i < Nstars; i++) dFpsf   [i] = stars[i].measure.dFluxPSF;
     50  float        *Fap      = NULL; ALLOCATE (Fap     , float       , Nstars); for (i = 0; i < Nstars; i++) Fap     [i] = stars[i].measure.FluxAp  ;
     51  float        *dFap     = NULL; ALLOCATE (dFap    , float       , Nstars); for (i = 0; i < Nstars; i++) dFap    [i] = stars[i].measure.dFluxAp ;
     52  float        *Mpsf     = NULL; ALLOCATE (Mpsf    , float       , Nstars); for (i = 0; i < Nstars; i++) Mpsf    [i] = stars[i].measure.M       ;
     53  float        *dMpsf    = NULL; ALLOCATE (dMpsf   , float       , Nstars); for (i = 0; i < Nstars; i++) dMpsf   [i] = stars[i].measure.dM      ;
     54  float        *Map      = NULL; ALLOCATE (Map     , float       , Nstars); for (i = 0; i < Nstars; i++) Map     [i] = stars[i].measure.Map     ;
     55  float        *dMap     = NULL; ALLOCATE (dMap    , float       , Nstars); for (i = 0; i < Nstars; i++) dMap    [i] = stars[i].measure.dMap    ;
     56  unsigned int *photcode = NULL; ALLOCATE (photcode, unsigned int, Nstars); for (i = 0; i < Nstars; i++) photcode[i] = stars[i].measure.photcode;
     57  unsigned int *flags    = NULL; ALLOCATE (flags   , unsigned int, Nstars); for (i = 0; i < Nstars; i++) flags   [i] = stars[i].measure.dbFlags ;
    6058
    6159  // generate the output array that carries the data
     
    6563  gfits_set_bintable_column (&theader, &ftable, "RA",       ra      , Nstars);
    6664  gfits_set_bintable_column (&theader, &ftable, "DEC",      dec     , Nstars);
    67   gfits_set_bintable_column (&theader, &ftable, "GLON",     glon    , Nstars);
    68   gfits_set_bintable_column (&theader, &ftable, "GLAT",     glat    , Nstars);
    69   gfits_set_bintable_column (&theader, &ftable, "Ebv",      Ebv     , Nstars);
    70   gfits_set_bintable_column (&theader, &ftable, "dEbv",     dEbv    , Nstars);
    71   gfits_set_bintable_column (&theader, &ftable, "DistMag",  DistMag , Nstars);
    72   gfits_set_bintable_column (&theader, &ftable, "dDistMag", dDistMag, Nstars);
    73   gfits_set_bintable_column (&theader, &ftable, "M_r",      M_r     , Nstars);
    74   gfits_set_bintable_column (&theader, &ftable, "dM_r",     dM_r    , Nstars);
    75   gfits_set_bintable_column (&theader, &ftable, "FeH",      FeH     , Nstars);
    76   gfits_set_bintable_column (&theader, &ftable, "dFeH",     dFeH    , Nstars);
    77   gfits_set_bintable_column (&theader, &ftable, "averef",   averef  , Nstars);
    78   gfits_set_bintable_column (&theader, &ftable, "objID",    objID   , Nstars);
    79   gfits_set_bintable_column (&theader, &ftable, "catID",    catID   , Nstars);
     65  gfits_set_bintable_column (&theader, &ftable, "RA_ERR",   dR      , Nstars);
     66  gfits_set_bintable_column (&theader, &ftable, "DEC_ERR",  dD      , Nstars);
     67  gfits_set_bintable_column (&theader, &ftable, "F_PSF",    Fpsf    , Nstars);
     68  gfits_set_bintable_column (&theader, &ftable, "dF_PSF",   dFpsf   , Nstars);
     69  gfits_set_bintable_column (&theader, &ftable, "F_AP",     Fap     , Nstars);
     70  gfits_set_bintable_column (&theader, &ftable, "dF_AP",    dFap    , Nstars);
     71  gfits_set_bintable_column (&theader, &ftable, "M_PSF",    Mpsf    , Nstars);
     72  gfits_set_bintable_column (&theader, &ftable, "dM_PSF",   dMpsf   , Nstars);
     73  gfits_set_bintable_column (&theader, &ftable, "M_AP",     Map     , Nstars);
     74  gfits_set_bintable_column (&theader, &ftable, "dM_AP",    dMap    , Nstars);
     75  gfits_set_bintable_column (&theader, &ftable, "PHOTCODE", photcode, Nstars);
     76  gfits_set_bintable_column (&theader, &ftable, "FLAGS",    flags   , Nstars);
    8077   
    8178  gfits_fwrite_Theader (f, &theader);
     
    9289  myAssert (!strcmp(type, #TYPE), "wrong column type");
    9390
    94 StarPar_Stars *loadstarpar_load_stars (char *filename, int *nstars) {
     91ICRF_Stars *loadICRF_load_stars (char *filename, int *nstars) {
    9592
    9693  int i, Ncol;
     
    9895  char type[16];
    9996
    100   StarPar_Stars *stars = NULL;
     97  ICRF_Stars *stars = NULL;
    10198
    10299  Header header;
     
    134131  if (!gfits_fread_ftable_data (f, &ftable, FALSE)) goto escape;
    135132 
    136   GET_COLUMN(ra      , "RA"        ,   double);
    137   GET_COLUMN(dec     , "DEC"       ,   double);
    138   GET_COLUMN(glon    , "GLON"      ,   float);
    139   GET_COLUMN(glat    , "GLAT"      ,   float);
    140   GET_COLUMN(Ebv     , "Ebv"       ,   float);
    141   GET_COLUMN(dEbv    , "dEbv"      ,   float);
    142   GET_COLUMN(DistMag , "DistMag"   ,   float);
    143   GET_COLUMN(dDistMag, "dDistMag"  ,   float);
    144   GET_COLUMN(M_r     , "M_r"       ,   float);
    145   GET_COLUMN(dM_r    , "dM_r"      ,   float);
    146   GET_COLUMN(FeH     , "FeH"       ,   float);
    147   GET_COLUMN(dFeH    , "dFeH"      ,   float);
    148   GET_COLUMN(averef  , "averef"    ,   unsigned int);
    149   GET_COLUMN(objID   , "objID"     ,   unsigned int);
    150   GET_COLUMN(catID   , "catID"     ,   unsigned int);
     133  GET_COLUMN(ra      , "RA",          double);
     134  GET_COLUMN(dec     , "DEC",         double);
     135  GET_COLUMN(dR      , "RA_ERR",      float);
     136  GET_COLUMN(dD      , "DEC_ERR",     float);
     137  GET_COLUMN(Fpsf    , "F_PSF",       float);
     138  GET_COLUMN(dFpsf   , "dF_PSF",      float);
     139  GET_COLUMN(Fap     , "F_AP",        float);
     140  GET_COLUMN(dFap    , "dF_AP",       float);
     141  GET_COLUMN(Mpsf    , "M_PSF",       float);
     142  GET_COLUMN(dMpsf   , "dM_PSF",      float);
     143  GET_COLUMN(Map     , "M_AP",        float);
     144  GET_COLUMN(dMap    , "dM_AP",       float);
     145  GET_COLUMN(photcode, "PHOTCODE",    unsigned int);
     146  GET_COLUMN(flags   , "FLAGS",       unsigned int);
    151147
    152148  gfits_free_header (&theader);
     
    155151  gfits_free_matrix (&matrix);
    156152
    157   ALLOCATE (stars, StarPar_Stars, Nrow);
     153  ALLOCATE (stars, ICRF_Stars, Nrow);
    158154
    159155  for (i = 0; i < Nrow; i++) {
    160     stars[i].R                = ra      [i];
    161     stars[i].D                = dec     [i];
    162     stars[i].starpar.R        = ra      [i];
    163     stars[i].starpar.D        = dec     [i];
    164     stars[i].starpar.galLon   = glon    [i];
    165     stars[i].starpar.galLat   = glat    [i];
    166     stars[i].starpar.Ebv      = Ebv     [i];
    167     stars[i].starpar.dEbv     = dEbv    [i];
    168     stars[i].starpar.DistMag  = DistMag [i];
    169     stars[i].starpar.dDistMag = dDistMag[i];
    170     stars[i].starpar.M_r      = M_r     [i];
    171     stars[i].starpar.dM_r     = dM_r    [i];
    172     stars[i].starpar.FeH      = FeH     [i];
    173     stars[i].starpar.dFeH     = dFeH    [i];
    174     stars[i].starpar.averef   = averef  [i];
    175     stars[i].starpar.objID    = objID   [i];
    176     stars[i].starpar.catID    = catID   [i];
     156    InitICRF_Star (&stars[i]);
     157    stars[i].R               = ra      [i];
     158    stars[i].D               = dec     [i];
     159    stars[i].measure.R       = ra      [i];
     160    stars[i].measure.D       = dec     [i];
     161    stars[i].measure.dXccd   = dR      [i];
     162    stars[i].measure.dYccd   = dD      [i];
     163    stars[i].measure.FluxPSF = Fpsf    [i];
     164    stars[i].measure.dFluxPSF= dFpsf  [i];
     165    stars[i].measure.FluxAp  = Fap     [i];
     166    stars[i].measure.dFluxAp = dFap    [i];
     167    stars[i].measure.M       = Mpsf    [i];
     168    stars[i].measure.dM      = dMpsf   [i];
     169    stars[i].measure.Map     = Map     [i];
     170    stars[i].measure.dMap    = dMap    [i];
     171    stars[i].measure.photcode= photcode[i];
     172    stars[i].measure.dbFlags = flags   [i];
    177173  }
    178174
  • branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadICRF_make_subset.c

    r37567 r37570  
    11# include "addstar.h"
    2 # include "loadstarpar.h"
     2# include "loadICRF.h"
    33
    44// assign stars in the given region to the subset (NOTE: stars are sorted by RA, start is
    55// first entry in stars array in this region)
    66
    7 StarPar_Stars *loadstarpar_make_subset (StarPar_Stars *stars, int Nstars, int start, SkyRegion *region, int *nsubset) {
     7ICRF_Stars *loadICRF_make_subset (ICRF_Stars *stars, int Nstars, int start, SkyRegion *region, int *nsubset) {
    88
    99  int i;
    1010
    11   StarPar_Stars *subset = NULL;
     11  ICRF_Stars *subset = NULL;
    1212
    1313  // collect array of (Stars *) stars in a new output catalog
    1414  int Nsubset = 0;
    1515  int NSUBSET = 3000;
    16   ALLOCATE (subset, StarPar_Stars, NSUBSET);
     16  ALLOCATE (subset, ICRF_Stars, NSUBSET);
    1717
    1818  // find the rest of the stars in this output region
     
    3535    Nsubset ++;
    3636
    37     stars[i].flag = TRUE;
     37    stars[i].flag = TRUE;  // set flag for stars we have already assigned to a subset
    3838
    39     CHECK_REALLOCATE (subset, StarPar_Stars, NSUBSET, Nsubset, 10000);
     39    CHECK_REALLOCATE (subset, ICRF_Stars, NSUBSET, Nsubset, 10000);
    4040  }
    4141
  • branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadICRF_readstars.c

    r37567 r37570  
    11# include "addstar.h"
    2 # include "loadstarpar.h"
     2# include "loadICRF.h"
    33
    4 # define GET_COLUMN(OUT,NAME,TYPE) \
    5   TYPE *OUT = gfits_get_bintable_column_data (&theader, &ftable, NAME, type, &Nrow, &Ncol); \
    6   myAssert (!strcmp(type, #TYPE), "wrong column type");
     4// ICRF table is ASCII text, with the following interesting columns (fixed bytes)
     5//   0       : type (C - calibrator, N - non-calibrator, U - unreliable)
     6//   3 -  21 : names (make into an extID?)
     7//  24 -  39 : RA (ICRF)
     8//  40 -  55 : DEC (ICRF)
     9//  57 -  62 : dR (mas) [use dX,dY in milliarcsec 'pixels']
     10//  64 -  69 : dD (mas)
     11//  79 -  84 : Number of observations used (put in dt?)
     12//  87 -  92 : S-band total flux density integrated over entire map,  Jy  (note 87 may be <) :
     13//  94 -  99 : S-band unresolved flux density at long VLBA baselines, Jy
     14// 102 - 107 : C-band total flux density integrated over entire map,  Jy
     15// 109 - 114 : C-band unresolved flux density at long VLBA baselines, Jy
     16// 117 - 122 : X-band total flux density integrated over entire map,  Jy
     17// 124 - 129 : X-band unresolved flux density at long VLBA baselines, Jy
     18// 132 - 137 : U-band total flux density integrated over entire map,  Jy
     19// 139 - 144 : U-band unresolved flux density at long VLBA baselines, Jy
     20// 147 - 152 : K-band total flux density integrated over entire map,  Jy
     21// 154 - 159 : K-band unresolved flux density at long VLBA baselines, Jy
    722
    8 StarPar_Stars *loadstarpar_readstars (char *filename, int *nstars) {
     23// I'm going to save these are FluxPSF (total), FluxAp (unresolved), and mags for
     24// the signficant ones (AB_m from Jy).  Use new photcodes to represent C,X,U,K
     25
     26/*
     27#  IVS name J2000 name  Right ascension Declination        D_alp  D_Del   Corr    #Obs  S-band flux    C-band Flux    X-band Flux   U-band flux    K-band Flux    Type Cat
     28#                                                                                       Total  Unres   Total  Unres   Total  Unres  Total  Unres   Total  Unres
     29#                       hr mn seconds   deg mn seconds      mas    mas                   Jy     Jy      Jy     Jy      Jy     Jy     Jy     Jy      Jy     Jy
     30C  2357+080 J0000+0816  00 00 07.031141 +08 16 45.05175    0.46   0.85   0.758     41  -1.00  -1.00   -1.00  -1.00    0.020 <0.014  -1.00  -1.00   -1.00  -1.00   X    rfc_2014c
     3101234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
     320         1         2         3         4         5         6         7         8         9         0         1         2         3         4         5         6         
     33*/
     34
     35
     36int loadICRF_addstar(ICRF_Stars *star, float fluxPSF, float fluxAp, double R, double D, float dX, float dY, int photcode);
     37
     38ICRF_Stars *loadICRF_readstars (char *filename, int *nstars) {
    939
    1040  // read in the full FITS files ('cause I don't have a partial read option)
     
    1242  if (f == NULL) Shutdown ("can't read stellar parameter file: %s", filename);
    1343
    14   int i, Ncol;
    15   off_t Nrow;
     44  int Nstars = 0;
     45  int NSTARS = 1000;
     46  ICRF_Stars *stars = NULL;
     47  ALLOCATE (stars, ICRF_Stars, NSTARS);
    1648
    17   Header header;
    18   Matrix matrix;
    19   Header theader;
    20   FTable ftable;
    21  
    22   // load in PHU segment (ignore)
    23   if (!gfits_fread_header (f, &header)) {
    24     if (VERBOSE) fprintf (stderr, "can't read image subset header\n");
    25     fclose (f);
    26     return NULL;
     49  double R, D;
     50
     51  // ICRF QSO photcodes (we store flux in Jy and AB mags)
     52  PhotCode *codeS = GetPhotcodebyName ("ICRF_S");
     53  PhotCode *codeC = GetPhotcodebyName ("ICRF_C");
     54  PhotCode *codeX = GetPhotcodebyName ("ICRF_X");
     55  PhotCode *codeU = GetPhotcodebyName ("ICRF_U");
     56  PhotCode *codeK = GetPhotcodebyName ("ICRF_K");
     57
     58  /* read in stars line-by-line */
     59  char line[1024];
     60  while (scan_line (f, line) != EOF) {
     61    stripwhite (line);
     62    if (line[0] == 0) continue;
     63    if (line[0] == '#') continue;
     64
     65    // objects with values other than "C" in the first column are not good for
     66    // calibration, so just skip.
     67    if (line[0] != 'C') continue;
     68
     69    // terminate the partial strings containing RA and DEC:
     70    char cr = line[39]; line[39] = 0;
     71    char cd = line[55]; line[55] = 0;
     72
     73    if (!ohana_str_to_radec (&R, &D, &line[24], &line[40])) {
     74      line[39] = cr;
     75      line[55] = cd;
     76      fprintf (stderr, "problem with coords: %s\n", line);
     77      exit (1);
     78    }
     79    R = ohana_normalize_angle (R);
     80   
     81    line[63] = 0;
     82    float dR = atof(&line[57]);
     83    line[70] = 0;
     84    float dD = atof(&line[64]);
     85
     86    int dX = 1000.0*100*dR;
     87    int dY = 1000.0*100*dD;
     88
     89    // XXX set this somewhere?
     90    // line[85] = 0;
     91    // int Nmeas = atoi(&line[79]);
     92
     93    line[ 93] = 0; float fluxSt = (line[ 87] == '<') ? NAN : atof(&line[ 87]); if (fluxSt == -1.0) fluxSt = NAN;
     94    line[100] = 0; float fluxSu = (line[ 94] == '<') ? NAN : atof(&line[ 94]); if (fluxSu == -1.0) fluxSu = NAN;
     95    line[108] = 0; float fluxCt = (line[102] == '<') ? NAN : atof(&line[102]); if (fluxCt == -1.0) fluxCt = NAN;
     96    line[115] = 0; float fluxCu = (line[109] == '<') ? NAN : atof(&line[109]); if (fluxCu == -1.0) fluxCu = NAN;
     97    line[123] = 0; float fluxXt = (line[117] == '<') ? NAN : atof(&line[117]); if (fluxXt == -1.0) fluxXt = NAN;
     98    line[130] = 0; float fluxXu = (line[124] == '<') ? NAN : atof(&line[124]); if (fluxXu == -1.0) fluxXu = NAN;
     99    line[138] = 0; float fluxUt = (line[132] == '<') ? NAN : atof(&line[132]); if (fluxUt == -1.0) fluxUt = NAN;
     100    line[145] = 0; float fluxUu = (line[139] == '<') ? NAN : atof(&line[139]); if (fluxUu == -1.0) fluxUu = NAN;
     101    line[153] = 0; float fluxKt = (line[147] == '<') ? NAN : atof(&line[147]); if (fluxKt == -1.0) fluxKt = NAN;
     102    line[160] = 0; float fluxKu = (line[154] == '<') ? NAN : atof(&line[154]); if (fluxKu == -1.0) fluxKu = NAN;
     103
     104    // we treat each valid flux as a new star
     105    if (isfinite(fluxSt)) {
     106      loadICRF_addstar (&stars[Nstars], fluxSt, fluxSu, R, D, dX, dY, codeS->code);
     107      Nstars++;
     108      CHECK_REALLOCATE (stars, ICRF_Stars, NSTARS, Nstars, 1000);
     109    }
     110    if (isfinite(fluxCt)) {
     111      loadICRF_addstar (&stars[Nstars], fluxCt, fluxCu, R, D, dX, dY, codeC->code);
     112      Nstars++;
     113      CHECK_REALLOCATE (stars, ICRF_Stars, NSTARS, Nstars, 1000);
     114    }
     115    if (isfinite(fluxXt)) {
     116      loadICRF_addstar (&stars[Nstars], fluxXt, fluxXu, R, D, dX, dY, codeX->code);
     117      Nstars++;
     118      CHECK_REALLOCATE (stars, ICRF_Stars, NSTARS, Nstars, 1000);
     119    }
     120    if (isfinite(fluxUt)) {
     121      loadICRF_addstar (&stars[Nstars], fluxUt, fluxUu, R, D, dX, dY, codeU->code);
     122      Nstars++;
     123      CHECK_REALLOCATE (stars, ICRF_Stars, NSTARS, Nstars, 1000);
     124    }
     125    if (isfinite(fluxKt)) {
     126      loadICRF_addstar (&stars[Nstars], fluxKt, fluxKu, R, D, dX, dY, codeK->code);
     127      Nstars++;
     128      CHECK_REALLOCATE (stars, ICRF_Stars, NSTARS, Nstars, 1000);
     129    }
     130
    27131  }
    28   if (!gfits_fread_matrix (f, &matrix, &header)) {
    29     if (VERBOSE) fprintf (stderr, "can't read image subset matrix\n");
    30     gfits_free_header (&header);
    31     fclose (f);
    32     return NULL;
    33   }
    34 
    35   ftable.header = &theader;
    36 
    37   // load data for this header
    38   if (!gfits_load_header (f, &theader)) {
    39     fclose (f);
    40     return NULL;
    41   }
    42   if (!gfits_fread_ftable_data (f, &ftable, FALSE)) {
    43     fclose (f);
    44     return (NULL);
    45   }
    46 
    47   char type[16];
    48 
    49   GET_COLUMN (glat,    "l",    float);
    50   GET_COLUMN (glon,    "b",    float);
    51   GET_COLUMN (conv,    "conv", byte);
    52   GET_COLUMN (lnZ,     "lnZ",  float);
    53   GET_COLUMN (DistMag, "DM",   float);
    54   GET_COLUMN (Ebv,     "EBV",  float);
    55   GET_COLUMN (M_r,     "Mr",   float);
    56   GET_COLUMN (FeH,     "FeH",  float);
    57 
    58   // free the memory associated with the FITS files
    59   gfits_free_header (&header);
    60   gfits_free_matrix (&matrix);
    61   gfits_free_header (&theader);
    62   gfits_free_table (&ftable);
    63 
    64   // the next FITS extension contains the error information
    65   if (!gfits_fread_header (f, &header)) {
    66     if (VERBOSE) fprintf (stderr, "can't read image subset header\n");
    67     fclose (f);
    68     return NULL;
    69   }
    70   if (!gfits_fread_matrix (f, &matrix, &header)) {
    71     if (VERBOSE) fprintf (stderr, "can't read image subset matrix\n");
    72     gfits_free_header (&header);
    73     fclose (f);
    74     return NULL;
    75   }
    76   fclose (f);
    77 
    78   double *errImage = (double *) matrix.buffer;
    79 
    80   myAssert (Nrow == matrix.Naxis[2], "size mismatch?");
    81 
    82   int NstarsIn = matrix.Naxis[2];
    83 
    84   double Rmin = +360.0;
    85   double Rmax = -360.0;
    86   double Dmin = +360.0;
    87   double Dmax = -360.0;
    88 
    89   int Nstars = 0;
    90   int NSTARS = 0.1*NstarsIn;
    91 
    92   StarPar_Stars *stars = NULL;
    93   ALLOCATE (stars, StarPar_Stars, NSTARS);
    94 
    95   // libdvo uses Liu et al 2011 (A&A 526, A16) for default galactic coords,
    96   // but Greg Green / LSD use the older Reid et al 2004 (ApJ 616, 872) definition
    97   CoordTransform *transform = InitTransform (COORD_GALACTIC_REID_2004, COORD_CELESTIAL);
    98 
    99   for (i = 0; i < NstarsIn; i++) {
    100 
    101     // skip stars based on conv and lnZ
    102     if (!conv[i]) continue;
    103     if (lnZ[i] < -15.0) continue;
    104 
    105     double R, D;
    106     ApplyTransform (&R, &D, glon[i], glat[i], transform);
    107 
    108     Rmin = MIN (Rmin, R);
    109     Rmax = MAX (Rmax, R);
    110     Dmin = MIN (Dmin, D);
    111     Dmax = MAX (Dmax, D);
    112 
    113     float dEbv     = 0.5*(errImage[i*20 + 5*0 + 3] - errImage[i*20 + 5*0 + 1]);
    114     float dDistMag = 0.5*(errImage[i*20 + 5*1 + 3] - errImage[i*20 + 5*1 + 1]);
    115     float dM_r     = 0.5*(errImage[i*20 + 5*2 + 3] - errImage[i*20 + 5*2 + 1]);
    116     float dFeH     = 0.5*(errImage[i*20 + 5*3 + 3] - errImage[i*20 + 5*3 + 1]);
    117 
    118     stars[Nstars].R = R;
    119     stars[Nstars].D = D;
    120     stars[Nstars].flag  = FALSE;
    121     stars[Nstars].found = FALSE;
    122 
    123     // NOTE that we have both stars.R,D and stars.starpar.R,D.  stars.R,D are used
    124     // here (in parallel with addstar) to locate the objects.  BUT, in the database,
    125     // starpar.R,D is the authoratative position for the object (either that coming
    126     // from Greg / Eddie's table or that coming from the simulation)
    127     stars[Nstars].starpar.R      = R;
    128     stars[Nstars].starpar.D      = D;
    129     stars[Nstars].starpar.galLon = glon[i];
    130     stars[Nstars].starpar.galLat = glat[i];
    131 
    132     stars[Nstars].starpar.Ebv      = Ebv[i]    ;
    133     stars[Nstars].starpar.dEbv     = dEbv      ;
    134     stars[Nstars].starpar.DistMag  = DistMag[i];
    135     stars[Nstars].starpar.dDistMag = dDistMag  ;
    136     stars[Nstars].starpar.M_r      = M_r[i]    ;
    137     stars[Nstars].starpar.dM_r     = dM_r      ;
    138     stars[Nstars].starpar.FeH      = FeH[i]    ;
    139     stars[Nstars].starpar.dFeH     = dFeH      ;
    140 
    141     Nstars ++;
    142 
    143     CHECK_REALLOCATE (stars, StarPar_Stars, NSTARS, Nstars, 10000);
    144   }
    145   gfits_free_header (&header);
    146   gfits_free_matrix (&matrix);
    147 
    148132  *nstars = Nstars;
    149133  return (stars);
    150134}
    151135
    152 int loadstarpar_sortStars (StarPar_Stars *stars, int Nstars) {
     136int loadICRF_addstar(ICRF_Stars *star, float fluxPSF, float fluxAp, double R, double D, float dX, float dY, int photcode) {
    153137
    154 # define SWAPFUNC(A,B){ StarPar_Stars temp = stars[A]; stars[A] = stars[B]; stars[B] = temp; }
     138  InitICRF_Star (star);
     139
     140  star->R = R;
     141  star->D = D;
     142  star->measure.R = R;
     143  star->measure.D = D;
     144  star->measure.dXccd = dX;   // in centi-pixels, where 1 pixel = 1 mas
     145  star->measure.dYccd = dY;   // in centi-pixels, where 1 pixel = 1 mas
     146
     147  star->measure.FluxPSF = fluxPSF; // flux in Jy
     148  star->measure.dFluxPSF = 0.01;  // this is just a guess
     149  star->measure.FluxAp = fluxAp;  // flux in Jy
     150  star->measure.dFluxAp = 0.01;   // this is just a guess
     151
     152  star->measure.M = (fluxPSF > 0.0) ? 8.9 - 2.5*log10(fluxPSF) : NAN;
     153  star->measure.dM = (fluxPSF > 0.0) ? 0.01 / fluxPSF : NAN;
     154  star->measure.Map = (fluxAp > 0.0) ? 8.9 - 2.5*log10(fluxAp) : NAN;
     155  star->measure.dMap = (fluxAp > 0.0) ? 0.01 / fluxAp: NAN;
     156  star->measure.photcode = photcode;
     157  star->measure.dbFlags |= ID_MEAS_ICRF_QSO;
     158  return TRUE;
     159}
     160
     161int loadICRF_sortStars (ICRF_Stars *stars, int Nstars) {
     162
     163# define SWAPFUNC(A,B){ ICRF_Stars temp = stars[A]; stars[A] = stars[B]; stars[B] = temp; }
    155164# define COMPARE(A,B)(stars[A].R < stars[B].R)
    156165
     
    163172}
    164173
     174int InitICRF_Star (ICRF_Stars *star) {
     175
     176    dvo_measure_init (&star[0].measure);
     177    star[0].found = FALSE; // FALSE = not yet assigned to an object
     178    star[0].flag = FALSE; // FALSE = not yet assigned to a subset
     179    return TRUE;
     180}
  • branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadICRF_remote_hosts.c

    r37567 r37570  
    11# include "addstar.h"
    2 # include "loadstarpar.h"
     2# include "loadICRF.h"
    33# include <sys/types.h>
    44# include <sys/wait.h>
  • branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadICRF_save_remote.c

    r37567 r37570  
    11# include "addstar.h"
    2 # include "loadstarpar.h"
     2# include "loadICRF.h"
    33# define DEBUG 1
    44
     
    1616}
    1717
    18 int loadstarpar_save_remote (StarPar_Stars *stars, int Nstars, HostTable *hosts, SkyRegion *region, char *fullname, AddstarClientOptions *options) {
     18int loadICRF_save_remote (ICRF_Stars *stars, int Nstars, HostTable *hosts, SkyRegion *region, char *fullname, AddstarClientOptions *options) {
    1919
    2020  char uniquer[12];
     
    2525  // if this region is a parallel thing, save and launch remote
    2626  if (!PARALLEL) {
    27     loadstarpar_catalog (stars, Nstars, region, fullname, options);
     27    loadICRF_catalog (stars, Nstars, region, fullname, options);
    2828  } else {
    2929    int N = hosts->index[region->hostID];
     
    3131
    3232    // save to a unique filename
    33     char filename[1024]; // CATDIR/tmpdir/starpar.PID.index.fits
    34     snprintf (filename, 1024, "%s/tmpdir/starpar.%s.%05d.fits", CATDIR, uniquer, region->index);
     33    char filename[1024]; // CATDIR/tmpdir/ICRF.PID.index.fits
     34    snprintf (filename, 1024, "%s/tmpdir/ICRF.%s.%05d.fits", CATDIR, uniquer, region->index);
    3535
    3636    // write the data to the given FITS file
    37     loadstarpar_save_stars (filename, stars, Nstars);
     37    loadICRF_save_stars (filename, stars, Nstars);
    3838
    3939    int slot = -1;
     
    6363    // need to generate the remote command
    6464    char command[1024];
    65     snprintf (command, 1024, "loadstarpar_client");
     65    snprintf (command, 1024, "loadICRF_client");
    6666    strextend (command, "-hostID %d", host->hostID);
    6767    strextend (command, "-D CATDIR %s", CATDIR);
  • branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadICRF_table.c

    r37567 r37570  
    11# include "addstar.h"
    2 # include "loadstarpar.h"
     2# include "loadICRF.h"
    33
    44# define GET_COLUMN(OUT,NAME,TYPE) \
     
    66  myAssert (!strcmp(type, #TYPE), "wrong column type");
    77
    8 int loadstarpar_table (SkyList *skylistInput, HostTable *hosts, char *filename, AddstarClientOptions *options) {
     8int loadICRF_table (SkyList *skylistInput, HostTable *hosts, char *filename, AddstarClientOptions *options) {
    99 
    1010  int i, Nstars;
    1111
    12   StarPar_Stars *stars = loadstarpar_readstars (filename, &Nstars);
     12  ICRF_Stars *stars = loadICRF_readstars (filename, &Nstars);
    1313
    1414  // sort the stars by RA
    15   loadstarpar_sortStars (stars, Nstars);
     15  loadICRF_sortStars (stars, Nstars);
    1616
    1717  // scan through the stars, loading the containing catalogs
     
    3636    // select stars matching this region
    3737    int Nsubset;
    38     StarPar_Stars *subset = loadstarpar_make_subset (stars, Nstars, i, region, &Nsubset);
     38    ICRF_Stars *subset = loadICRF_make_subset (stars, Nstars, i, region, &Nsubset);
    3939
    4040    // In parallel mode, write out the subset to a disk file.  Block until a remote host
    4141    // is available.  In serial mode, just match against the appropriate region and save
    42     loadstarpar_save_remote (subset, Nsubset, hosts, region, skylist[0].filename[0], options);
     42    loadICRF_save_remote (subset, Nsubset, hosts, region, skylist[0].filename[0], options);
    4343  }
    4444
  • branches/eam_branches/ipp-20140904/Ohana/src/opihi/dvo/images.c

    r37378 r37570  
    132132  if ((image = LoadImagesDVO (&Nimage)) == NULL) return (TRUE);
    133133  BuildChipMatch (image, Nimage);
     134
     135  // XXX push this and BuildChipMatch into LoadImagesDVO?
     136  char mapfile[DVO_MAX_PATH];
     137  char *catdir = dvo_get_catdir ();
     138  snprintf (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", catdir);
     139  AstromOffsetTable *table = AstromOffsetMapLoad (mapfile, FALSE);
     140
     141  // assign images.coords.offsetMap -> table->map[i]
     142  if (table) {
     143    AstromOffsetTableMatchChips (image, Nimage, table);
     144  }
    134145
    135146  if (SOLO_MOSAIC && photcode) {
Note: See TracChangeset for help on using the changeset viewer.