[Kstars-devel] KDE/kdeedu/kstars/kstars
Jason Harris
kstars at 30doradus.org
Wed Jul 16 15:59:53 CEST 2008
SVN commit 833244 by harris:
Add an action to download an image from the Sloan Digital Sky Survey to the popup
menu. It replaces one of the two Digitized Sky Survey actions.
CCMAIL: kstars-devel at kde.org
M +6 -6 kspopupmenu.cpp
M +28 -36 skymap.cpp
M +3 -3 skymap.h
--- trunk/KDE/kdeedu/kstars/kstars/kspopupmenu.cpp #833243:833244
@@ -69,8 +69,8 @@
void KSPopupMenu::createEmptyMenu( SkyObject *nullObj ) {
initPopupMenu( nullObj, i18n( "Empty sky" ), QString(), QString(), true, true, false, false, false, true, false );
- addAction( i18nc( "First Generation Digitized Sky Survey", "Show 1st-Gen DSS Image" ), ks->map(), SLOT( slotDSS() ) );
- addAction( i18nc( "Second Generation Digitized Sky Survey", "Show 2nd-Gen DSS Image" ), ks->map(), SLOT( slotDSS2() ) );
+ addAction( i18nc( "Sloan Digital Sky Survey", "Show SDSS Image" ), ks->map(), SLOT( slotSDSS() ) );
+ addAction( i18nc( "Digitized Sky Survey", "Show DSS Image" ), ks->map(), SLOT( slotDSS() ) );
}
void KSPopupMenu::createStarMenu( StarObject *star ) {
@@ -82,8 +82,8 @@
if ( star->name() != "star" ) {
addLinksToMenu( star );
} else {
- addAction( i18nc( "First Generation Digitized Sky Survey", "Show 1st-Gen DSS Image" ), ks->map(), SLOT( slotDSS() ) );
- addAction( i18nc( "Second Generation Digitized Sky Survey", "Show 2nd-Gen DSS Image" ), ks->map(), SLOT( slotDSS2() ) );
+ addAction( i18nc( "Sloan Digital Sky Survey", "Show SDSS Image" ), ks->map(), SLOT( slotSDSS() ) );
+ addAction( i18nc( "Digitized Sky Survey", "Show DSS Image" ), ks->map(), SLOT( slotDSS() ) );
}
}
@@ -269,8 +269,8 @@
}
if ( showDSS ) {
- addAction( i18nc( "First Generation Digitized Sky Survey", "Show 1st-Gen DSS Image" ), ks->map(), SLOT( slotDSS() ) );
- addAction( i18nc( "Second Generation Digitized Sky Survey", "Show 2nd-Gen DSS Image" ), ks->map(), SLOT( slotDSS2() ) );
+ addAction( i18nc( "Sloan Digital Sky Survey", "Show SDSS Image" ), ks->map(), SLOT( slotSDSS() ) );
+ addAction( i18nc( "Digitized Sky Survey", "Show DSS Image" ), ks->map(), SLOT( slotDSS() ) );
addSeparator();
}
else if ( obj->ImageList.count() ) addSeparator();
--- trunk/KDE/kdeedu/kstars/kstars/skymap.cpp #833243:833244
@@ -379,48 +379,40 @@
iv->show();
}
-void SkyMap::slotDSS2( void ) {
- QString URLprefix( "http://archive.stsci.edu/cgi-bin/dss_search?v=2r" );
- QString URLsuffix( "&e=J2000&h=15.0&w=15.0&f=gif&c=none&fov=NONE" );
- dms ra(0.0), dec(0.0);
- QString RAString, DecString;
- char decsgn;
+void SkyMap::slotSDSS() {
+ QString URLprefix( "http://casjobs.sdss.org/ImgCutoutDR6/getjpeg.aspx?" );
+ QString URLsuffix( "&scale=1.0&width=600&height=600&opt=GST&query=SR(10,20)" );
+ dms ra(0.0), dec(0.0);
+ QString RAString, DecString;
- //ra and dec must be the coordinates at J2000. If we clicked on an object, just use the object's ra0, dec0 coords
- //if we clicked on empty sky, we need to precess to J2000.
- if ( clickedObject() ) {
- ra.setH( clickedObject()->ra0()->Hours() );
- dec.setD( clickedObject()->dec0()->Degrees() );
- } else {
- //move present coords temporarily to ra0,dec0 (needed for precessToAnyEpoch)
- clickedPoint()->setRA0( clickedPoint()->ra()->Hours() );
- clickedPoint()->setDec0( clickedPoint()->dec()->Degrees() );
- clickedPoint()->precessFromAnyEpoch( data->ut().djd(), J2000 );
- ra.setH( clickedPoint()->ra()->Hours() );
- dec.setD( clickedPoint()->dec()->Degrees() );
+ //ra and dec must be the coordinates at J2000. If we clicked on an object, just use the object's ra0, dec0 coords
+ //if we clicked on empty sky, we need to precess to J2000.
+ if ( clickedObject() ) {
+ ra.setH( clickedObject()->ra0()->Hours() );
+ dec.setD( clickedObject()->dec0()->Degrees() );
+ } else {
+ //move present coords temporarily to ra0,dec0 (needed for precessToAnyEpoch)
+ clickedPoint()->setRA0( clickedPoint()->ra()->Hours() );
+ clickedPoint()->setDec0( clickedPoint()->dec()->Degrees() );
+ clickedPoint()->precessFromAnyEpoch( data->ut().djd(), J2000 );
+ ra.setH( clickedPoint()->ra()->Hours() );
+ dec.setD( clickedPoint()->dec()->Degrees() );
- //restore coords from present epoch
- clickedPoint()->setRA( clickedPoint()->ra0()->Hours() );
- clickedPoint()->setDec( clickedPoint()->dec0()->Degrees() );
- }
+ //restore coords from present epoch
+ clickedPoint()->setRA( clickedPoint()->ra0()->Hours() );
+ clickedPoint()->setDec( clickedPoint()->dec0()->Degrees() );
+ }
- RAString = RAString.sprintf( "&r=%02d+%02d+%02d", ra.hour(), ra.minute(), ra.second() );
+ RAString = RAString.sprintf( "ra=%f", ra.Degrees() );
+ DecString = DecString.sprintf( "&dec=%f", dec.Degrees() );
- decsgn = '+';
- if ( dec.Degrees() < 0.0 ) decsgn = '-';
- int dd = abs( dec.degree() );
- int dm = abs( dec.arcmin() );
- int ds = abs( dec.arcsec() );
+ //concat all the segments into the kview command line:
+ KUrl url (URLprefix + RAString + DecString + URLsuffix);
- DecString = DecString.sprintf( "&d=%c%02d+%02d+%02d", decsgn, dd, dm, ds );
+ QString message = i18n( "Sloan Digital Sky Survey image provided by the Astrophysical Research Consortium [free for non-commercial use]." );
- //concat all the segments into the kview command line:
- KUrl url (URLprefix + RAString + DecString + URLsuffix);
-
- QString message = i18n( "Digitized Sky Survey image provided by the Space Telescope Science Institute [public domain]." );
-
- ImageViewer *iv = ks->addImageViewer( url, message );
- iv->show();
+ ImageViewer *iv = ks->addImageViewer( url, message );
+ iv->show();
}
void SkyMap::slotBeginAngularDistance() {
--- trunk/KDE/kdeedu/kstars/kstars/skymap.h #833243:833244
@@ -583,12 +583,12 @@
/**@short Popup menu function: Display 1st-Generation DSS image with the Image Viewer.
*@note the URL is generated using the coordinates of ClickedPoint.
*/
- void slotDSS( void );
+ void slotDSS();
- /**@short Popup menu function: Display 2nd-Generation DSS image with the Image Viewer.
+ /**@short Popup menu function: Display Sloan Digital Sky Survey image with the Image Viewer.
*@note the URL is generated using the coordinates of ClickedPoint.
*/
- void slotDSS2( void );
+ void slotSDSS();
/**@short Popup menu function: Show webpage about ClickedObject
*(only available for some objects).
More information about the Kstars-devel
mailing list