# include "relphot.h"

// for now (20140710) I need to identify gpc1 chips explicitly.  generalize in the future
int whichGPC1filter (int photcode) {

  if ((photcode > 10000) && (photcode < 10077)) return PS1_g; // g-band
  if ((photcode > 10100) && (photcode < 10177)) return PS1_r; // r-band
  if ((photcode > 10200) && (photcode < 10277)) return PS1_i; // i-band
  if ((photcode > 10300) && (photcode < 10377)) return PS1_z; // z-band
  if ((photcode > 10400) && (photcode < 10477)) return PS1_y; // y-band
  if ((photcode > 10500) && (photcode < 10577)) return PS1_w; // w-band

  return PS1_none;
}

// for now (20140710) I need to identify gpc1 chips explicitly.  generalize in the future
int isGPC1chip (int photcode) {

  if ((photcode > 10000) && (photcode < 10077)) return TRUE; // g-band
  if ((photcode > 10100) && (photcode < 10177)) return TRUE; // r-band
  if ((photcode > 10200) && (photcode < 10277)) return TRUE; // i-band
  if ((photcode > 10300) && (photcode < 10377)) return TRUE; // z-band
  if ((photcode > 10400) && (photcode < 10477)) return TRUE; // y-band
  if ((photcode > 10500) && (photcode < 10577)) return TRUE; // w-band

  return FALSE;
}

// for now (20140710) I need to identify gpc1 stacks explicitly.  generalize in the future
int isGPC1stack (int photcode) {

  if (photcode == 11000) return TRUE; // g-band
  if (photcode == 11100) return TRUE; // r-band
  if (photcode == 11200) return TRUE; // i-band
  if (photcode == 11300) return TRUE; // z-band
  if (photcode == 11400) return TRUE; // y-band
  if (photcode == 11500) return TRUE; // w-band

  return FALSE;
}

// for now (20140710) I need to identify gpc1 stacks explicitly.  generalize in the future
int isGPC1warp (int photcode) {

  // diff warps get stack-like photcodes (kind of lame)
  if (IS_DIFF_DB) {
    if (photcode == 11000) return TRUE; // g-band
    if (photcode == 11100) return TRUE; // r-band
    if (photcode == 11200) return TRUE; // i-band
    if (photcode == 11300) return TRUE; // z-band
    if (photcode == 11400) return TRUE; // y-band
    if (photcode == 11500) return TRUE; // w-band
    return FALSE;
  }

  if (photcode == 12000) return TRUE; // g-band
  if (photcode == 12100) return TRUE; // r-band
  if (photcode == 12200) return TRUE; // i-band
  if (photcode == 12300) return TRUE; // z-band
  if (photcode == 12400) return TRUE; // y-band
  if (photcode == 12500) return TRUE; // w-band

  return FALSE;
}

int isGPC1synth (int photcode) {

  if ((photcode >= 3001) && (photcode <= 3006)) return TRUE; // g-band

  return FALSE;
}
