# 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)) || (photcode == 4100)) return PS1_g; // g-band
  if (((photcode > 10100) && (photcode < 10177)) || (photcode == 4200)) return PS1_r; // r-band
  if (((photcode > 10200) && (photcode < 10277)) || (photcode == 4300)) return PS1_i; // i-band
  if (((photcode > 10300) && (photcode < 10377)) || (photcode == 4400)) return PS1_z; // z-band
  if (((photcode > 10400) && (photcode < 10477)) || (photcode == 4500)) return PS1_y; // y-band
  if (((photcode > 10500) && (photcode < 10577)) || (photcode == 4600)) 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)) || (photcode == 4100)) return TRUE; // g-band
  if (((photcode > 10100) && (photcode < 10177)) || (photcode == 4200)) return TRUE; // r-band
  if (((photcode > 10200) && (photcode < 10277)) || (photcode == 4300)) return TRUE; // i-band
  if (((photcode > 10300) && (photcode < 10377)) || (photcode == 4400)) return TRUE; // z-band
  if (((photcode > 10400) && (photcode < 10477)) || (photcode == 4500)) return TRUE; // y-band
  if (((photcode > 10500) && (photcode < 10577)) || (photcode == 4600)) 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) || (photcode == 14100)) return TRUE; // g-band
  if ((photcode == 11100) || (photcode == 14200)) return TRUE; // r-band
  if ((photcode == 11200) || (photcode == 14300)) return TRUE; // i-band
  if ((photcode == 11300) || (photcode == 14400)) return TRUE; // z-band
  if ((photcode == 11400) || (photcode == 14500)) return TRUE; // y-band
  if ((photcode == 11500) || (photcode == 14600)) 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) || (photcode == 14100)) return TRUE; // g-band
    if ((photcode == 11100) || (photcode == 14200)) return TRUE; // r-band
    if ((photcode == 11200) || (photcode == 14300)) return TRUE; // i-band
    if ((photcode == 11300) || (photcode == 14400)) return TRUE; // z-band
    if ((photcode == 11400) || (photcode == 14500)) return TRUE; // y-band
    if ((photcode == 11500) || (photcode == 14600)) return TRUE; // w-band
    return FALSE;
  }

  if ((photcode == 12000) || (photcode == 15100)) return TRUE; // g-band
  if ((photcode == 12100) || (photcode == 15200)) return TRUE; // r-band
  if ((photcode == 12200) || (photcode == 15300)) return TRUE; // i-band
  if ((photcode == 12300) || (photcode == 15400)) return TRUE; // z-band
  if ((photcode == 12400) || (photcode == 15500)) return TRUE; // y-band
  if ((photcode == 12500) || (photcode == 15600)) return TRUE; // w-band

  return FALSE;
}

int isGPC1synth (int photcode) {

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

  return FALSE;
}

int is2MASS (int photcode) {

  if ((photcode >= 2011) && (photcode <= 2013)) return TRUE;
  return FALSE;
}

int isTYCHO (int photcode) {

  if ((photcode == 2020) || (photcode == 2021)) return TRUE;
  return FALSE;
}

