Skip to content

Commit

Permalink
Updated headers with licenses
Browse files Browse the repository at this point in the history
  • Loading branch information
vmagnin committed Oct 31, 2023
1 parent f05f5d8 commit f13a629
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 12 deletions.
1 change: 0 additions & 1 deletion example/example1.f90
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
! The MIT License (MIT)
!
! Copyright (c) 2023 AliG (gha3mi)

!
! Permission is hereby granted, free of charge, to any person obtaining a copy
! of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions src/colormap_class.f90
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
! The MIT License (MIT)
!
! Copyright (c) 2023 Vincent Magnin
! Copyright (c) 2023 Vincent Magnin, gha3mi
!
! Permission is hereby granted, free of charge, to any person obtaining a copy
! of this software and associated documentation files (the "Software"), to deal
Expand All @@ -21,7 +21,7 @@
! SOFTWARE.
!-------------------------------------------------------------------------------
! Contributed by vmagnin: 2023-09-26
! Last modification: vmagnin 2023-10-26
! Last modification: gha3mi 2023-10-31
!-------------------------------------------------------------------------------


Expand Down
4 changes: 2 additions & 2 deletions src/colormap_parameters.f90
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module colormap_parameters
implicit none
private
public :: wp, pi, colormap_name_length

integer, parameter :: colormap_name_length = 30
real(wp), parameter :: pi = 4 * atan(1.0_wp)
end module colormap_parameters
end module colormap_parameters
42 changes: 37 additions & 5 deletions src/matplotlib_colormaps.f90
Original file line number Diff line number Diff line change
@@ -1,12 +1,44 @@
! The MIT License (MIT)
!
! Copyright (c) 2023, AliG (gha3mi) for the Fortran translation
!
! New matplotlib colormaps by Nathaniel J. Smith, Stefan van der Walt,
! and (in the case of viridis) Eric Firing, released under
! the CC0 license / public domain dedication.
! See http:https://creativecommons.org/publicdomain/zero/1.0/
! and https://github.com/BIDS/colormap/blob/master/colormaps.py
!
! Permission is hereby granted, free of charge, to any person obtaining a copy
! of this software and associated documentation files (the "Software"), to deal
! in the Software without restriction, including without limitation the rights
! to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
! copies of the Software, and to permit persons to whom the Software is
! furnished to do so, subject to the following conditions:
!
! The above copyright notice and this permission notice shall be included in all
! copies or substantial portions of the Software.
!
! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
! IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
! FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
! AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
! LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
! OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
! SOFTWARE.
!-------------------------------------------------------------------------------
! Contributed by gha3mi: 2023-10-30
! Last modification: gha3mi 2023-10-30
!-------------------------------------------------------------------------------

module matplotlib_colormaps
use colormap_parameters, only: colormap_name_length
implicit none
private

character(*), dimension(*), parameter, public :: matplotlib_colormaps_list = &
[character(colormap_name_length) :: &
"magma", "inferno","plasma", "viridis"]

integer, dimension(0:255, 1:3), public :: magma=reshape( [ &
0, 0, 4,&
1, 0, 5,&
Expand Down Expand Up @@ -265,7 +297,7 @@ module matplotlib_colormaps
252, 251, 189,&
252, 253, 191&
], shape(magma), order=[2, 1] )

integer, dimension(0:255, 1:3), public :: inferno=reshape( [ &
0, 0, 4,&
1, 0, 5,&
Expand Down Expand Up @@ -524,7 +556,7 @@ module matplotlib_colormaps
250, 253, 161,&
252, 255, 164&
], shape(inferno), order=[2, 1] )

integer, dimension(0:255, 1:3), public :: plasma=reshape( [ &
13, 8, 135,&
16, 7, 136,&
Expand Down Expand Up @@ -783,7 +815,7 @@ module matplotlib_colormaps
240, 247, 36,&
240, 249, 33&
], shape(plasma), order=[2, 1] )

integer, dimension(0:255, 1:3), public :: viridis=reshape( [ &
68, 1, 84,&
68, 2, 86,&
Expand Down
30 changes: 28 additions & 2 deletions src/miscellaneous_colormaps.f90
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
! The MIT License (MIT)
!
! Copyright (c) 2023 Vincent Magnin, gha3mi
!
! Permission is hereby granted, free of charge, to any person obtaining a copy
! of this software and associated documentation files (the "Software"), to deal
! in the Software without restriction, including without limitation the rights
! to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
! copies of the Software, and to permit persons to whom the Software is
! furnished to do so, subject to the following conditions:
!
! The above copyright notice and this permission notice shall be included in all
! copies or substantial portions of the Software.
!
! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
! IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
! FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
! AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
! LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
! OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
! SOFTWARE.
!-------------------------------------------------------------------------------
! Contributed by vmagnin: 2023-09-26
! Last modification: gha3mi 2023-10-31
!-------------------------------------------------------------------------------

module miscellaneous_colormaps
use colormap_parameters, only: colormap_name_length, wp, pi
implicit none
Expand All @@ -6,7 +32,7 @@ module miscellaneous_colormaps
public :: grey_colormap, inverted_grey_colormap, fire_colormap,&
rainbow_colormap, inverted_rainbow_colormap, zebra_colormap,&
cubehelix_colormap

character(*), dimension(*), parameter, public :: miscellaneous_colormaps_list = &
[character(colormap_name_length) :: &
"grey", "inverted_grey", "fire", "rainbow", "inverted_rainbow", "zebra", "cubehelix"]
Expand Down Expand Up @@ -144,4 +170,4 @@ pure subroutine cubehelix_colormap(map, nlev, varargs)
map(i, 3) = nint(255*(fract + amp*(+1.97294_wp*cos(angle))))
end do
end subroutine cubehelix_colormap
end module miscellaneous_colormaps
end module miscellaneous_colormaps

0 comments on commit f13a629

Please sign in to comment.