IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 16, 2011, 11:18:00 AM (15 years ago)
Author:
bills
Message:

move the functions that implement the dvo "database lookups" (avextract, mextract, imextract) etc from opihi to libdvo so that they can be used in relastro -high-speed. Restructure relastro -high-speed to use configuration variables for the cuts on the two sets of photcodes. Default to ps1 versus 2mass as was previoulsy hard coded

Location:
trunk/Ohana/src/libdvo
Files:
5 added
2 edited
17 moved

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libdvo/Makefile

    r31496 r31635  
    3636$(DESTINC)/ps1_ref_defs.h
    3737
    38 INCS = $(DEFS) $(DESTINC)/dvo.h $(DESTINC)/autocode.h $(DESTINC)/dvo_util.h
     38INCS = $(DEFS) $(DESTINC)/dvo.h $(DESTINC)/autocode.h $(DESTINC)/dvo_util.h $(DESTINC)/dvodb.h $(DESTINC)/libdvo_astro.h $(DESTINC)/convert.h
    3939
    4040OBJS = \
     
    7373$(SRC)/skyregion_gsc.$(ARCH).o    \
    7474$(SRC)/skyregion_ops.$(ARCH).o \
     75$(SRC)/dvo_set_skyregion.$(ARCH).o \
     76$(SRC)/dvo_set_catdir.$(ARCH).o \
    7577$(SRC)/cmf-ps1-v1-alt.$(ARCH).o \
    7678$(SRC)/cmf-ps1-sv1-alt.$(ARCH).o \
    77 $(SRC)/dvo_util.$(ARCH).o
     79$(SRC)/dvo_util.$(ARCH).o \
     80$(SRC)/dbBooleanCond.$(ARCH).o          \
     81$(SRC)/dbCheckStack.$(ARCH).o           \
     82$(SRC)/dbCmdlineFields.$(ARCH).o        \
     83$(SRC)/dbExtractAverages.$(ARCH).o      \
     84$(SRC)/dbExtractMeasures.$(ARCH).o      \
     85$(SRC)/dbExtractImages.$(ARCH).o        \
     86$(SRC)/dbFields.$(ARCH).o       \
     87$(SRC)/dbRPN.$(ARCH).o                  \
     88$(SRC)/dbStackMath.$(ARCH).o            \
     89$(SRC)/dbStackOps.$(ARCH).o             \
     90$(SRC)/coord_systems.$(ARCH).o          \
     91$(SRC)/LoadImages.$(ARCH).o             \
     92$(SRC)/ImageSelection.$(ARCH).o         \
     93$(SRC)/ImageOps.$(ARCH).o               \
     94$(SRC)/match_image.$(ARCH).o            \
     95$(SRC)/db_utils.$(ARCH).o               \
     96$(SRC)/convert.$(ARCH).o
     97
    7898
    7999# $(SRC)/dvo_convert_panstarrs.$(ARCH).o
  • trunk/Ohana/src/libdvo/include/convert.h

    r31607 r31635  
    1 # include "external.h"
     1// # include "external.h"
     2
     3#include <ohana.h>
     4#include <dvo.h>
    25
    36# ifndef CONVERT_H
  • trunk/Ohana/src/libdvo/include/dvo.h

    r31450 r31635  
     1# ifndef DVO_H
     2# define DVO_H
     3
    14# include <ohana.h>
    25# include <gfitsio.h>
    36# include <autocode.h>
    47
    5 # ifndef DVO_H
    6 # define DVO_H
     8# include <libdvo_astro.h>
     9# include <dvodb.h>
    710
    811/* DVO table modes */
     
    501504SkyList   *SkyListChildrenByBounds_List PROTO((SkyList *table, int depth, double Rmin, double Rmax, double Dmin, double Dmax));
    502505
     506int set_skyregion(double Rs, double Re, double Ds, double De);
     507int get_skyregion (double *Rs, double *Re, double *Ds, double *De);
     508
     509void dvo_set_catdir(char *catdir);
     510char *dvo_get_catdir();
     511
    503512/* dvo-specific sorting functions */
    504513void sortave (Average *ave, off_t N);
     
    508517void sort_regions (SkyRegion *region, off_t N);
    509518
     519#ifdef MOVED_TO_LIBOHANA
     520int  print_error(void);
     521int  init_error(void);
     522int  push_error(char *);
     523#endif
     524
    510525# endif
  • trunk/Ohana/src/libdvo/src/ImageOps.c

    r31607 r31635  
    1 # include "dvoshell.h"
     1# include "dvo.h"
     2# include "dvodb.h"
    23
    34void image_subset (Image *image, off_t Nimage, off_t **Subset, off_t *Nsubset,
     
    1617
    1718  if (selection->useDisplay) {
    18     if (!GetGraphData (&graph, NULL, NULL)) {
     19    if (!GetGraphdata (&graph, NULL, NULL)) {
    1920      gprint (GP_ERR, "region display not available\n");
    2021      return;
  • trunk/Ohana/src/libdvo/src/ImageSelection.c

    r31607 r31635  
    1 # include "dvoshell.h"
     1# include "dvo.h"
    22
    33/* db image table */
     
    2929  }
    3030
    31   if ((image = LoadImages (&Nimage)) == NULL) return (FALSE);
     31  if ((image = LoadImagesDVO (&Nimage)) == NULL) return (FALSE);
    3232  BuildChipMatch (image, Nimage);
    3333  image_subset (image, Nimage, &subset, &Nsubset, selection, tzero, (double) tend - tzero, TimeSelect);
     
    3838/* free loaded images */
    3939void FreeImageSelection () {
    40   if (image != NULL) FreeImages(image);
     40  if (image != NULL) FreeImagesDVO(image);
    4141  if (subset != NULL) free (subset);
    4242  image = NULL;
     
    4545}
    4646
    47 Image *MatchImage (unsigned int time, short int source, unsigned int imageID) {
     47Image *MatchImageDVO (unsigned int time, short int source, unsigned int imageID) {
    4848
    4949  int m = -1;
  • trunk/Ohana/src/libdvo/src/LoadImages.c

    r31607 r31635  
    1 # include "dvoshell.h"
     1# include "dvo.h"
     2# include "dvodb.h"
    23
    34// XXX: Maybe make this a command line option
     
    1112static time_t getLastModified(char *filename);
    1213
    13 Image *LoadImages (off_t *Nimage) {
     14Image *LoadImagesDVO (off_t *Nimage) {
    1415
    1516  int status;
     
    2021  /* VarConfig ("IMAGE_CATALOG", "%s", filename); */
    2122
    22   catdir = GetCATDIR ();
     23  catdir = dvo_get_catdir ();
    2324  sprintf (filename, "%s/Images.dat", catdir);
    2425
     
    8889}
    8990
    90 void FreeImages(Image *images) {
     91void FreeImagesDVO(Image *images) {
    9192  if (!dvoUseImageCache && (images != NULL)) {
    9293    free(images);
  • trunk/Ohana/src/libdvo/src/coord_systems.c

    r31607 r31635  
    1 # include "astro.h"
     1# include "dvo.h"
     2# include "libdvo_astro.h"
    23   
    34CoordTransform *InitTransform (CoordTransformSystem input, CoordTransformSystem output) {
  • trunk/Ohana/src/libdvo/src/dbBooleanCond.c

    r31607 r31635  
    1 # include "dvoshell.h"
     1# include "dvo.h"
    22
    33// evaluate the expression in inStack as a boolean; necessary db field values are
  • trunk/Ohana/src/libdvo/src/dbCheckStack.c

    r31607 r31635  
    1 # include "dvoshell.h"
     1# include "dvo.h"
    22
    33// XXX we are using a fairly bogus set of char values to distinguish a few cases:
     
    66// 't', 'T' : value is a temp scalar (upper == float; lower == int)
    77// these would be better done using bit values to test for field? temp? float?
     8//
     9
     10#define OPIHI_INT 1
    811
    912int dbCheckStack (dbStack *stack, int Nstack, int table, dbField **inFields, int *inNfields) {
  • trunk/Ohana/src/libdvo/src/dbCmdlineFields.c

    r31607 r31635  
    1 # include "dvoshell.h"
     1# include "dvo.h"
    22
    33// check for 'where' or 'matched to'; return first field after the word, and the value
     
    128128
    129129    Graphdata graphsky;
    130     if (!GetGraphData (&graphsky, NULL, NULL)) {
     130    if (!GetGraphdata (&graphsky, NULL, NULL)) {
    131131      gprint (GP_ERR, "region display not available\n");
    132132      return (FALSE);
  • trunk/Ohana/src/libdvo/src/dbExtractAverages.c

    r31607 r31635  
    1 # include "dvoshell.h"
     1# include "dvo.h"
     2# include "libdvo_astro.h"
    23
    34/* time concepts */
  • trunk/Ohana/src/libdvo/src/dbExtractImages.c

    r31607 r31635  
    1 # include "dvoshell.h"
     1# include "dvo.h"
    22
    33/* time concepts */
  • trunk/Ohana/src/libdvo/src/dbExtractMeasures.c

    r31607 r31635  
    1 # include "dvoshell.h"
     1# include "dvo.h"
     2# include "dvodb.h"
    23
    34// to add a new field to the extractions:
     
    358359        ra  = average[0].R - measure[0].dR / 3600.0;
    359360        dec = average[0].D - measure[0].dD / 3600.0;
    360         image = MatchImage (measure[0].t, measure[0].photcode, measure[0].imageID);
     361        image = MatchImageDVO (measure[0].t, measure[0].photcode, measure[0].imageID);
    361362        if (image == NULL) break;
    362363        RD_to_XY (&x, &y, ra, dec, &image[0].coords);
     
    374375        ra  = average[0].R - measure[0].dR / 3600.0;
    375376        dec = average[0].D - measure[0].dD / 3600.0;
    376         image = MatchImage (measure[0].t, measure[0].photcode, measure[0].imageID);
     377        image = MatchImageDVO (measure[0].t, measure[0].photcode, measure[0].imageID);
    377378        if (image == NULL) break;
    378379        RD_to_XY (&x, &y, ra, dec, &image[0].coords);
     
    449450      {
    450451        Image *image;
    451         image = MatchImage (measure[0].t, measure[0].photcode, measure[0].imageID);
     452        image = MatchImageDVO (measure[0].t, measure[0].photcode, measure[0].imageID);
    452453        if (image == NULL) break;
    453454        value.Int = image->externID;
  • trunk/Ohana/src/libdvo/src/dbFields.c

    r31607 r31635  
    1 # include "dvoshell.h"
     1# include "dvo.h"
    22
    33void dbFreeFields (dbField *fields, int Nfields) {
     
    240240  return (TRUE);
    241241}
    242  
     242
    243243int ParseAverageField (dbField *field, char *fieldName) {
    244244
     
    335335}
    336336
     337
    337338int ParseImageField (dbField *field, char *fieldName) {
    338339
  • trunk/Ohana/src/libdvo/src/dbRPN.c

    r31607 r31635  
    1 # include "dvoshell.h"
     1# include "dvo.h"
    22# define DUMPSTACK 0
    33
  • trunk/Ohana/src/libdvo/src/dbStackMath.c

    r31607 r31635  
    1 # include "dvoshell.h"
     1# include "dvo.h"
    22
    33static int NallocBinary = 0;
  • trunk/Ohana/src/libdvo/src/dbStackOps.c

    r31607 r31635  
    1 # include "dvoshell.h"
     1# include "dvo.h"
    22
    33void dbInitStack (dbStack *stack) {
  • trunk/Ohana/src/libdvo/src/match_image.c

    r31607 r31635  
    1 # include "dvoshell.h"
     1# include "dvo.h"
    22
    33off_t match_image (Image *image, off_t Nimage, unsigned int T, short int S) {
Note: See TracChangeset for help on using the changeset viewer.