Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

48 add filesize and date #51

Merged
merged 8 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions framework/climate/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ class GlobalClimateModelAdmin(admin.ModelAdmin):
class RegionalClimateModelAdmin(admin.ModelAdmin):
list_display = ('name_short',)


class ProcessingMethodAdmin(admin.ModelAdmin):
list_display = ('name',)


admin.site.register(CfStandardNames, CfStandardNamesAdmin)
admin.site.register(ClimateLayer, ClimateLayerAdmin)
admin.site.register(ClimateVariable, ClimateVariableAdmin)
Expand Down
33 changes: 19 additions & 14 deletions framework/climate/cdo_calls.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,35 @@
from cdo import Cdo
import sys

print ('argument list', sys.argv)
from cdo import Cdo


print("argument list", sys.argv)


def slice_bbox(file, file_out, lonmin, lonmax, latmin, latmax):
cdo = Cdo()
cdo.sellonlatbox(
lonmin, lonmax, latmin, latmax, input=file, output=file_out, options="-f nc4"
)


def slice_time(file, file_out, year_from, year_to):
cdo = Cdo()
cdo.seltimestep(year_from, year_to, input=file, output=file_out, options="-f nc4")

def slice_bbox(file, file_out, lonmin, lonmax, latmin, latmax):
cdo=Cdo()
cdo.sellonlatbox(lonmin,lonmax,latmin,latmax,input=file,output=file_out,options="-f nc4")

def slice_time(file, file_out, year_from, year_to):
cdo=Cdo()
cdo.seltimestep(year_from,year_to, input=file,output=file_out,options="-f nc4")

if sys.argv[1] == "bbox":
file = sys.argv[2]
file_out = sys.argv[3]
lonmin = sys.argv[4]
lonmax = sys.argv[5]
latmin = sys.argv[6]
latmax = sys.argv[7]
latmax = sys.argv[7]
slice_bbox(file, file_out, lonmin, lonmax, latmin, latmax)

if sys.argv[1] == "time":
file = sys.argv[2]
file_out = sys.argv[3]
year_from = (int(sys.argv[4])-int(sys.argv[6])) * 360
year_from = (int(sys.argv[5])-int(sys.argv[6])) * 360
slice_time(file, file_out, year_from, year_from)
year_from = (int(sys.argv[4]) - int(sys.argv[6])) * 360
year_from = (int(sys.argv[5]) - int(sys.argv[6])) * 360
slice_time(file, file_out, year_from, year_from)
Loading
Loading