~keith-hughitt/helioviewer.org/2.0

« back to all changes in this revision

Viewing changes to api/src/Image/ImageType/EUVIImage.php

  • Committer: Keith Hughitt
  • Date: 2011-12-02 19:39:20 UTC
  • Revision ID: keith.hughitt@nasa.gov-20111202193920-29g5cn177se3vfph
Helioviewer.org 2.2.2 release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php 
 
2
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 
3
/**
 
4
 * Image_ImageType_EUVIImage class definition
 
5
 * There is one xxxImage for each type of detector Helioviewer supports.
 
6
 *
 
7
 * PHP version 5
 
8
 *
 
9
 * @category Image
 
10
 * @package  Helioviewer
 
11
 * @author   Keith Hughitt <keith.hughitt@nasa.gov>
 
12
 * @license  http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License 1.1
 
13
 * @link     http://launchpad.net/helioviewer.org
 
14
 */
 
15
require_once 'src/Image/HelioviewerImage.php';
 
16
/**
 
17
 * Image_ImageType_EUVIImage class definition
 
18
 * There is one xxxImage for each type of detector Helioviewer supports.
 
19
 *
 
20
 * PHP version 5
 
21
 *
 
22
 * @category Image
 
23
 * @package  Helioviewer
 
24
 * @author   Keith Hughitt <keith.hughitt@nasa.gov>
 
25
 * @license  http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License 1.1
 
26
 * @link     http://launchpad.net/helioviewer.org
 
27
 */
 
28
class Image_ImageType_EUVIImage extends Image_HelioviewerImage
 
29
{
 
30
    /**
 
31
     * Creates a new EUVIImage
 
32
     * 
 
33
     * @param string $jp2      Source JP2 image
 
34
     * @param string $filepath Location to output the file to
 
35
     * @param array  $roi      Top-left and bottom-right pixel coordinates on the image
 
36
     * @param string $inst     Instrument
 
37
     * @param string $det      Detector
 
38
     * @param string $meas     Measurement
 
39
     * @param int    $offsetX  Offset of the sun center from the image center
 
40
     * @param int    $offsetY  Offset of the sun center from the iamge center
 
41
     * @param array  $options  Optional parameters
 
42
     * 
 
43
     * @return void
 
44
     */     
 
45
    public function __construct($jp2, $filepath, $roi, $obs, $inst, $det, $meas, $offsetX, $offsetY, $options)
 
46
    {
 
47
        $colorTable = HV_ROOT_DIR . "/api/resources/images/color-tables/STEREO_EUVI_$meas.png";
 
48
        $this->setColorTable($colorTable);
 
49
        parent::__construct($jp2, $filepath, $roi, $obs, $inst, $det, $meas, $offsetX, $offsetY, $options);
 
50
    }
 
51
    
 
52
    /**
 
53
     * Gets a string that will be displayed in the image's watermark
 
54
     * 
 
55
     * @return string watermark name
 
56
     */
 
57
    public function getWaterMarkName() 
 
58
    {
 
59
        $which = substr($this->observatory, -1);
 
60
        return "EUVI-$which $this->measurement\n";
 
61
    }
 
62
}