IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 9, 2015, 8:43:14 AM (11 years ago)
Author:
eugene
Message:

add lensing ps1-v5-r3, lensobj ps1-v5-r1 (adds R7 apertures)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20150405/Ohana/src/libdvo/src/dvo_convert.c

    r38098 r38100  
    455455    return (lensing); }
    456456
     457  if (!strcmp (extname, "DVO_LENSING_PS1_V5") && (ftable[0].header[0].Naxis[0] == 144)) {
     458    Lensing_PS1_V5_R2 *tmpLensing;                                             
     459    tmpLensing = gfits_table_get_Lensing_PS1_V5_R2 (ftable, Nlensing, NULL);
     460    if (!tmpLensing) {                                                 
     461      fprintf (stderr, "ERROR: failed to read lensings\n");             
     462      exit (2);                                                         
     463    }                                                                   
     464    lensing = Lensing_PS1_V5_R2_ToInternal (tmpLensing, *Nlensing);
     465    free (tmpLensing);                                                 
     466    *format = DVO_FORMAT_PS1_V5;                                       
     467    return (lensing); }
     468
     469# define SKIPPING_FORMAT(NAME, FORMAT, TYPE)            \
     470  if (!strcmp (extname, NAME)) {                                        \
     471    fprintf (stderr, "ERROR: format %s not defined for lensing, skipping\n", NAME); \
     472    *Nlensing = 0; \
     473    return NULL; \
     474  }
     475
    457476# define CONVERT_FORMAT(NAME, FORMAT, TYPE)             \
    458477  if (!strcmp (extname, NAME)) {                                        \
     
    468487    return (lensing); }
    469488
    470 # define SKIPPING_FORMAT(NAME, FORMAT, TYPE)            \
    471   if (!strcmp (extname, NAME)) {                                        \
    472     fprintf (stderr, "ERROR: format %s not defined for lensing, skipping\n", NAME); \
    473     *Nlensing = 0; \
    474     return NULL; \
    475   }
    476 
    477489  if (!strcmp (extname, "DVO_LENSING")) {
    478490    lensing = gfits_table_get_Lensing (ftable, Nlensing, NULL);
     
    496508  SKIPPING_FORMAT ("DVO_LENSING_PS1_V3",          PS1_V3,          PS1_V3);
    497509  SKIPPING_FORMAT ("DVO_LENSING_PS1_V4",          PS1_V4,          PS1_V4);
    498   CONVERT_FORMAT  ("DVO_LENSING_PS1_V5",          PS1_V5,          PS1_V5_R2);
     510  CONVERT_FORMAT  ("DVO_LENSING_PS1_V5",          PS1_V5,          PS1_V5_R3);
    499511  SKIPPING_FORMAT ("DVO_LENSING_PS1_SIM",         PS1_SIM,         PS1_SIM);
    500512# undef CONVERT_FORMAT
     
    535547//    FORMAT_CASE (PS1_V3,          PS1_V3);
    536548//    FORMAT_CASE (PS1_V4,          PS1_V4);
    537       FORMAT_CASE (PS1_V5,          PS1_V5_R2);
     549      FORMAT_CASE (PS1_V5,          PS1_V5_R3);
    538550# undef FORMAT_CASE
    539551
     
    557569    return (FALSE);
    558570  }
     571
     572  if (!strcmp (extname, "DVO_LENSOBJ_PS1_V5") && (ftable[0].header[0].Naxis[0] == 136)) {
     573    Lensobj_PS1_V5_R0 *tmpLensobj;                                             
     574    tmpLensobj = gfits_table_get_Lensobj_PS1_V5_R0 (ftable, Nlensobj, NULL);
     575    if (!tmpLensobj) {                                                 
     576      fprintf (stderr, "ERROR: failed to read lensobjs\n");             
     577      exit (2);                                                         
     578    }                                                                   
     579    lensobj = Lensobj_PS1_V5_R0_ToInternal (tmpLensobj, *Nlensobj);
     580    free (tmpLensobj);                                                 
     581    *format = DVO_FORMAT_PS1_V5;                                       
     582    return (lensobj); }
    559583
    560584# define SKIPPING_FORMAT(NAME, FORMAT, TYPE)            \
     
    599623  SKIPPING_FORMAT ("DVO_LENSOBJ_PS1_V3",          PS1_V3,          PS1_V3);
    600624  SKIPPING_FORMAT ("DVO_LENSOBJ_PS1_V4",          PS1_V4,          PS1_V4);
    601   CONVERT_FORMAT  ("DVO_LENSOBJ_PS1_V5",          PS1_V5,          PS1_V5);
     625  CONVERT_FORMAT  ("DVO_LENSOBJ_PS1_V5",          PS1_V5,          PS1_V5_R1);
    602626  SKIPPING_FORMAT ("DVO_LENSOBJ_PS1_SIM",         PS1_SIM,         PS1_SIM);
    603627# undef CONVERT_FORMAT
     
    638662//    FORMAT_CASE (PS1_V3,          PS1_V3);
    639663//    FORMAT_CASE (PS1_V4,          PS1_V4);
    640       FORMAT_CASE (PS1_V5,          PS1_V5);
     664      FORMAT_CASE (PS1_V5,          PS1_V5_R1);
    641665# undef FORMAT_CASE
    642666
Note: See TracChangeset for help on using the changeset viewer.