示例#1
0
        public static FitsImageJs CreateHipsTile(Imageset dataset, string file, WcsLoaded callMeBack)
        {
            FitsImageJs fits = new FitsImageJs(dataset, file, null, callMeBack);

            fits.isHipsTile = true;
            return(fits);
        }
示例#2
0
 public FitsImage(string file, Blob blob, WcsLoaded callMeBack)
 {
     Last     = this;
     callBack = callMeBack;
     filename = file;
     if (blob != null)
     {
         ReadFromBlob(blob);
     }
     else
     {
         GetFile(file);
     }
 }
 public FitsImage(Imageset dataset, string file, Blob blob, WcsLoaded callMeBack)
 {
     this.dataset        = dataset;
     this.fitsProperties = dataset.FitsProperties;
     callBack            = callMeBack;
     filename            = file;
     if (blob != null)
     {
         ReadFromBlob(blob);
     }
     else
     {
         GetFile(file);
     }
 }
示例#4
0
        private static ImageSetLayer AddFitsLayer(string url, string name, bool gotoTarget, ImagesetLoaded loaded)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                name = LayerManager.GetNextFitsName();
            }

            ImageSetLayer imagesetLayer = new ImageSetLayer();
            Imageset      imageset      = new Imageset();

            WcsLoaded wcsLoaded = delegate(WcsImage wcsImage)
            {
                if (((FitsImage)wcsImage).errored)
                {
                    return;
                }

                int width  = (int)wcsImage.SizeX;
                int height = (int)wcsImage.SizeY;
                //TODO make sure dataset URL is unique
                imageset.SetInitialParameters(
                    wcsImage.Description,
                    wcsImage.Filename,
                    ImageSetType.Sky,
                    BandPass.Visible,
                    ProjectionType.SkyImage,
                    Util.GetHashCode(wcsImage.Filename),
                    0,
                    0,
                    wcsImage.ScaleY,
                    ".fits",
                    wcsImage.ScaleX > 0,
                    "",
                    wcsImage.CenterX,
                    wcsImage.CenterY,
                    wcsImage.Rotation,
                    false,
                    "",
                    false,
                    false,
                    1,
                    wcsImage.ReferenceX,
                    wcsImage.ReferenceY,
                    wcsImage.Copyright,
                    wcsImage.CreditsUrl,
                    "",
                    "",
                    0,
                    ""
                    );

                imageset.WcsImage      = wcsImage;
                imagesetLayer.ImageSet = imageset;
                LayerManager.AddFitsImageSetLayer(imagesetLayer, name);

                if (gotoTarget)
                {
                    double zoom = imageset.GuessZoomSetting(WWTControl.Singleton.RenderContext.ViewCamera.Zoom);

                    WWTControl.Singleton.GotoRADecZoom(
                        wcsImage.ViewCenterX / 15,
                        wcsImage.ViewCenterY,
                        zoom,
                        false,
                        null
                        );
                }

                if (loaded != null)
                {
                    loaded(imagesetLayer);
                }
            };

            if (string.IsNullOrWhiteSpace(name))
            {
                name = LayerManager.GetNextFitsName();
            }

            if (RenderContext.UseGlVersion2)
            {
                new FitsImage(imageset, url, null, wcsLoaded);
            }
            else
            {
                new FitsImageJs(imageset, url, null, wcsLoaded);
            }
            return(imagesetLayer);
        }
示例#5
0
 public FitsImageJs(Imageset dataset, string file, Blob blob, WcsLoaded callMeBack) : base(dataset, file, blob, callMeBack)
 {
 }
 public FitsImageTile(Imageset dataset, string file, WcsLoaded callMeBack) : base(dataset, file, null, callMeBack)
 {
 }