/** * Creates a new TRACEImage * * @param string $jp2 Source JP2 image * @param string $filepath Location to output the file to * @param array $roi Top-left and bottom-right pixel coordinates on the image * @param array $uiLabels Datasource label hierarchy * @param int $offsetX Offset of the sun center from the image center * @param int $offsetY Offset of the sun center from the iamge center * @param array $options Optional parameters * * @return void */ public function __construct($jp2, $filepath, $roi, $uiLabels, $offsetX, $offsetY, $options) { // TRACE has no color table $colorTable = HV_ROOT_DIR . '/resources/images/color-tables/' . 'TRACE_' . $uiLabels[1]['name'] . '.png'; $this->setColorTable($colorTable); parent::__construct($jp2, $filepath, $roi, $uiLabels, $offsetX, $offsetY, $options); }
/** * Creates a new SWAPImage * * @param string $jp2 Source JP2 image * @param string $filepath Location to output the file to * @param array $roi Top-left and bottom-right pixel coordinates * on the image * @param array $uiLabels Datasource label hierarchy * @param int $offsetX Offset of the sun center from the image center * @param int $offsetY Offset of the sun center from the iamge center * @param array $options Optional parameters * * @return void */ public function __construct($jp2, $filepath, $roi, $uiLabels, $offsetX, $offsetY, $options) { $colorTable = HV_ROOT_DIR . '/resources/images/color-tables' . '/PROBA2_SWAP_$meas.png'; $imgDate = strtotime($options['date']); // Handle SWAP 174's change from built-in color palette to grayscale if ($imgDate < strtotime('2013-06-27 00:00:00')) { $options['palettedJP2'] = true; } else { if ($imgDate < strtotime('2013-06-27 23:59:59')) { // Assume the image is grayscale, but // flag it for verification once the image is loaded into an // imagemagick object within SubFieldImage.php $options['palettedJP2'] = false; $options['verifyGrayscale'] = true; } else { $options['palettedJP2'] = false; } } if ($options['palettedJP2'] === false && @file_exists($colorTable)) { $this->setColorTable($colorTable); } else { $this->setColorTable(false); $options['palettedJP2'] = true; } parent::__construct($jp2, $filepath, $roi, $uiLabels, $offsetX, $offsetY, $options); }
/** * Creates a new EITImage * * @param string $jp2 Source JP2 image * @param string $filepath Location to output the file to * @param array $roi Top-left and bottom-right pixel coordinates on the image * @param array $uiLabels Datasource label hierarchy * @param int $offsetX Offset of the sun center from the image center * @param int $offsetY Offset of the sun center from the iamge center * @param array $options Optional parameters * * @return void */ public function __construct($jp2, $filepath, $roi, $uiLabels, $offsetX, $offsetY, $options) { $labelName = isset($uiLabels[3]) ? $uiLabels[3]['name'] : $uiLabels[2]['name']; $colorTable = HV_ROOT_DIR . '/resources/images/color-tables/SOHO_EIT_' . $labelName . '.png'; if (@file_exists($colorTable)) { $this->setColorTable($colorTable); } else { error_log('Not exist! Label: ' . $labelName . '; ColorTable: ' . $colorTable); } parent::__construct($jp2, $filepath, $roi, $uiLabels, $offsetX, $offsetY, $options); }
/** * Creates a new XRTImage * * @param string $jp2 Source JP2 image * @param string $filepath Location to output the file to * @param array $roi Top-left and bottom-right pixel * coordinates on the image * @param array $uiLabels * @param int $offsetX Offset of the sun center from the * image center * @param int $offsetY Offset of the sun center from the * image center * @param array $options Optional parameters * @param array $sunCenterOffsetParams Header keywords for Sun center * offset calculation * * @return void */ public function __construct($jp2, $filepath, $roi, $uiLabels, $offsetX, $offsetY, $options, $sunCenterOffsetParams) { $this->uiLabels = $uiLabels; $colorTable = HV_ROOT_DIR . '/resources/images/color-tables/Hinode_XRT.png'; if (file_exists($colorTable)) { $this->setColorTable($colorTable); } else { $this->setColorTable(false); } parent::__construct($jp2, $filepath, $roi, $uiLabels, $offsetX, $offsetY, $options); }
/** * Creates a new LASCOImage * * @param string $jp2 Source JP2 image * @param string $filepath Location to output the file to * @param array $roi Top-left and bottom-right pixel coordinates on the image * @param array $uiLabels Datasource label hierarchy * @param int $offsetX Offset of the sun center from the image center * @param int $offsetY Offset of the sun center from the iamge center * @param array $options Optional parameters * * @return void */ public function __construct($jp2, $filepath, $roi, $uiLabels, $offsetX, $offsetY, $options) { if ($uiLabels[2]['name'] == 'C2') { $colorTable = HV_ROOT_DIR . '/resources/images/color-tables/' . 'Red_Temperature.png'; } else { if ($uiLabels[2]['name'] == 'C3') { $colorTable = HV_ROOT_DIR . '/resources/images/color-tables/' . 'Blue_White_Linear.png'; } } if (@file_exists($colorTable)) { $this->setColorTable($colorTable); } parent::__construct($jp2, $filepath, $roi, $uiLabels, $offsetX, $offsetY, $options); }
/** * Creates a new AIAImage * * @param string $jp2 Source JP2 image * @param string $filepath Location to output the file to * @param array $roi Top-left and bottom-right pixel coordinates on the image * @param array $uiLabels Datasource label hierarchy * @param int $offsetX Offset of the sun center from the image center * @param int $offsetY Offset of the sun center from the iamge center * @param array $options Optional parameters * * @return void */ public function __construct($jp2, $filepath, $roi, $uiLabels, $offsetX, $offsetY, $options) { /* Temporary fix to use correct color table. Because both v2 and v3 runnning at same time some names have different parameters */ $name = $uiLabels[2]['name']; if ($uiLabels[2]['name'] == 'AIA') { $name = $uiLabels[3]['name']; } $colorTable = HV_ROOT_DIR . '/resources/images/color-tables/' . 'SDO_AIA_' . $name . '.png'; $this->setColorTable($colorTable); parent::__construct($jp2, $filepath, $roi, $uiLabels, $offsetX, $offsetY, $options); }
/** * Creates a new CORImage * * @param string $jp2 Source JP2 image * @param string $filepath Location to output the file to * @param array $roi Top-left and bottom-right pixel coordinates on * the image * @param array $uiLabels Datasource label hierarchy * @param int $offsetX Offset of the sun center from the image center * @param int $offsetY Offset of the sun center from the iamge center * @param array $options Optional parameters * * @return void */ public function __construct($jp2, $filepath, $roi, $uiLabels, $offsetX, $offsetY, $options) { if ($uiLabels[2]['name'] == 'COR1') { $colorTable = HV_ROOT_DIR . '/resources/images/color-tables' . '/Green-White_Linear.png'; } else { if ($uiLabels[2]['name'] == 'COR2') { $colorTable = HV_ROOT_DIR . '/resources/images/color-tables' . '/Red_Temperature.png'; } } if (@file_exists($colorTable)) { $this->setColorTable($colorTable); } $filepath = substr($filepath, 0, -3) . 'png'; parent::__construct($jp2, $filepath, $roi, $uiLabels, $offsetX, $offsetY, $options); }
/** * Creates a new MDIImage * * @param string $jp2 Source JP2 image * @param string $filepath Location to output the file to (not including a file extension) * @param array $roi Top-left and bottom-right pixel coordinates on the image * @param array $uiLabels Datasource label hierarchy * @param int $offsetX Offset of the sun center from the image center * @param int $offsetY Offset of the sun center from the iamge center * @param array $options Optional parameters * * @return void */ public function __construct($jp2, $filepath, $roi, $uiLabels, $offsetX, $offsetY, $options) { // MDI has no color table $this->setColorTable(false); parent::__construct($jp2, $filepath, $roi, $uiLabels, $offsetX, $offsetY, $options); }
/** * Creates a new EUVIImage * * @param string $jp2 Source JP2 image * @param string $filepath Location to output the file to * @param array $roi Top-left and bottom-right pixel coordinates on the image * @param array $uiLabels Datasource label hierarchy * @param int $offsetX Offset of the sun center from the image center * @param int $offsetY Offset of the sun center from the iamge center * @param array $options Optional parameters * * @return void */ public function __construct($jp2, $filepath, $roi, $uiLabels, $offsetX, $offsetY, $options) { $colorTable = HV_ROOT_DIR . '/resources/images/color-tables/STEREO_EUVI_' . $uiLabels[3]['name'] . '.png'; $this->setColorTable($colorTable); parent::__construct($jp2, $filepath, $roi, $uiLabels, $offsetX, $offsetY, $options); }