Skip to content

Commit

Permalink
Feat/v2.3 (#1307)
Browse files Browse the repository at this point in the history
* Sky Viewer UI improvements (#1273)

* Changed the position of the 'Map viewer' window now it is displayed centered on the screen following the pattern of the other windows. this change was to prevent the user from confusing it with the other menu items. #1260

* Region Overlay and Snapshot functions have been disabled in Visiomatic #1260

* The visiomatic toolbar where the zoom controls are located has been changed so that it has a better contrast. #1260

* Target Viwer UI improvements (#1274)

* The list of target viewer catalogs is now ordered by the most recent date by default. #1260

* The toolbar of the list of objects in the target viewer has been reorganized, now the buttons follow the natural order of execution. #1260

* The Contact Us entry in the application menu has been removed. #1260

* The order of the buttons in the list of targets has been changed. #1260

* Feat/landing page (#1277)

* Update Django to v2.2.17 (#1256)

* Update Django and other related libs. Django 2.1.15 -> 2.2.17 #1255

* Update of other dependencies

* Integrate with DESaccess (#1258)

* Minor correction in the target catalogs query using postgresql

* Start of integration with Descut service.

* Created methods to Submit and Check the status of the Descut job. and the creation of the method to download the files has started.

* Created methods to download the results, match between targets and images. the method of registering images is still incomplete.

* Finalized the methods of registering images. Correction of target queries. creation of methods that retrieve the list of objects before submitting.

* Partial implementation of the cutout workflow.

* Integration with DESaccess cutout has been implemented. workflow created for submitting and downloading cutout jobs. #1257

* Created methods that allow integration with DESaccess Tile Finder. docstrings of the methods related to Cutout have been added. #1257

* Commenting the 'teste' endpoint

Co-authored-by: Matheus Allein <[email protected]>

* Target Cutout and Integration with DESaccess (#1267)

* Minor correction in the target catalogs query using postgresql

* Start of integration with Descut service.

* Created methods to Submit and Check the status of the Descut job. and the creation of the method to download the files has started.

* Created methods to download the results, match between targets and images. the method of registering images is still incomplete.

* Finalized the methods of registering images. Correction of target queries. creation of methods that retrieve the list of objects before submitting.

* Partial implementation of the cutout workflow.

* Integration with DESaccess cutout has been implemented. workflow created for submitting and downloading cutout jobs. #1257

* Created methods that allow integration with DESaccess Tile Finder. docstrings of the methods related to Cutout have been added. #1257

* Cutout Jobs submission form has been changed to be compatible with the new version of DESaccess. new color image options have been added. #1257

* Alteration of the Mosaic panel has started to allow the selection of more than one type of color image. Cutout Jobs loading and selection has been improved, now the job list will always be updated with all available jobs and the most recent job will be selected by default. #1257

* Refactoring the visualization of the cutouts, it is now possible to choose the color image used in the mosaic.

* minor fix in default settings #1257

* The discard_fits_files function has been implemented to avoid downloading fits files that have not been requested by the user. #1257

* Download Target List compatible with DESacces. (#1269)

* Minor fix in cutout.

* A correction was made to the download feature. to be compatible with the new version of DESaccess.

* Change labels Mosaic -> Cutout

* Minor fix in cutout (#1270)

* Fixing contrast bug and removing features from tile inspection (#1259)

* Fixing contrast bug and removing features from tile inspection

* Changing virtual list library

* Fixing reload logic based on new virtual list

* Fixing release change not loading datasets

* The name of the configuration variable has been changed.

* Enabling clear search and positioning visiomatic on search by position

Co-authored-by: glaubervila <[email protected]>

* Feat/eyeballing tile download (#1268)

* Fetching tile info and displaying on download dialog

* Fetching tile info and displaying on download dialog

* Fetching tile info and displaying on download dialog

* Adding error handler for the case of not having data on tile

* Fixing release change not loading datasets

* feat: home page adjustments.

* feat: Link Sing Up. #1260

* An endpoint was created that returns the url to the NCSA registration page.

* feat: Sing Up Api. #1260

Co-authored-by: Glauber Costa Vila-Verde <[email protected]>
Co-authored-by: Matheus Allein <[email protected]>

* Fixed #1280 error when ordering a list of targets. error was introduced after the sqlalchemy update, now every time an aliased field is used in the ordering the text () function must be used. (#1281)

* Fixed error in target comments and other minor fixes. (#1284)

* Fixed #1282 error when inserting a comment in the list of objects when using oracle database.

* The comment function by position has been disabled. Another color option was included in the cutout. A bug was fixed in the Target preview that prevented the creation of a new comment.

* The part of the menu that listed the External Catalogs tables was removed from the user query code. for the image viewer, only the registration of the tables was removed. #1287 (#1289)

* Fixed an error that prevented when executing an overlay of catalogs, the condition that determines whether the filter by positions will be used was in problem. #1285 (#1286)

* The Vizier Gaia DR3 catalog has been added to the list of external catalogs. #1290 (#1291)

* Adding favicon to applications (#1295)

* Feat/tile viewer validation improvements (#1293)

* Changing routes /eyeballing to /tile_viewer

* Standard toolbar; changing tiles counter

* Tile list navigation by arrow keys

* Adding the contrast button on Visiomatic

* Removing the copy to clipboard tile position

* Enable coordinates by degrees option

* Fixing small bugs

* Adding no search results feedback and including hhmmss search

* Changing toolbar and footer color

* Fixed bugs after validation

* Fixed bugs after validation

* Feat/landing page (#1296)

* feat: Link Sing Up. #1260

* fix: changing method names. #1260

* feat: instructions for login or sign up. #1260

* fix: adjustment in code writing. #1260

* Only the first tile was loading properly (#1298)

* Registration of public releases. (#1299)

* Fixed ellipses orientation for DR2.

* Added examples of coadd table records.

* The functions for recording public releases DR1 and DR2 have been included in the datadiscovery.

* Closed #1297

* Changed the color options for the cutouts, and fixed a bug that prevented the exchange between images. (#1300)

* feat: google analytics implementations. #1275 (#1276)

* feat: google analytics implementations. #1275

* Closed #1275 The Google Analytics upload script has been changed.

* missing gitignore

Co-authored-by: glaubervila <[email protected]>

* Fixing search by position loading forever (#1301)

* Fix/user query check (#1302)

* Removing button "Check" from User Query

* Adding traceback to User Query error

* minor fix in google analytics load script (#1303)

* Fix/analytics (#1304)

* minor fix in google analytics load script

* Fix titles first analytics

* User query external catalog tables. (#1306)

* The External tables menu was enabled in the userquery but without any content. #1305

* Minor change in the target viewer, the download fits image button has been disabled while the new functionality is not ready.

Co-authored-by: Fernando Nicolau <[email protected]>
Co-authored-by: Matheus Allein <[email protected]>
  • Loading branch information
3 people authored Dec 22, 2020
1 parent e3f3724 commit a723045
Show file tree
Hide file tree
Showing 60 changed files with 7,393 additions and 7,552 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@ __pycache__
/pg_data
/pg_backup

# Arquivo do google-analytics
google-analytics.js
65 changes: 65 additions & 0 deletions Docs/exemplo_importacao_coadd_object_dr1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"products": [
{
"display_name": "DR1",
"fields": [],
"releases": [
"dr1"
],
"table": "DR1_MAIN",
"schema": "DES_ADMIN",
"database": "desdr",
"type": "catalog",
"class": "coadd_objects",
"name": "dr1_coadd",
"association": [
{
"ucd": "meta.id;meta.main",
"property": "coadd_object_id"
},
{
"ucd": "pos.eq.ra;meta.main",
"property": "ra"
},
{
"ucd": "pos.eq.dec;meta.main",
"property": "dec"
},
{
"ucd": "phys.size.smajAxis;instr.det;meta.main",
"property": "a_image"
},
{
"ucd": "phys.size.sminAxis;instr.det;meta.main",
"property": "b_image"
},
{
"ucd": "pos.posAng;instr.det;meta.main",
"property": "theta_j2000"
},
{
"ucd": "phot.mag;meta.main;em.opt.g",
"property": "mag_auto_g"
},
{
"ucd": "phot.mag;meta.main;em.opt.r",
"property": "mag_auto_r"
},
{
"ucd": "phot.mag;meta.main;em.opt.i",
"property": "mag_auto_i"
},
{
"ucd": "phot.mag;meta.main;em.opt.z",
"property": "mag_auto_z"
},
{
"ucd": "phot.mag;meta.main;em.opt.Y",
"property": "mag_auto_y"
}
]
}
],
"ticket": "GZY650",
"register_username": "gverde"
}
65 changes: 65 additions & 0 deletions Docs/exemplo_importacao_coadd_object_dr2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"products": [
{
"display_name": "DR2",
"fields": [],
"releases": [
"dr2"
],
"table": "DR2_MAIN_RC",
"schema": "DES_ADMIN",
"database": "dessci",
"type": "catalog",
"class": "coadd_objects",
"name": "dr2",
"association": [
{
"ucd": "meta.id;meta.main",
"property": "coadd_object_id"
},
{
"ucd": "pos.eq.ra;meta.main",
"property": "ra"
},
{
"ucd": "pos.eq.dec;meta.main",
"property": "dec"
},
{
"ucd": "phys.size.smajAxis;instr.det;meta.main",
"property": "a_image"
},
{
"ucd": "phys.size.sminAxis;instr.det;meta.main",
"property": "b_image"
},
{
"ucd": "pos.posAng;instr.det;meta.main",
"property": "theta_j2000"
},
{
"ucd": "phot.mag;meta.main;em.opt.g",
"property": "mag_auto_g"
},
{
"ucd": "phot.mag;meta.main;em.opt.r",
"property": "mag_auto_r"
},
{
"ucd": "phot.mag;meta.main;em.opt.i",
"property": "mag_auto_i"
},
{
"ucd": "phot.mag;meta.main;em.opt.z",
"property": "mag_auto_z"
},
{
"ucd": "phot.mag;meta.main;em.opt.Y",
"property": "mag_auto_y"
}
]
}
],
"ticket": "VDB377",
"register_username": "gverde"
}
65 changes: 65 additions & 0 deletions Docs/exemplo_importacao_coadd_object_y6a1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"products": [
{
"display_name": "Y6A1 Coadd",
"fields": [],
"releases": [
"y6a1_coadd"
],
"table": "Y6A1_COADD_OBJECT_SUMMARY",
"schema": "DES_ADMIN",
"database": "dessci",
"type": "catalog",
"class": "coadd_objects",
"name": "y6a1_coadd",
"association": [
{
"ucd": "meta.id;meta.main",
"property": "coadd_object_id"
},
{
"ucd": "pos.eq.ra;meta.main",
"property": "ra"
},
{
"ucd": "pos.eq.dec;meta.main",
"property": "dec"
},
{
"ucd": "phys.size.smajAxis;instr.det;meta.main",
"property": "a_image"
},
{
"ucd": "phys.size.sminAxis;instr.det;meta.main",
"property": "b_image"
},
{
"ucd": "pos.posAng;instr.det;meta.main",
"property": "theta_j2000"
},
{
"ucd": "phot.mag;meta.main;em.opt.g",
"property": "mag_auto_g"
},
{
"ucd": "phot.mag;meta.main;em.opt.r",
"property": "mag_auto_r"
},
{
"ucd": "phot.mag;meta.main;em.opt.i",
"property": "mag_auto_i"
},
{
"ucd": "phot.mag;meta.main;em.opt.z",
"property": "mag_auto_z"
},
{
"ucd": "phot.mag;meta.main;em.opt.Y",
"property": "mag_auto_y"
}
]
}
],
"ticket": "GZY650",
"register_username": "gverde"
}
2 changes: 1 addition & 1 deletion Docs/exemplo_importacao_coadd_object_y6a2.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@
]
}
],
"ticket": "YKP478",
"ticket": "GZY650",
"register_username": "gverde"
}
6 changes: 3 additions & 3 deletions api/catalog/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ class Meta:
class CommentsSerializer(serializers.HyperlinkedModelSerializer):
catalog_id = IntegerField(allow_null=False)
object_id = CharField(min_length=1, max_length=255, allow_null=False, required=True)
owner = serializers.SerializerMethodField()
date = serializers.SerializerMethodField()
is_owner = serializers.SerializerMethodField()
owner = serializers.SerializerMethodField(read_only=True)
date = serializers.SerializerMethodField(read_only=True)
is_owner = serializers.SerializerMethodField(read_only=True)

class Meta:
model = Comments
Expand Down
50 changes: 41 additions & 9 deletions api/catalog/views.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import math

from django.conf import settings
from lib.CatalogDB import TargetObjectsDBHelper, CatalogObjectsDBHelper
from django.db.models import Max
from lib.CatalogDB import CatalogObjectsDBHelper, TargetObjectsDBHelper, CatalogDB
from product.association import Association
from product.models import Catalog, ProductContentAssociation
from product.serializers import AssociationSerializer
from product.models import Catalog
from rest_framework import viewsets
from rest_framework.response import Response
from rest_framework.viewsets import ViewSet

from .models import Rating, Reject, Comments
from .serializers import RatingSerializer, RejectSerializer, CommentsSerializer

import math
from .models import Comments, Rating, Reject
from .serializers import CommentsSerializer, RatingSerializer, RejectSerializer


class RatingViewSet(viewsets.ModelViewSet):
Expand Down Expand Up @@ -62,7 +62,39 @@ class CommentsViewSet(viewsets.ModelViewSet):
def perform_create(self, serializer):
if not self.request.user.pk:
raise Exception('It is necessary an active login to perform this operation.')
serializer.save(owner=self.request.user.pk)

# TODO: Rever essa solução tentar deixar igual ao comportamento do rating e reject.
# Workaround para corrigir bug reportado na issue https://github.com/linea-it/dri/issues/1282
# Por Algum motivo que eu não consegui descobrir, ocorre um erro
# ao tenta inserir um registro na tabela comments usando Oracle.
# o Oracle reclama que ID não pode ser Null, mas a coluna id é autoincrement,
# nas tabelas Rating e Reject é a mesma situação e nelas o erro não acontece.
# A solução:
# Verificar se o banco utilizado é o Oracle.
# se for faz uma query para na tabela e depois recupera o ultimo Id
# acrescenta +1 e faz o insert usando este ID.

# Problemas:
# - Faz uma query all antes do insert, pode causar um problema de performance se a tabela commens ficar muito grande.
# - Pode ocorrer falhar se 2 usuarios fizerem um comment ao mesmo tempo.

# Verificar se a tabela comments está no Oracle
catalog_db = CatalogDB(db='catalog')
if catalog_db.get_engine() == "oracle":
# Proximo ID
comments = Comments.objects.all()
next_id = comments.aggregate(Max('id'))['id__max'] + 1 if comments else 1

# Faz o Insert
serializer.save(
owner=self.request.user.pk,
pk=next_id
)
else:
# Se não for oracle deixa o Django fazer o processo normal de insert.
serializer.save(
owner=self.request.user.pk,
)


class TargetViewSet(ViewSet):
Expand Down Expand Up @@ -345,7 +377,7 @@ def list(self, request):
if release_set:
release = release_set.release.rls_name
# Se tiver release e ele for o Y3 subtrair 90 graus
areleases = ['y3a1_coadd', 'y6a1_coadd', 'y6a2_coadd', 'dr1', ]
areleases = ['y3a1_coadd', 'y6a1_coadd', 'y6a2_coadd', 'dr1', 'dr2']
if release in areleases:
t_image = 90 - t_image

Expand Down
Loading

0 comments on commit a723045

Please sign in to comment.