diff options
Diffstat (limited to 'tksao/frame/frameload.C')
-rw-r--r-- | tksao/frame/frameload.C | 515 |
1 files changed, 335 insertions, 180 deletions
diff --git a/tksao/frame/frameload.C b/tksao/frame/frameload.C index 2ccd30b..b2b02ea 100644 --- a/tksao/frame/frameload.C +++ b/tksao/frame/frameload.C @@ -13,11 +13,11 @@ void Frame::loadFitsAllocCmd(const char* ch, const char* fn, LayerType ll) Base::loadFitsAllocCmd(ch, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); - FitsImage* img = new FitsImageFitsAlloc(cc, interp, - ch, fn, FitsFile::NOFLUSH, 1); + Context* cc = loadMask(); + if (!cc) + return; + FitsImage* img = new FitsImageFitsAlloc(cc, interp, ch, fn, + FitsFile::NOFLUSH, 1); loadDone(cc->load(ALLOC, fn, img)); break; } @@ -30,11 +30,11 @@ void Frame::loadFitsAllocGZCmd(const char* ch, const char* fn, LayerType ll) Base::loadFitsAllocGZCmd(ch, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); - FitsImage* img = new FitsImageFitsAllocGZ(cc, interp, - ch, fn, FitsFile::NOFLUSH, 1); + Context* cc = loadMask(); + if (!cc) + return; + FitsImage* img = new FitsImageFitsAllocGZ(cc, interp, ch, fn, + FitsFile::NOFLUSH, 1); loadDone(cc->load(ALLOCGZ, fn, img)); break; } @@ -47,11 +47,11 @@ void Frame::loadFitsChannelCmd(const char* ch, const char* fn, LayerType ll) Base::loadFitsChannelCmd(ch, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); - FitsImage* img = new FitsImageFitsChannel(cc, interp, - ch, fn, FitsFile::NOFLUSH, 1); + Context* cc = loadMask(); + if (!cc) + return; + FitsImage* img = new FitsImageFitsChannel(cc, interp, ch, fn, + FitsFile::NOFLUSH, 1); loadDone(cc->load(CHANNEL, fn, img)); break; } @@ -64,9 +64,9 @@ void Frame::loadFitsMMapCmd(const char* fn, LayerType ll) Base::loadFitsMMapCmd(fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); + Context* cc = loadMask(); + if (!cc) + return; FitsImage* img = new FitsImageFitsMMap(cc, interp, fn, 1); loadDone(cc->load(MMAP, fn, img)); break; @@ -80,9 +80,9 @@ void Frame::loadFitsSMMapCmd(const char* hdr, const char* fn, LayerType ll) Base::loadFitsSMMapCmd(hdr, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); + Context* cc = loadMask(); + if (!cc) + return; FitsImage* img = new FitsImageFitsSMMap(cc, interp, hdr, fn, 1); loadDone(cc->load(SMMAP, fn, img)); break; @@ -96,9 +96,9 @@ void Frame::loadFitsMMapIncrCmd(const char* fn, LayerType ll) Base::loadFitsMMapIncrCmd(fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); + Context* cc = loadMask(); + if (!cc) + return; FitsImage* img = new FitsImageFitsMMapIncr(cc, interp, fn, 1); loadDone(cc->load(MMAPINCR, fn, img)); break; @@ -113,9 +113,9 @@ void Frame::loadFitsShareCmd(ShmType stype, int id, const char* fn, Base::loadFitsShareCmd(stype, id, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); + Context* cc = loadMask(); + if (!cc) + return; FitsImage* img = new FitsImageFitsShare(cc, interp, stype, id, fn, 1); loadDone(cc->load(SHARE, fn, img)); @@ -131,9 +131,9 @@ void Frame::loadFitsSShareCmd(ShmType stype, int hdr, int id, const char* fn, Base::loadFitsSShareCmd(stype, hdr, id, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); + Context* cc = loadMask(); + if (!cc) + return; FitsImage* img = new FitsImageFitsSShare(cc, interp, stype, hdr, id, fn, 1); loadDone(cc->load(SSHARE, fn, img)); @@ -148,9 +148,9 @@ void Frame::loadFitsSocketCmd(int s, const char* fn, LayerType ll) Base::loadFitsSocketCmd(s, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); + Context* cc = loadMask(); + if (!cc) + return; FitsImage* img = new FitsImageFitsSocket(cc, interp, s, fn, FitsFile::FLUSH, 1); loadDone(cc->load(SOCKET, fn, img)); @@ -165,9 +165,9 @@ void Frame::loadFitsSocketGZCmd(int s, const char* fn, LayerType ll) Base::loadFitsSocketGZCmd(s, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); + Context* cc = loadMask(); + if (!cc) + return; FitsImage* img = new FitsImageFitsSocketGZ(cc, interp, s, fn, FitsFile::FLUSH, 1); loadDone(cc->load(SOCKETGZ, fn, img)); @@ -182,9 +182,9 @@ void Frame::loadFitsVarCmd(const char* ch, const char* fn, LayerType ll) Base::loadFitsVarCmd(ch, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); + Context* cc = loadMask(); + if (!cc) + return; FitsImage* img = new FitsImageFitsVar(cc, interp, ch, fn, 1); loadDone(cc->load(VAR, fn, img)); break; @@ -200,9 +200,9 @@ void Frame::loadArrAllocCmd(const char* ch, const char* fn, LayerType ll) Base::loadArrAllocCmd(ch, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); + Context* cc = loadMask(); + if (!cc) + return; FitsImage* img = new FitsImageArrAlloc(cc, interp, ch, fn, FitsFile::NOFLUSH, 1); loadDone(cc->load(ALLOC, fn, img)); @@ -217,9 +217,9 @@ void Frame::loadArrAllocGZCmd(const char* ch, const char* fn, LayerType ll) Base::loadArrAllocGZCmd(ch, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); + Context* cc = loadMask(); + if (!cc) + return; FitsImage* img = new FitsImageArrAllocGZ(cc, interp, ch, fn, FitsFile::NOFLUSH, 1); loadDone(cc->load(ALLOCGZ, fn, img)); @@ -234,9 +234,9 @@ void Frame::loadArrChannelCmd(const char* ch, const char* fn, LayerType ll) Base::loadArrChannelCmd(ch, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); + Context* cc = loadMask(); + if (!cc) + return; FitsImage* img = new FitsImageArrChannel(cc, interp, ch, fn, FitsFile::NOFLUSH, 1); loadDone(cc->load(CHANNEL, fn, img)); @@ -251,9 +251,9 @@ void Frame::loadArrMMapCmd(const char* fn, LayerType ll) Base::loadArrMMapCmd(fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); + Context* cc = loadMask(); + if (!cc) + return; FitsImage* img = new FitsImageArrMMap(cc, interp, fn, 1); loadDone(cc->load(MMAP, fn, img)); break; @@ -267,9 +267,9 @@ void Frame::loadArrMMapIncrCmd(const char* fn, LayerType ll) Base::loadArrMMapIncrCmd(fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); + Context* cc = loadMask(); + if (!cc) + return; FitsImage* img = new FitsImageArrMMapIncr(cc, interp, fn, 1); loadDone(cc->load(MMAPINCR, fn, img)); break; @@ -284,9 +284,9 @@ void Frame::loadArrShareCmd(ShmType stype, int id, const char* fn, Base::loadArrShareCmd(stype, id, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); + Context* cc = loadMask(); + if (!cc) + return; FitsImage* img = new FitsImageArrShare(cc, interp, stype, id, fn, 1); loadDone(cc->load(SHARE, fn, img)); break; @@ -300,9 +300,9 @@ void Frame::loadArrSocketCmd(int s, const char* fn, LayerType ll) Base::loadArrSocketCmd(s, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); + Context* cc = loadMask(); + if (!cc) + return; FitsImage* img = new FitsImageArrSocket(cc, interp, s, fn, FitsFile::FLUSH, 1); loadDone(cc->load(SOCKET, fn, img)); @@ -317,9 +317,9 @@ void Frame::loadArrSocketGZCmd(int s, const char* fn, LayerType ll) Base::loadArrSocketGZCmd(s, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); + Context* cc = loadMask(); + if (!cc) + return; FitsImage* img = new FitsImageArrSocketGZ(cc, interp, s, fn, FitsFile::FLUSH, 1); loadDone(cc->load(SOCKETGZ, fn, img)); @@ -334,9 +334,9 @@ void Frame::loadArrVarCmd(const char* ch, const char* fn, LayerType ll) Base::loadArrVarCmd(ch, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); + Context* cc = loadMask(); + if (!cc) + return; FitsImage* img = new FitsImageArrVar(cc, interp, ch, fn, 1); loadDone(cc->load(VAR, fn, img)); break; @@ -352,9 +352,9 @@ void Frame::loadNRRDAllocCmd(const char* ch, const char* fn, LayerType ll) Base::loadNRRDAllocCmd(ch, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); + Context* cc = loadMask(); + if (!cc) + return; FitsImage* img = new FitsImageNRRDAlloc(cc, interp, ch, fn, FitsFile::NOFLUSH, 1); loadDone(cc->load(ALLOC, fn, img)); @@ -369,9 +369,9 @@ void Frame::loadNRRDChannelCmd(const char* ch, const char* fn, LayerType ll) Base::loadNRRDChannelCmd(ch, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); + Context* cc = loadMask(); + if (!cc) + return; FitsImage* img = new FitsImageNRRDChannel(cc, interp, ch, fn, FitsFile::NOFLUSH, 1); loadDone(cc->load(CHANNEL, fn, img)); @@ -386,9 +386,9 @@ void Frame::loadNRRDMMapCmd(const char* fn, LayerType ll) Base::loadNRRDMMapCmd(fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); + Context* cc = loadMask(); + if (!cc) + return; FitsImage* img = new FitsImageNRRDMMap(cc, interp, fn, 1); loadDone(cc->load(MMAP, fn, img)); break; @@ -403,9 +403,9 @@ void Frame::loadNRRDShareCmd(ShmType stype, int id, const char* fn, Base::loadNRRDShareCmd(stype, id, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); + Context* cc = loadMask(); + if (!cc) + return; FitsImage* img = new FitsImageNRRDShare(cc, interp, stype, id, fn, 1); loadDone(cc->load(SHARE, fn, img)); break; @@ -419,9 +419,9 @@ void Frame::loadNRRDSocketCmd(int s, const char* fn, LayerType ll) Base::loadNRRDSocketCmd(s, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); + Context* cc = loadMask(); + if (!cc) + return; FitsImage* img = new FitsImageNRRDSocket(cc, interp, s, fn, FitsFile::FLUSH, 1); loadDone(cc->load(SOCKET, fn, img)); @@ -436,9 +436,9 @@ void Frame::loadNRRDVarCmd(const char* ch, const char* fn, LayerType ll) Base::loadNRRDVarCmd(ch, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); + Context* cc = loadMask(); + if (!cc) + return; FitsImage* img = new FitsImageNRRDVar(cc, interp, ch, fn, 1); loadDone(cc->load(VAR, fn, img)); break; @@ -456,9 +456,9 @@ void Frame::loadMosaicImageAllocCmd(MosaicType type, Coord::CoordSystem sys, Base::loadMosaicImageAllocCmd(type, sys, ch, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); + Context* cc = loadMask(); + if (!cc) + return; FitsImage* img = new FitsImageMosaicAlloc(cc, interp, ch, fn, FitsFile::NOFLUSH, 1); loadDone(cc->loadMosaicImage(ALLOC, fn, img, type, sys)); @@ -476,9 +476,9 @@ void Frame::loadMosaicImageAllocGZCmd(MosaicType type, Coord::CoordSystem sys, Base::loadMosaicImageAllocGZCmd(type, sys, ch, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); + Context* cc = loadMask(); + if (!cc) + return; FitsImage* img = new FitsImageMosaicAllocGZ(cc, interp, ch, fn, FitsFile::NOFLUSH, 1); loadDone(cc->loadMosaicImage(ALLOCGZ, fn, img, type, sys)); @@ -496,9 +496,9 @@ void Frame::loadMosaicImageChannelCmd(MosaicType type, Coord::CoordSystem sys, Base::loadMosaicImageChannelCmd(type, sys, ch, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); + Context* cc = loadMask(); + if (!cc) + return; FitsImage* img = new FitsImageMosaicChannel(cc, interp, ch, fn, FitsFile::NOFLUSH, 1); loadDone(cc->loadMosaicImage(CHANNEL, fn, img, type, sys)); @@ -514,9 +514,9 @@ void Frame::loadMosaicImageMMapCmd(MosaicType type, Coord::CoordSystem sys, Base::loadMosaicImageMMapCmd(type, sys, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); + Context* cc = loadMask(); + if (!cc) + return; FitsImage* img = new FitsImageMosaicMMap(cc, interp, fn, 1); loadDone(cc->loadMosaicImage(MMAP, fn, img, type, sys)); break; @@ -531,9 +531,9 @@ void Frame::loadMosaicImageMMapIncrCmd(MosaicType type, Coord::CoordSystem sys, Base::loadMosaicImageMMapIncrCmd(type, sys, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); + Context* cc = loadMask(); + if (!cc) + return; FitsImage* img = new FitsImageMosaicMMapIncr(cc, interp, fn, 1); loadDone(cc->loadMosaicImage(MMAPINCR, fn, img, type, sys)); break; @@ -550,9 +550,9 @@ void Frame::loadMosaicImageShareCmd(MosaicType type, Coord::CoordSystem sys, Base::loadMosaicImageShareCmd(type, sys, stype, id, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); + Context* cc = loadMask(); + if (!cc) + return; FitsImage* img = new FitsImageMosaicShare(cc, interp, stype, id, fn, 1); loadDone(cc->loadMosaicImage(SHARE, fn, img, type, sys)); break; @@ -568,9 +568,9 @@ void Frame::loadMosaicImageSocketCmd(MosaicType type, Coord::CoordSystem sys, Base::loadMosaicImageSocketCmd(type, sys, s, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); + Context* cc = loadMask(); + if (!cc) + return; FitsImage* img = new FitsImageMosaicSocket(cc, interp, s, fn, FitsFile::NOFLUSH, 1); loadDone(cc->loadMosaicImage(SOCKET, fn, img, type, sys)); @@ -586,9 +586,9 @@ void Frame::loadMosaicImageSocketGZCmd(MosaicType type, Coord::CoordSystem sys, Base::loadMosaicImageSocketGZCmd(type, sys, s, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); + Context* cc = loadMask(); + if (!cc) + return; FitsImage* img = new FitsImageMosaicSocketGZ(cc, interp, s, fn, FitsFile::NOFLUSH, 1); loadDone(cc->loadMosaicImage(SOCKETGZ, fn, img, type, sys)); @@ -604,15 +604,172 @@ void Frame::loadMosaicImageVarCmd(MosaicType type, Coord::CoordSystem sys, Base::loadMosaicImageVarCmd(type, sys, ch, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); + Context* cc = loadMask(); + if (!cc) + return; FitsImage* img = new FitsImageMosaicVar(cc, interp, ch, fn, 1); loadDone(cc->loadMosaicImage(VAR, fn, img, type, sys)); break; } } +// *** Mosaic Image WFPC2 *** + +void Frame::loadMosaicImageWFPC2AllocCmd(const char* ch, const char* fn, + LayerType ll) +{ + switch (ll) { + case IMG: + Base::loadMosaicImageWFPC2AllocCmd(ch, fn, ll); + break; + case MASK: + Context* cc = loadMask(); + if (!cc) + return; + FitsImage* img = new FitsImageFitsAlloc(cc, interp, + ch, fn, FitsFile::NOFLUSH, 1); + loadDone(cc->loadMosaicWFPC2(ALLOC, fn, img)); + break; + } + +} + +void Frame::loadMosaicImageWFPC2AllocGZCmd(const char* ch, const char* fn, + LayerType ll) +{ + switch (ll) { + case IMG: + Base::loadMosaicImageWFPC2AllocGZCmd(ch, fn, ll); + break; + case MASK: + Context* cc = loadMask(); + if (!cc) + return; + FitsImage* img = new FitsImageFitsAllocGZ(cc, interp, ch, fn, + FitsFile::NOFLUSH, 1); + loadDone(cc->loadMosaicWFPC2(ALLOCGZ, fn, img)); + break; + } +} + +void Frame::loadMosaicImageWFPC2ChannelCmd(const char* ch, const char* fn, + LayerType ll) +{ + switch (ll) { + case IMG: + Base::loadMosaicImageWFPC2ChannelCmd(ch, fn, ll); + break; + case MASK: + Context* cc = loadMask(); + if (!cc) + return; + FitsImage* img = new FitsImageFitsChannel(cc, interp, ch, fn, + FitsFile::NOFLUSH, 1); + loadDone(cc->loadMosaicWFPC2(CHANNEL, fn, img)); + break; + } +} + +void Frame::loadMosaicImageWFPC2MMapCmd(const char* fn, LayerType ll) +{ + switch (ll) { + case IMG: + Base::loadMosaicImageWFPC2MMapCmd(fn, ll); + break; + case MASK: + Context* cc = loadMask(); + if (!cc) + return; + FitsImage* img = new FitsImageFitsMMap(cc, interp, fn, 1); + loadDone(cc->loadMosaicWFPC2(MMAP, fn, img)); + break; + } +} + +void Frame::loadMosaicImageWFPC2MMapIncrCmd(const char* fn, LayerType ll) +{ + switch (ll) { + case IMG: + Base::loadMosaicImageWFPC2MMapIncrCmd(fn, ll); + break; + case MASK: + Context* cc = loadMask(); + if (!cc) + return; + FitsImage* img = new FitsImageFitsMMapIncr(cc, interp, fn, 1); + loadDone(cc->loadMosaicWFPC2(MMAPINCR, fn, img)); + break; + } +} + +void Frame::loadMosaicImageWFPC2ShareCmd(ShmType stype, int id, const char* fn, + LayerType ll) +{ + switch (ll) { + case IMG: + Base::loadMosaicImageWFPC2ShareCmd(stype, id, fn, ll); + break; + case MASK: + Context* cc = loadMask(); + if (!cc) + return; + FitsImage* img = new FitsImageFitsShare(cc, interp, stype, id, fn, 1); + loadDone(cc->loadMosaicWFPC2(SHARE, fn, img)); + break; + } +} + +void Frame::loadMosaicImageWFPC2SocketCmd(int s, const char* fn, LayerType ll) +{ + switch (ll) { + case IMG: + Base::loadMosaicImageWFPC2SocketCmd(s, fn, ll); + break; + case MASK: + Context* cc = loadMask(); + if (!cc) + return; + FitsImage* img = new FitsImageFitsSocket(cc, interp, s, fn, + FitsFile::NOFLUSH, 1); + loadDone(cc->loadMosaicWFPC2(SOCKET, fn, img)); + break; + } +} + +void Frame::loadMosaicImageWFPC2SocketGZCmd(int s, const char* fn, LayerType ll) +{ + switch (ll) { + case IMG: + Base::loadMosaicImageWFPC2SocketGZCmd(s, fn, ll); + break; + case MASK: + Context* cc = loadMask(); + if (!cc) + return; + FitsImage* img = new FitsImageFitsSocketGZ(cc, interp, s, fn, + FitsFile::NOFLUSH, 1); + loadDone(cc->loadMosaicWFPC2(SOCKETGZ, fn, img)); + break; + } +} + +void Frame::loadMosaicImageWFPC2VarCmd(const char* ch, const char* fn, + LayerType ll) +{ + switch (ll) { + case IMG: + Base::loadMosaicImageWFPC2VarCmd(ch, fn, ll); + break; + case MASK: + Context* cc = loadMask(); + if (!cc) + return; + FitsImage* img = new FitsImageFitsVar(cc, interp, ch, fn, 1); + loadDone(cc->loadMosaicWFPC2(VAR, fn, img)); + break; + } +} + // *** Mosaic *** void Frame::loadMosaicAllocCmd(MosaicType type, Coord::CoordSystem sys, @@ -623,11 +780,11 @@ void Frame::loadMosaicAllocCmd(MosaicType type, Coord::CoordSystem sys, Base::loadMosaicAllocCmd(type, sys, ch, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); - FitsImage* img = new FitsImageFitsAlloc(cc, interp, - ch, fn, FitsFile::NOFLUSH, 1); + Context* cc = loadMask(); + if (!cc) + return; + FitsImage* img = new FitsImageFitsAlloc(cc, interp, ch, fn, + FitsFile::NOFLUSH, 1); loadDone(cc->loadMosaic(ALLOC, fn, img, type, sys)); break; } @@ -641,11 +798,11 @@ void Frame::loadMosaicAllocGZCmd(MosaicType type, Coord::CoordSystem sys, Base::loadMosaicAllocGZCmd(type, sys, ch, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); - FitsImage* img = new FitsImageFitsAllocGZ(cc, interp, - ch, fn, FitsFile::NOFLUSH, 1); + Context* cc = loadMask(); + if (!cc) + return; + FitsImage* img = new FitsImageFitsAllocGZ(cc, interp, ch, fn, + FitsFile::NOFLUSH, 1); loadDone(cc->loadMosaic(ALLOCGZ, fn, img, type, sys)); break; } @@ -659,15 +816,14 @@ void Frame::loadMosaicChannelCmd(MosaicType type, Coord::CoordSystem sys, Base::loadMosaicChannelCmd(type, sys, ch, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); - FitsImage* img = new FitsImageFitsChannel(cc, interp, - ch, fn, FitsFile::NOFLUSH, 1); + Context* cc = loadMask(); + if (!cc) + return; + FitsImage* img = new FitsImageFitsChannel(cc, interp, ch, fn, + FitsFile::NOFLUSH, 1); loadDone(cc->loadMosaic(CHANNEL, fn, img, type, sys)); break; } - } void Frame::loadMosaicMMapCmd(MosaicType type, Coord::CoordSystem sys, @@ -678,15 +834,13 @@ void Frame::loadMosaicMMapCmd(MosaicType type, Coord::CoordSystem sys, Base::loadMosaicMMapCmd(type, sys, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); - FitsImage* img = new FitsImageFitsMMap(cc, interp, - fn, 1); - loadDone(cc->loadMosaic(MMAP, fn, img, type, sys)); + Context* cc = loadMask(); + if (!cc) + return; + FitsImage* img = new FitsImageFitsMMap(cc, interp, fn, 1); + loadDone(cc->loadMosaic(MMAP, fn, img, type, sys)); break; } - } void Frame::loadMosaicSMMapCmd(MosaicType type, Coord::CoordSystem sys, @@ -698,15 +852,13 @@ void Frame::loadMosaicSMMapCmd(MosaicType type, Coord::CoordSystem sys, Base::loadMosaicSMMapCmd(type, sys, hdr, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); - FitsImage* img = new FitsImageFitsSMMap(cc, interp, - hdr, fn, 1); - loadDone(cc->loadMosaic(MMAP, fn, img, type, sys)); + Context* cc = loadMask(); + if (!cc) + return; + FitsImage* img = new FitsImageFitsSMMap(cc, interp, hdr, fn, 1); + loadDone(cc->loadMosaic(MMAP, fn, img, type, sys)); break; } - } void Frame::loadMosaicMMapIncrCmd(MosaicType type, Coord::CoordSystem sys, @@ -717,15 +869,13 @@ void Frame::loadMosaicMMapIncrCmd(MosaicType type, Coord::CoordSystem sys, Base::loadMosaicMMapIncrCmd(type, sys, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); - FitsImage* img = new FitsImageFitsMMapIncr(cc, interp, - fn, 1); - loadDone(cc->loadMosaic(MMAPINCR, fn, img, type, sys)); + Context* cc = loadMask(); + if (!cc) + return; + FitsImage* img = new FitsImageFitsMMapIncr(cc, interp, fn, 1); + loadDone(cc->loadMosaic(MMAPINCR, fn, img, type, sys)); break; } - } void Frame::loadMosaicShareCmd(MosaicType type, Coord::CoordSystem sys, @@ -737,15 +887,13 @@ void Frame::loadMosaicShareCmd(MosaicType type, Coord::CoordSystem sys, Base::loadMosaicShareCmd(type, sys, stype, id, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); - FitsImage* img = new FitsImageFitsShare(cc, interp, - stype, id, fn, 1); - loadDone(cc->loadMosaic(SHARE, fn, img, type, sys)); + Context* cc = loadMask(); + if (!cc) + return; + FitsImage* img = new FitsImageFitsShare(cc, interp, stype, id, fn, 1); + loadDone(cc->loadMosaic(SHARE, fn, img, type, sys)); break; } - } void Frame::loadMosaicSShareCmd(MosaicType type, Coord::CoordSystem sys, @@ -757,15 +905,13 @@ void Frame::loadMosaicSShareCmd(MosaicType type, Coord::CoordSystem sys, Base::loadMosaicSShareCmd(type, sys, stype, hdr, id, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); - FitsImage* img = new FitsImageFitsSShare(cc, interp, - stype, hdr, id, fn, 1); - loadDone(cc->loadMosaic(SSHARE, fn, img, type, sys)); + Context* cc = loadMask(); + if (!cc) + return; + FitsImage* img = new FitsImageFitsSShare(cc, interp, stype, hdr, id, fn, 1); + loadDone(cc->loadMosaic(SSHARE, fn, img, type, sys)); break; } - } void Frame::loadMosaicSocketCmd(MosaicType type, Coord::CoordSystem sys, @@ -776,15 +922,14 @@ void Frame::loadMosaicSocketCmd(MosaicType type, Coord::CoordSystem sys, Base::loadMosaicSocketCmd(type, sys, s, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); - FitsImage* img = new FitsImageFitsSocket(cc, interp, - s, fn, FitsFile::FLUSH, 1); - loadDone(cc->loadMosaic(SOCKET, fn, img, type, sys)); + Context* cc = loadMask(); + if (!cc) + return; + FitsImage* img = new FitsImageFitsSocket(cc, interp, s, fn, + FitsFile::FLUSH, 1); + loadDone(cc->loadMosaic(SOCKET, fn, img, type, sys)); break; } - } void Frame::loadMosaicSocketGZCmd(MosaicType type, Coord::CoordSystem sys, @@ -795,12 +940,12 @@ void Frame::loadMosaicSocketGZCmd(MosaicType type, Coord::CoordSystem sys, Base::loadMosaicSocketGZCmd(type, sys, s, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); - FitsImage* img = new FitsImageFitsSocketGZ(cc, interp, - s, fn, FitsFile::FLUSH, 1); - loadDone(cc->loadMosaic(SOCKETGZ, fn, img, type, sys)); + Context* cc = loadMask(); + if (!cc) + return; + FitsImage* img = new FitsImageFitsSocketGZ(cc, interp, s, fn, + FitsFile::FLUSH, 1); + loadDone(cc->loadMosaic(SOCKETGZ, fn, img, type, sys)); break; } } @@ -814,11 +959,10 @@ void Frame::loadMosaicVarCmd(MosaicType type, Coord::CoordSystem sys, Base::loadMosaicVarCmd(type, sys, ch, fn, ll); break; case MASK: - FitsMask* msk = new FitsMask(this, maskColorName, maskMark); - mask.append(msk); - Context* cc = msk->context(); - FitsImage* img = new FitsImageFitsVar(cc, interp, - ch, fn, 1); + Context* cc = loadMask(); + if (!cc) + return; + FitsImage* img = new FitsImageFitsVar(cc, interp, ch, fn, 1); loadDone(cc->loadMosaic(VAR, fn, img, type, sys)); break; } @@ -826,6 +970,17 @@ void Frame::loadMosaicVarCmd(MosaicType type, Coord::CoordSystem sys, // Support +Context* Frame::loadMask() +{ + if (!keyContext->fits) { + result = TCL_ERROR; + return NULL; + } + FitsMask* msk = new FitsMask(this, maskColorName, maskMark); + mask.append(msk); + return msk->context(); +} + void Frame::loadDone(int rr) { if (rr) |